Topic
  • 1 reply
  • Latest Post - ‏2013-05-28T09:23:37Z by arzetry
helloicap
helloicap
2 Posts

Pinned topic How can I visit different shared service from my app?

‏2013-05-28T06:16:14Z |

I see there are different kind of services listed in Cloud Explorer. 

How can I visit derby service in my app? what about social & location service? any difference ?

  • arzetry
    arzetry
    11 Posts

    Re: How can I visit different shared service from my app?

    ‏2013-05-28T09:23:37Z  

    Hi,

    When you drag cloud services to your application, you can use them in your app. 

    For Derby service, below are some sample code you can refer:

     

    public class MyServlet extends HTTPServlet{        
    @Resource(name="mydb")        
    private DataSource myDataSource;
    or        
    InitialContext ctx = new InitialContext();        
    DataSource ds = (DataSource) ctx.lookup("mydb");   
    }

    By the way, "mydb" is the derby instance which you create in could explorer view and then drag it to your applcation.

    For Social and Location service, you can use the same way to drag these service to your application first. Then you can invoke these services's api in you application code. There are some sample code dilivered with sandbox, you can get them from Cloud Explorer View, double click Sample Location v0.1 or Samole Social v0.1, then you will get these inofrmation from eclipse workbench, feel free to switch the different tags to get related documents or sample code. 

     

    Updated on 2013-05-28T09:25:14Z at 2013-05-28T09:25:14Z by arzetry