GetConnection from Oracle Database Cloud Service

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

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

Similar Messages

  • Network security with Oracle Database Cloud Service

    Does the Oracle Database Cloud service support SSL? Or, any form of network encryption/authentication between a client and the service across the Internet?

    Thank you Rick. I'm intending to use Oracle Database Cloud Service as a "Database-as-a-Service", however I have read that it is actually more of a "Platform-as-a-Service" offering.
    What I would like to do is to interact with the Oracle Database Cloud Service via a local JDBC client. However, from further reading, it looks like the only way to interact with the Oracle Database Cloud Service from a non-Oracle-cloud-based client is via its RESTful web services (which, as you said, support SSL).
    That is to say, I cannot simply connect to the Oracle Database Cloud Service from a local client just through JDBC alone. It looks like I would have to configure my client to make the relevant RESTful web service calls instead, and likewise configure my settings on the Oracle Database Cloud Service to make the necessary translations (from REST to SQL).
    Just to finally clarify, is my above understanding correct?

  • I want to resell Oracle Database Cloud Service. What are the criteria to do so?

    In order to resell Oracle Database Cloud Service, partners need to meet the following criteria:
    Be a Gold, Platinum, or Diamond member of the Oracle PartnerNetwork in good standing with a valid OPN Agreement.
    Have a valid Full Use Program Distribution Agreement (FUDA) with Oracle, or be in the process of applying for one.
    Have a valid Cloud Services Distribution Addendum (CSDA) or be in the process of applying for one.
    For questions about the criteria, how to apply for OPN, FUDA and CSDA please contact the Oracle Partner Business Center via phone, email or chat. The social media service also is available on Twitter at @OrclPartnerBiz
    Thank you.
    Emilia

    Hi Srini,
    In order to resell our Cloud Services, please see below the current requirements:
    Be an Oracle PartnerNetwork member in good standing (Gold or higher) with a valid OPN Agreement
    Meet the resale competency criteria set forth within each of the Knowledge Zones (listed here)
    Execute a Full Use Program Distribution Agreement (FUDA) and Cloud Services Distribution Addendum (CSDA)
    You can also find more information here.
    Thanks

  • Database access from Oracle Java Cloud Service application

    I have registered for Oracle Java Cloud Service for trial period. I want to deploy a Spring MVC 3.2 and Hibernate 4.0 web application.
    I created a table in the Database Cloud. I am not sure how do I access the Database Cloud Service from my application.
    Need your guidance/pointers/references that can help me establish connection from my application to the database.
    Thanks,
    Ujjwal

    Hi,
    Use JPA - see the visitors example, it uses @PersistenceUnit injection with previously weaved .class entity files.
    You can use application managed EMF's and EntityManagers with code like the following - which is not preferable to using @PersistenceContext injection on an @Stateless session EJB but...
              EntityManagerFactory emf = Persistence.createEntityManagerFactory("JPAServletPU");
              EntityManager em = emf.createEntityManager();
              EntityTransaction transaction = null;
              try {
                   transaction = em.getTransaction();
                   transaction.begin();
                   Visitor entity = new Visitor();
                   entity.setName(name);
                   entity.setNum(num);
                   em.persist(entity);
                   transaction.commit();
                   System.out.println("Committing: " + entity);
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   em.close();
                   emf.close();
    Use a persistence.xml like the following
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="JPAServletPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
         <!--https://cloud.oracle.com/mycloud/f?p=5300:1000:259334829915901-->
    <jta-data-source>database</jta-data-source>
    <class>com.vision.cloud.jpa.Visitor</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
         <property name="eclipselink.target-database" value="Oracle10g" />
    <property name="eclipselink.ddl-generation" value="create-tables"/>
    <!-- property name="eclipselink.ddl-generation" value="drop-and-create-tables"/-->
    </properties>
    </persistence-unit>
    </persistence>
    Check out a tutorial on WebLogic JPA ORM usage here to get started as well.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial

  • Is there a way to terminate Oracle Database Cloud Service - S5 service?

    Hi All,
    I'm having a very terrible situation here. I have been trying to terminate my database cloud service but nobody in Oracle sale team or support team are able to do it. I spoke to a guy from sales team and he forwarded my call to a guy in support team which he said he'll do it and gave me a reference number. A few weeks later I got an email from a billing department asking me to pay the amount that was due. I explained to him the situation and got no words back from him. Guess what! today I checked my bank account and found that Oracle has taken the payment from me!
    I'm furiously angry with Oracle! It seems that there is no escape from the cloud service!  the customer service is terrible and there seems no co-ordinations between different departments.
    I really appreciate for your help as I dont who I should and can speak to.
    Cheers,
    Syaifuddin

    Not good to hear.... I hope it has been resolved by now.
    However, in case of such an event, which will not happen to often, you can always request your bank to block this until the situation has been resolved. In esscece this should not happen however I can imagine that in a very unlikely scenario this could happen.
    Hope Iloon Wolff-Oracle has been able to resolve this for you.
    Regards,
    Johan Louwers.

  • Application deployed on Oracle Java Cloud Service - SaaS Extension is not connecting with cloud database.

    Hello Experts,
    I have deployed an ADF application on Oracle Java Cloud Service - SaaS Extension and also deployed database objects from local environment to cloud using JDeveloper. I can see the cloud database has tables and data which I have deployed but when I access the application it seems it is not able to connect with cloud database.
    I have followed below document and same sample application (HRSystem). 
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/JDeveloperPart1/jdeveloperPart1.html
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/JDeveloperPart2/jdeveloperPart2.html
    Please guide me what can be the issue.
    Regards
    Gulam Dyer

    Hi,
    Can you give us more details about your issue? Any error messages?
    Thanks,
    Bogdan

  • Facing Problem  In Using Oracle Database Cloud Backup Service

    Hi Everyone,
    I m trying to use Oracle Database Backup Service, for this i have done the following as mentioned in the documentation.
    http://www.oracle.com/technetwork/database/features/availability/twp-oracledatabasebackupservice-2183633.pdf
    1.Downloaded the opc_installer from otn and unzipped.
    2. Executed the following statement from command prompt
    java -jar opc_install.jar -serviceName myService -identityDomain myDomain
    -opcId [email protected] -opcPass myPassword -configFile "C:\Oracle\OPC\conf"
    -walletDir  "C:\Oracle\OPC\wallet"  -libDir "C:\Oracle\OPC\lib"
    Using my credentials, servicename , identitydomain in the above statement.
    Download Complete message appears.
    3. Connects to RMAN and configure channel for sbt by passing this.
    configure channel device type sbt parms
    'SBT_LIBRARY=C:\Oracle\OPC\lib\oraopc12.dll
    ENV=(OPC_PFILE=C:\Oracle\OPC\conf\conf.txt)';
    4.To test the installation i executed the given statement "backup device type sbt current controlfile;"
    Starting backup at 31-MAY-14
    RMAN-00571:
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
    RMAN-00571:
    RMAN-03002: failure of backup command at 05/31/2014 04:41:44
    ORA-19554: error allocating device, device type: SBT_TAPE, device name:
    ORA-27000: skgfqsbi: failed to initialize storage subsystem (SBT) layer
    OSD-01400: Message 1400 not found;  product=RDBMS; facility=SOSD
    (OS 7110)
    ORA-19511: Error received from media manager layer, error text:
       SBT error = 7110, errno = 1400, sbtinit: internal error - invalid argument(s)
    Getting the following error.
    My database version is 11g 11.2.0.3 and is installed in windows server 2008.
    Please help to resolve the error.
    Looking for your help.
    Regards

    Hi,
    Could you try the following command ? Seems like some dependent Windows DLL is not being loaded..
    sbttest foo -libname <abs-path-of-directory>\oraopc12.dll
    This will output the reason why oraopc12.dll can't be loaded.
    Thanks

  • ODSI service using function from oracle database

    Hi ,
    I need to create a ODSI service using function from oracle database.
    I am not sure how to create a Physical Layer and Logical Layer using the function fron db.
    Kindly provide a sample . I need It ASAP. Thanks in advance.
    Regards,
    Tara

    Here's what you do.
    Create New Physical Data Service -> Relational -> MyDataSource -> Table -> SomeTable ... finish the wizard.
    So now you have a Physical Data Service that represents a database table.
    Create New Physcial Data Service -> Relational -> MyDataSource (the same one as above) -> Database Function -> Enter UPPER for the Function name, enter MyUpper fro the XQuery Function. Finish the Wizard (use something like MyUpperDs for the ds name).
    Open MyUpperDs. Right-click -> Edit Signature on MyUpper. Change the ReturnType to string, change the Occurrence to Zero or One.
    Add a parameter, change the Type to string, change the Occurrence to Zero or One.
    Save.
    Now, open the first ds you made SomeTable.ds (whatever). Run it in the test view.
    Go to the Overview tab. Create New Operation. Give it the name SOMETABLE_UPPER. Save it.
    Go to the Query Map tab, open SOMETABLE_UPPER. Drag and drop SOMETABLE (the system-generated function into the mapper. It will show a dotted line from SOMETABLE to the Return. Now drag-and-drop the SOMETABLE to the top-level element of the return type, it will show solid lines from each element in SOMETABLE to each element in the return type.
    Now, drag-and-drop MyUpperDs.MyUpper into the Query Mapper. Edit the source, find where it added the line "for $x in myd:MyUpper()" and delete that line.
    Change a line that simply returns a value to use your function, for example, change
    <FIRST_NAME>{fn:data($CUSTOMER/FIRST_NAME)}</FIRST_NAME>
    to
    <FIRST_NAME>{myd:MyUpper(fn:data($CUSTOMER/FIRST_NAME))}</FIRST_NAME>
    Click on the Plan tab and Show Query Plan. You will see that in the query plan, it is using the database UPPER function where you specified MyUpper.
    Go to the Test View and run it.
    I used the RTLCUSTOMER table in cgDataSource
    xquery version "1.0" encoding "UTF-8";
    (::pragma xds <x:xds xmlns:x="urn:annotations.ld.bea.com" targetType="t:CUSTOMER" xmlns:t="ld:physical/CUSTOMER">
    <creationDate>2010-10-14T13:09:54</creationDate>
    <relationalDB name="cgDataSource" providerId="Pointbase"/>
    <field xpath="CUSTOMER_ID" type="xs:string">
    <extension nativeXpath="CUSTOMER_ID" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0" nativeKey="true"/>
    <properties nullable="false"/>
    </field>
    <field xpath="FIRST_NAME" type="xs:string">
    <extension nativeXpath="FIRST_NAME" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="64" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="LAST_NAME" type="xs:string">
    <extension nativeXpath="LAST_NAME" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="64" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="CUSTOMER_SINCE" type="xs:date">
    <extension nativeXpath="CUSTOMER_SINCE" nativeTypeCode="91" nativeType="DATE" nativeSize="10" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="EMAIL_ADDRESS" type="xs:string">
    <extension nativeXpath="EMAIL_ADDRESS" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="TELEPHONE_NUMBER" type="xs:string">
    <extension nativeXpath="TELEPHONE_NUMBER" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="SSN" type="xs:string">
    <extension nativeXpath="SSN" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="16" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="BIRTH_DAY" type="xs:date">
    <extension nativeXpath="BIRTH_DAY" nativeTypeCode="91" nativeType="DATE" nativeSize="10" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="DEFAULT_SHIP_METHOD" type="xs:string">
    <extension nativeXpath="DEFAULT_SHIP_METHOD" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="16" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="EMAIL_NOTIFICATION" type="xs:short">
    <extension nativeXpath="EMAIL_NOTIFICATION" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="NEWS_LETTTER" type="xs:short">
    <extension nativeXpath="NEWS_LETTTER" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="ONLINE_STATEMENT" type="xs:short">
    <extension nativeXpath="ONLINE_STATEMENT" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="LOGIN_ID" type="xs:string">
    <extension nativeXpath="LOGIN_ID" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="50" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <key name="CUSTOMER_0_SYSTEMNAMEDCONSTRAINT__PRIMARYKEY" type="cus:CUSTOMER_KEY" inferredSchema="true" xmlns:cus="ld:physical/CUSTOMER"/>
    </x:xds>::)
    declare namespace myd= "ld:physical/MyDs";
    declare namespace f1 = "ld:physical/CUSTOMER";
    import schema namespace t1 = "ld:physical/CUSTOMER" at "ld:physical/schemas/CUSTOMER.xsd";
    import schema "ld:physical/CUSTOMER" at "ld:physical/schemas/CUSTOMER_KEY.xsd";
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="read" isPrimary="false" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare function f1:CUSTOMER() as schema-element(t1:CUSTOMER)* external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="create" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:createCUSTOMER($p as element(t1:CUSTOMER)*)as schema-element(t1:CUSTOMER_KEY)* external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="update" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:updateCUSTOMER($p as changed-element(t1:CUSTOMER)*) as empty() external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="delete" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:deleteCUSTOMER($p as element(t1:CUSTOMER)*) as empty() external;
    (::pragma function <f:function kind="read" visibility="public" isPrimary="false" xmlns:f="urn:annotations.ld.bea.com"/>::)
    declare function f1:CUSTOMER_UPPER() as element(f1:CUSTOMER)*{
    for $CUSTOMER in f1:CUSTOMER()
    return
    <t1:CUSTOMER>
    <CUSTOMER_ID>{fn:data($CUSTOMER/CUSTOMER_ID)}</CUSTOMER_ID>
    <FIRST_NAME>{myd:MyUpper(fn:data($CUSTOMER/FIRST_NAME))}</FIRST_NAME>
    <LAST_NAME>{fn:data($CUSTOMER/LAST_NAME)}</LAST_NAME>
    <CUSTOMER_SINCE>{fn:data($CUSTOMER/CUSTOMER_SINCE)}</CUSTOMER_SINCE>
    <EMAIL_ADDRESS>{fn:data($CUSTOMER/EMAIL_ADDRESS)}</EMAIL_ADDRESS>
    <TELEPHONE_NUMBER>{fn:data($CUSTOMER/TELEPHONE_NUMBER)}</TELEPHONE_NUMBER>
    <SSN?>{fn:data($CUSTOMER/SSN)}</SSN>
    <BIRTH_DAY?>{fn:data($CUSTOMER/BIRTH_DAY)}</BIRTH_DAY>
    <DEFAULT_SHIP_METHOD?>{fn:data($CUSTOMER/DEFAULT_SHIP_METHOD)}</DEFAULT_SHIP_METHOD>
    <EMAIL_NOTIFICATION?>{fn:data($CUSTOMER/EMAIL_NOTIFICATION)}</EMAIL_NOTIFICATION>
    <NEWS_LETTTER?>{fn:data($CUSTOMER/NEWS_LETTTER)}</NEWS_LETTTER>
    <ONLINE_STATEMENT?>{fn:data($CUSTOMER/ONLINE_STATEMENT)}</ONLINE_STATEMENT>
    <LOGIN_ID?>{fn:data($CUSTOMER/LOGIN_ID)}</LOGIN_ID>
    </t1:CUSTOMER>
    xquery version "1.0" encoding "UTF-8";
    (::pragma xfl <x:xfl xmlns:x="urn:annotations.ld.bea.com">
    <creationDate>2010-10-14T13:10:45</creationDate>
    <customNativeFunctions>
    <relational>
    <dataSource>cgDataSource</dataSource>
    </relational>
    </customNativeFunctions>
    </x:xfl>::)
    declare namespace f1 = "ld:physical/MyDs";
    (::pragma function <f:function visibility="protected" kind="library" isPrimary="false" nativeName="UPPER" xmlns:f="urn:annotations.ld.bea.com">
    <nonCacheable/>
    </f:function>::)
    declare function f1:MyUpper($arg0 as xs:string?) as xs:string? external;
    <cus:CUSTOMER xmlns:cus="ld:physical/CUSTOMER">
    <CUSTOMER_ID>CUSTOMER1</CUSTOMER_ID>
    <FIRST_NAME>JACK</FIRST_NAME>
    <LAST_NAME>Black</LAST_NAME>
    <CUSTOMER_SINCE>2001-10-01</CUSTOMER_SINCE>
    <EMAIL_ADDRESS>[email protected]</EMAIL_ADDRESS>
    <TELEPHONE_NUMBER>2145134119</TELEPHONE_NUMBER>
    <SSN>295-13-4119</SSN>
    <BIRTH_DAY>1970-01-01</BIRTH_DAY>
    <DEFAULT_SHIP_METHOD>AIR</DEFAULT_SHIP_METHOD>
    <EMAIL_NOTIFICATION>1</EMAIL_NOTIFICATION>
    <NEWS_LETTTER>0</NEWS_LETTTER>
    <ONLINE_STATEMENT>1</ONLINE_STATEMENT>
    </cus:CUSTOMER>
    .

  • How to call web services from oracle database 10g

    Hi all ,
    How can i call web services from oracle database 10g ?
    thanks ...

    abdou123 wrote:
    but how can i get complex result
    for example
    i pass input parameter like National Id Number
    and get the person details ( name , age , date of birth , ............ ) .Basic approach to web services using UTL_HTTP explained in {message:id=10448611}.
    An example of using a pipeline table function as a data transformation process (turning web data into rows and columns) in {message:id=10158148}.

  • Trial subscription for Oracle BI Cloud Services (BICS)

    I need help from anyone to get a trial subscription for Oracle Business Intelligence Cloud Services.
    Thanks in Advance
    Stanley T

    Hi Emilia,
    There in the link I see provisions to buy a paid subscriptions and couldn't get an trial subscription. Please can you help on the same, as I would like to have an experience of the BICS before purchasing a paid subscription. Whereas I am seeing a provision "Try it" for Database cloud services like the below
    Regards
    Stanley T

  • How to extract data from oracle database directly in to bi7.0 (net weaver)

    how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
    Thanks
    York

    You can use UDConnect to get from Oracle database in to BW
    <b>Data Transfer with UD Connect -</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
    <b>Prerequisites</b>
    You have installed the SAP WAS J2EE Engine with BI Java components.  You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
    Hope it Helps
    Chetan
    @CP..

  • Passing Array of java objects to and from oracle database-Complete Example

    Hi all ,
    I am posting a working example of Passing Array of java objects to and from oracle database . I have struggled a lot to get it working and since finally its working , postinmg it here so that it coudl be helpful to the rest of the folks.
    First thinsg first
    i) Create a Java Value Object which you want to pass .
    create or replace and compile java source named Person as
    import java.sql.*;
    import java.io.*;
    public class Person implements SQLData
    private String sql_type = "PERSON_T";
    public int person_id;
    public String person_name;
    public Person () {}
    public String getSQLTypeName() throws SQLException { return sql_type; }
    public void readSQL(SQLInput stream, String typeName) throws SQLException
    sql_type = typeName;
    person_id = stream.readInt();
    person_name = stream.readString();
    public void writeSQL(SQLOutput stream) throws SQLException
    stream.writeInt (person_id);
    stream.writeString (person_name);
    ii) Once you created a Java class compile this class in sql plus. Just Copy paste and run it in SQL .
    you should see a message called "Java created."
    iii) Now create your object Types
    CREATE TYPE person_t AS OBJECT
    EXTERNAL NAME 'Person' LANGUAGE JAVA
    USING SQLData (
    person_id NUMBER(9) EXTERNAL NAME 'person_id',
    person_name VARCHAR2(30) EXTERNAL NAME 'person_name'
    iv) Now create a table of Objects
    CREATE TYPE person_tab IS TABLE OF person_t;
    v) Now create your procedure . Ensure that you create dummy table called "person_test" for loggiing values.
    create or replace
    procedure give_me_an_array( p_array in person_tab,p_arrayout out person_tab)
    as
    l_person_id Number;
    l_person_name Varchar2(200);
    l_person person_t;
    l_p_arrayout person_tab;
    errm Varchar2(2000);
    begin
         l_p_arrayout := person_tab();
    for i in 1 .. p_array.count
    loop
         l_p_arrayout.extend;
         insert into person_test values(p_array(i).person_id, 'in Record '||p_array(i).person_name);
         l_person_id := p_array(i).person_id;
         l_person_name := p_array(i).person_name;
         l_person := person_t(null,null);
         l_person.person_id := l_person_id + 5;
         l_person.person_name := 'Out Record ' ||l_person_name ;
         l_p_arrayout(i) := l_person;
    end loop;
    p_arrayout := l_p_arrayout;
         l_person_id := p_arrayout.count;
    for i in 1 .. p_arrayout.count
    loop
    insert into person_test values(l_person_id, p_arrayout(i).person_name);
    end loop;
    commit;
    EXCEPTION WHEN OTHERS THEN
         errm := SQLERRM;
         insert into person_test values(-1, errm);
         commit;
    end;
    vi) Now finally create your java class which will invoke the pl/sql procedure and get the updated value array and then display it on your screen>Alternatively you can also check the "person_test" tbale
    import java.util.Date;
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class ArrayDemo
    public static void passArray() throws SQLException
    Connection conn = getConnection();
    ArrayDemo a = new ArrayDemo();
    Person pn1 = new Person();
    pn1.person_id = 1;
    pn1.person_name = "SunilKumar";
    Person pn2 = new Person();
    pn2.person_id = 2;
    pn2.person_name = "Superb";
    Person pn3 = new Person();
    pn3.person_id = 31;
    pn3.person_name = "Outstanding";
    Person[] P_arr = {pn1, pn2, pn3};
    Person[] P_arr_out = new Person[3];
    ArrayDescriptor descriptor =
    ArrayDescriptor.createDescriptor( "PERSON_TAB", conn );
    ARRAY array_to_pass =
    new ARRAY( descriptor, conn, P_arr);
    OracleCallableStatement ps =
    (OracleCallableStatement )conn.prepareCall
    ( "begin give_me_an_array(?,?); end;" );
    ps.setARRAY( 1, array_to_pass );
         ps.registerOutParameter( 2, OracleTypes.ARRAY,"PERSON_TAB" );
         ps.execute();
         oracle.sql.ARRAY returnArray = (oracle.sql.ARRAY)ps.getArray(2);
    Object[] personDetails = (Object[]) returnArray.getArray();
    Person person_record = new Person();
    for (int i = 0; i < personDetails.length; i++) {
              person_record = (Person)personDetails;
              System.out.println( "row " + i + " = '" + person_record.person_name +"'" );
                        public static void main (String args[]){
         try
                             ArrayDemo tfc = new ArrayDemo();
                             tfc.passArray();
         catch(Exception e) {
                        e.printStackTrace();
              public static Connection getConnection() {
         try
                             Class.forName ("oracle.jdbc.OracleDriver");
                             return DriverManager.getConnection("jdbc:oracle:thin:@<<HostNanem>>:1523:VIS",
                             "username", "password");
         catch(Exception SQLe) {
                        System.out.println("IN EXCEPTION BLOCK ");
                        return null;
    and thats it. you are done.
    Hope it atleast helps people to get started. Comments are appreciated. I can be reached at ([email protected]) or [email protected]
    Thanks
    Sunil.s

    Hi Sunil,
    I've a similar situation where I'm trying to insert Java objects in db using bulk insert. My issue is with performance for which I've created a new thread.
    http://forum.java.sun.com/thread.jspa?threadID=5270260&tstart=30
    I ran into your code and looked into it. You've used the Person object array and directly passing it to the oracle.sql.ARRAY constructor. Just curios if this works, cos my understanding is that you need to create a oracle.sql.STRUCT out of ur java object collection and pass it to the ARRAY constructor. I tried ur way but got this runtime exception.
    java.sql.SQLException: Fail to convert to internal representation: JavaBulkInsertNew$Option@10bbf9e
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatum(OracleTypeADT.java:239)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatumArray(OracleTypeADT.java:274)
                        at oracle.jdbc.oracore.OracleTypeUPT.toDatumArray(OracleTypeUPT.java:115)
                        at oracle.sql.ArrayDescriptor.toOracleArray(ArrayDescriptor.java:1314)
                        at oracle.sql.ARRAY.<init>(ARRAY.java:152)
                        at JavaBulkInsertNew.main(JavaBulkInsertNew.java:76)
    Here's a code snippet I used :
    Object optionVal[] =   {optionArr[0]};   // optionArr[0] is an Option object which has three properties
    oracle.sql.ArrayDescriptor empArrayDescriptor = oracle.sql.ArrayDescriptor.createDescriptor("TT_EMP_TEST",conn);
    ARRAY empArray = new ARRAY(empArrayDescriptor,conn,optionVal);If you visit my thread, u'll see that I'm using STRUCT and then pass it to the ARRAY constructor, which works well, except for the performance issue.
    I'll appreciate if you can provide some information.
    Regards,
    Shamik

  • Walkthrough: Displaying Data from Oracle database in a Windows application.

    This article is intended to illustrate one of the most common business scenarios such as displaying data from Oracle database on a form in a Windows application using DataSet objects and .NET Framework Data Provider for Oracle.
    You can read more at http://www.c-sharpcorner.com/UploadFile/john_charles/WalkthroughDisplayingDataOracleWindowsapplication05242007142059PM/WalkthroughDisplayingDataOracleWindowsapplication.aspx
    Enjoy my article.

    hi,
    this is the code :
    public class TableBean {
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    public List getperInfoAll() {
    int i = 0;
    try
    con = DriverManager.getConnection("url","root","root");
    ps = con.createStatement();
    rs = ps.executeQuery("select * from user");
    while(rs.next()){
    System.out.println(rs.getString(1));
    perInfoAll.add(i,new perInfo(rs.getString(1),rs.getString(2),rs.getString(3)));
    i++;
    catch (Exception e)
    System.out.println("Error Data : " + e.getMessage());
    return perInfoAll;
    public class perInfo {
    String uname;
    String firstName;
    String lastName;
    public perInfo(String firstName,String lastName,String uname) {
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    public String getUname() {
    return uname;
    public String getFirstName() {
    return firstName;
    public String getLastName() {
    return lastName;
    ADF table code:
    <af:table value="#{tableBean.perInfoAll}" var="row"
    binding="#{backing_Display.table1}" id="table1">
    <af:column sortable="false" headerText=""
    align="start">
    <af:outputText value="#{row.firstName"/>//---> Jdeveloper 11g doesn't allow me to use this.. it says firstName is an unknown property..
    </af:column>
    </af:table>
    Please tell me is this the way to do it.. or is it a must to use the DataCollection from the data controls panel...
    Thanks...

  • Calling Dot Net program From oracle Database

    Hi
    is there any way to call DOT NET program Like C# from oracle database, i mean is there way to call it from pl-sql stored procedure or trigger ..etc
    I read that is possible with java , C, C++, but is it possible with C#
    Best Regards

    If your Oracle database is running on Windows and is a reasonably recent version (I believe 10.1 or later), it has the ability to create .Net stored procedures just like you have the ability to create Java stored procedures. That tends not to be a particularly commonly used feature but it's an option. If you compile your .Net application to a DLL, you could also call it as an external procedure.
    More commonly, however, if you're talking about a .Net program that is deployed on a middle tier server, however, would be for the .Net application to expose an API (say, a web service API) that the database could invoke (via UTL_DBWS or UTL_HTTP).
    Justin

  • Configuring EMail in Database Cloud Service(Schema)

    Hi
    I am trying to use APEX_MAIL for emailing. Before using this, Where do I configure SMTP host , port ...etc in my Database Cloud Service.??
    I tried log in to APEX console of my Database, Administration tab but I didn't find any place to setup this information.
    I am using DB cloud Service associated with JCS-SAAS Extension (Trial version)
    Thanks
    Samrajyam

    I don't think you need or even can change the configuration. You should be able to send and email with:
    BEGIN
        l_id := APEX_MAIL.SEND(
            p_to        => '[email protected]',
            p_from      => '[email protected]',
            p_subj      => 'APEX_MAIL',
            p_body      => 'Some content',
            p_body_html => '<b>Some content</b>');
    END;
    For details of APEX_MAIL refer to the documentation.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

Maybe you are looking for