This discussion is archived
1 Reply Latest reply: Nov 21, 2013 11:56 AM by RickG RSS

getConnection from Oracle Database Cloud Service

paula Newbie
Currently Being Moderated

I created a table at the internal JCS instance, and tried to create a web service to insert the data into the table. It's a simple insert operation, so I prefer to coding it without JPA or ADF business component.

So far, the web service works, but it can't connect to database service.

 

Here is my code snippet of the web service method which deployed on JCS, and the jndi name is database,

        try {

            Context ctx = new InitialContext();

            DataSource ds = (DataSource)ctx.lookup("database");

            conn = ds.getConnection();

 

            String sql = "insert into bvrequest(user_id,activity) values(?,?)";

            pstmt = conn.prepareStatement(sql);

            pstmt.setString(1, userid);

            pstmt.setString(2, activity);

            pstmt.executeUpdate();

            return "OK";

        }

 

The thrown exception is,

weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool database to allocate to applications, please increase the size of the pool and retry..

 

Is it a correct way to use Database Cloud Service? Any suggestion/comment is welcome.

 

-Paula

  • 1. Re: getConnection from Oracle Database Cloud Service
    RickG Explorer
    Currently Being Moderated

    Hi Paula -

     

    I think you need to ask this question in the Java Cloud Service forum.  If you are trying to make a connection to a Database Cloud Service from Java outside the Oracle Public Cloud, you cannot do it with JDBC.  You can only use RESTful Web Services from outside the Oracle Public Cloud to access the Oracle Database Cloud.

     

    Hope this helps.

     

    - Rick Greenwald

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points