JDBC Thin-Driver and Oracle Stored Procedure

I've got a Oracle stored procedure which returns a Oracle record.
How can I retrieve the record in java using the JDBC Thin-Driver ?
Record:
TYPE messagerec IS RECORD
(log_level VARCHAR(2), timestamp VARCHAR2(19), text VARCHAR2(200));

Using PL/SQL BOOLEAN, RECORD Types, and TABLE Types:
Oracle SQLJ and JDBC do not support calling arguments or return values of the
PL/SQL BOOLEAN type or RECORD types. Also, when using the Thin driver, they
do not support calling arguments or return values of PL/SQL TABLE types (known
as indexed-by tables). TABLE types are supported for the OCI driver.
Check the following guide,
http://otn.oracle.com/tech/java/sqlj_jdbc/pdf/a96655.pdf

Similar Messages

  • JDBC thin driver and Oracle 8.1.6

    Hi,
    I have installed Oracle 8.1.6 on Windows NT 4.0 with service pack 4 and using Oracle JDBC thin driver driver (classes111.zip). My application is multithreaded, but each thread maintains its own connection (and own set of Statements). Things are okay in single threaded mode, but in multi threaded mode, I get weird errors!
    1. My resultsets are SCROLL_SENTITIVE and UPDATABLE
    2. Sometimes, while updating a row, "No current row" SQLException is thrown, although a row exists that satisfies my select criteria
    3. I am also calling executeUpdate() for inserting new rows and such rows are not seen by successive resultsets!
    Appreciate any hints! Thanks!

    Try this isntead.
    java -classpath d:\jdbc\classes12.zip;. jdbccheckup
    an error occured:
    Exception in thread "main" java.lang.NoClassDefFoundError:jdbccheckup
    Why??????

  • JDBC Thin driver and Oracle names server

    Hi
    Any managed to get the Thin driver to user the Names Server aliases, ie I want to connect to service xxx like
    jdbc:oracle:thin:@xxxx and not specify instance and port as the DB is running in a multiple machine cluster and can be switched to a different machine...
    With OCI driver I have managed on NT but having problem with OCI/Linux and Beta 10g...
    Tks
    Andre

    I don't have much experience with OCI from JDBC, but should work like any other kind of connection via SQL*Net. I.e. I would check if connection can be made using SQLPlus, check environment variables (ORACLE_HOME etc.) of 9iAS instance, check version of JDBC classes and their readme.txt. There are also some settings in sqlnet.ora file which might affect this (like default domain - try to use full name of alias - OCRL.WORLD or whatever alias you have there). You may also want to switch tracing for SQLNet and/or listener on (it's not easy to find in doc how to do it, though) to check if there is at least some traffic between klient and server...
    Myrra

  • JDBC Thin Client and Oracle Long Datatype

    I am using Wepshere 4.0.2 , JDBC 2.0 (thin driver) and oracle 9i.
    I have a procedure which takes Oracle Long Datatype as its parameter.
    I use following code to execute procedure.
    String dataforsql="AAA000000003 123123 07/01/200301/01/2003";
    byte[] bytes = dataforsql.getBytes();
    InputStream is = new ByteArrayInputStream(bytes);
    cstmt=conn.prepareCall("call nscw.CPPF_SAVEPDCRAWTABLE2(?,?,?)");
    cstmt.setAsciiStream (1, is,bytes.length);
    The above code works perfectly for data upto 4000 bytes. Once the data crosses the 4000 mark.
    i get a procedure error
    ORA-01460: unimplemented or unreasonable conversion requested

    cstmt.setAsciiStream (1, is,bytes.length);Oracle's support for CLOB (and BLOB) columns using set{Ascii,Binary}Stream() generally s*cks. You'll have to read Oracle's own JDBC manual (you can read it online at http://technet.oracle.com) for whatever sequence they recommend.
    E.g. for insertion and updation of CLOBS, you're supposed to use an oracle-specific function (EMPTY_CLOB()) as the value in the INSERT/UPDATE statement, and then do a SELECT, getClob(), and use Clob APIs to update the actual column value. At least officially. Or you have to use some Oracle-specific APIs in oracle.sql.Connection and oracle.sql.CLOB.

  • Oracle JDBC Thin Driver for oracle 9.2.0.4

    Hi,
    It would be nice if someone please guide me to the download of Oracle JDBC Thin Driver for oracle 9.2.0.4.
    Thanks in anticipation

    user566773,
    As far as I know, all Oracle JDBC drivers are meant to be backward compatible.
    According to the table on the following Web page, the latest Oracle JDBC driver can be used with Oracle 9.2.0.x DBMS.
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

  • Oracle JDBC Thin Driver and Firewall Problem

    Hi!
    We have Oracle 8.1.5 and Websphere App Server. There is a
    firewall between the two. A servlet creates a connection pool
    (not that of Wesphere's). The frontend is JSP/HTML (no applets).
    The servlet uses the Oracle JDBC Thin Driver for DB Connections.
    The problem is - Once the connection is freed, the connection
    pool is not being able to retrieve it and hence it created
    another one, thus reaching the max. # of connections and the
    system hangs. Restarting the DB service flushes the connection
    and the application starts running again...
    There was a similar problem discussed in this forums long ago. I
    have not yet tried mentioning the firwall port and IP in the
    connection string. But apart from that, is there any other
    setting I need to do (on firewall or for the connectionstring)
    to deal with this problem?
    Someone had suggested to punch a hole in the firewall for the DB
    port - but we can not really do that in the current scenario...
    I would appreciate if anyone could share their experience
    regarding how they resolved this issue.
    Thanks in advance,
    Vijaya.

    One more question -
    Can we use Oracle JDBC OCI driver? We do not have any appletes...
    Does it have firewall issues too? Is there any other driver that
    we can use?
    Thanks,
    Vijaya.

  • Jdbc thin driver connect oracle as internal

    I need to connect to Oracle as Internal using jdbc driver, is there a way we can do this using jdbc thin driver. Actually I don't want to pass username and password as it will be harcoded in a properties file.
    Please let me know.

    Hi Minol,
    Have a look at this code example that shows how to Connect to Database as internal ( as sysdba ). In this code sample the properties are hard-coded, you can supply these Properties by loading them from a properties file.
    Connecting to Oracle Database with DBA privileges
    http://myjdbc.tripod.com/basic/codeindex.html
    The code snippet to load properties from a properties file
    //Import IO related classes
    import java.io.IOException;
    // Necessary support classes
    import java.util.Properties;
    import java.util.Enumeration;
    import java.util.ResourceBundle;
       * This method reads a properties file which is passed as
       * the parameter to it and load it into a java Properties
       * object and returns it.
       * @param file File path
       * @return Properties The properties object
       * @exception IOException if loading properties file fails
       * @since 1.0
      public static Properties loadParams(String file)
          throws IOException {
        // Loads a ResourceBundle and creates Properties from it
        Properties     prop   = new Properties();
        ResourceBundle bundle = ResourceBundle.getBundle(file);
        // Retrieve the keys and populate the properties object
        Enumeration enum = bundle.getKeys();
        String      key  = null;
        while (enum.hasMoreElements()) {
          key = (String) enum.nextElement();
          prop.put(key, bundle.getObject(key));
        return prop;
      }Regards
    Elango.

  • Jdbc thin driver and bulk binding slow insertion performance

    Hello All,
    We have a third party application reporting slow insertion performance, while I traced the session and found out most of elapsed time for one insert execution is sql*net more data from client, it appears bulk binding is being used here because one execution has 200 rows inserted. I am wondering whether this has something to do with their jdbc thin driver(10.1.0.2 version) and our database version 9205. Do you have any similar experience on this, what other possible directions should I explore?
    here is the trace report from 10046 event, I hide table name for privacy reason.
    Besides, I tested bulk binding in PL/SQL to insert 200 rows in one execution, no problem at all. Network folks confirm that network should not be an issue as well, ping time from app server to db server is sub milisecond and they are in the same data center.
    INSERT INTO ...
    values
    (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17,
    :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29, :30, :31, :32,
    :33, :34, :35, :36, :37, :38, :39, :40, :41, :42, :43, :44, :45)
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.02 14.29 1 94 2565 200
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.02 14.29 1 94 2565 200
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 25
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net more data from client 28 6.38 14.19
    db file sequential read 1 0.02 0.02
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 0.00 0.00
    ********************************************************************************

    I have exactly the same problem, I tried to find out what is going on, changed several JDBC Drivers on AIX, but no hope, I also have ran the process on my laptop which produced a better and faster performance.
    Therefore I made a special solution ( not practical) by creating flat files and defining the data as an external table, the oracle will read the data in those files as they were data inside a table, this gave me very fast insertion into the database, but still I am looking for an answer for your question here. Using Oracle on AIX machine is a normal business process followed by a lot of companies and there must be a solution for this.

  • Problem using JDBC Thin driver with Oracle 8i Personal Edition

    Hi all, I have an issue I have been unable to figure out. In order to make my code as portable as possible I am using the JDBC thin driver to access my database. I have been able to connect to an instance of Oracle 8i on a Sun box by hardcoding the following string into getConnection() call:
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=tcp.world)(PROTOCOL=TCP)(Host=<myhostname>)(Port=1521))(ADDRESS=(COMMUNITY=tcp.w orld)(PROTOCOL=TCP)(Host = <myhostname>)(Port = 1526)))(CONNECT_DATA = (SID = <mysidname>)))", <myuser>, <mypassword>);
    My problem is that I cannot figure out what string to use to connect to my local instance of Oracle 8i Personal. I used the following string (the sid I got from the looking at the init.ora file):
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=tcp.world)(PROTOCOL=TCP)(Host=localhost)(Port=1521))(ADDRESS=(COMMUNITY=tcp.world)(PRO TOCOL=TCP)(Host = localhost)(Port = 1526)))(CONNECT_DATA = (SID = orcl)))", "scott", "tiger");
    That didn't work, so I took the only entry found in my tnsnames.ora file in as:
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)))(CONNECT_DATA = (SID = PLSExtProc)(PRESENTATION = RO)))", "scott", "tiger");
    I am not knowing what is wrong, but that didn't work neither. Any suggestions would be highly appreciated.
    Thanks....
    null

    try this:
    conn = DriverManager.getConnection("jdbc:oracle:thin:scott/tiger:@hostname:1521:sid");
    or use system/manager as username/passward
    null

  • Dynamic SQL and Oracle stored procedures

    Does anybody has any experience with invoking an Oracle stored procedures
    with output parameters, using dynamic SQL from Forte?
    Thanks,
    Dimitar

    I would be interested. We are currently using a homegrown DataMapper architecture with the Microsoft OracleClient. I would like to move to ODP.Net once a production version supporting ADO.Net 2.0 is available. After that, I would then like to look at using an off the shelf persistence framework such as EntitySpaces, NHibernate or IdeaBlade's DevForce.

  • Scripted JDBC and Oracle Stored Procedure with in/out Array

    The com.waveset.util.pooledconnection used by Scripted JDBC Adapter extends java.sql.connection.
    I need to pass an Varchar2 Array to the Stored Procedure. I tried using the oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to pass the values, but get a casting exception,as the polledconnection implements only the java.sql.connection and not oracle.sql.connection.
    What are my options of using java.sql.Array with a PL/SQL procedure that takes a varchar2 array as in out parameter?
    Thanks
    Venki

    i ran my procedure which is very similar syndra posted
    create or replace procedure foo(p_dt in date, cv out sys_refcursor) as
    begin
    open cv for
    select e.*
    from table_xyz e
    where start_dt = p_dt;
    end;
    /Here is how is executed
    DECLARE
      P_DT DATE;
      CV SYS_REFCURSOR;
    BEGIN
      P_DT := '10-oct-2005';
      -- CV := NULL;  Modify the code to initialize this parameter
      scott.foo ( P_DT, CV );
      COMMIT;
    END;           
    -- i get PL/SQL procedure successfully complted , But i dont see the result set Or output
    - How do i see the output when i m using refcursor ?? i tried using print , but nothing didnt work
    - Any idea ??
    Thank you!!
    Edited by: user642297 on Jun 24, 2010 1:35 PM

  • Oracle Jdbc Thin driver and nls suppot

    Hello,
    I have a hungarian database with nls_lang variable set to hungarian. I'm trying to do a jdbc connection using classes12.zip
    but I'm getting the hungarian characters converted to question marks or other characters.
    I read suggestions that I must include the nls_charset12.zip in my classpath too. So I did that but I'm still having the same problem.
    What is missed??
    How do I get the right hungarian charachters without any conversion.
    This is becoming frustrating and I'm not able to solve it yet.
    Thanks for your help

    One more question -
    Can we use Oracle JDBC OCI driver? We do not have any appletes...
    Does it have firewall issues too? Is there any other driver that
    we can use?
    Thanks,
    Vijaya.

  • Problem w/ 8.1.6 Thin Driver and Oracle 8.0.5

    I am attempting to connect to two data hosts.
    One is Oracle 8.1.6, the other is Oracle 8.0.5. The DB Admin insists the user name and passwords are the same for both.
    I am using the v8.1.6 100% Java thin driver under both JDK v1.2 and v1.3. My OS is Windows2K Professional.
    I can always connect to the 8.1.6 database but never to the 8.0.5 database under any circumstances. The error I receive when attempting to connect to the 8.0.5 database is:
    java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=134238208)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    Does any one have some insights here?
    My test code fragment is as follows:
    try{
    Class.forName( "oracle.jdbc.driver.OracleDriver" ).newInstance();
    String dbURL = "";
    //dbURL = "jdbc:oracle:thin:@host1:1521:data_source_8_1_6";
    dbURL = "jdbc:oracle:thin:@host2:1521:data_source_8_0_5";
    Connection con = DriverManager.getConnection(dbURL, "test_user", "test_user");
    java.sql.Statement stmt = con.createStatement();
    String sq1String = "SELECT * FROM DUAL";
    java.sql.ResultSet res = stmt.executeQuery(sq1String);
    int rows = 0;
    while(res.next()) {
    rows++;
    System.out.println("rows = " + rows);
    catch(Exception e) {
    System.out.println(e);
    null

    tnsping is working correctly. We can ping the host and it is listening on port 1521. Likewise, there are other applications inhouse using this datasource.
    Since first posting my question, I have also tried running the test program on WinNT. Same problem arises.
    Other suggestions?

  • Jdbc thin driver with Oracle 9i database

    Hi,
    I'm having a problem with java code which previously deployed ok on an Oracle 817 database. In attempting to access data from a 9i database I get the following error:
    java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
    From looking around I get the impression that the problem is with an incompatability with the driver and the 9i database. Any ideas as to whether this is true or not or suggestions on how to resolve it?
    Any help will be greatly appreciated.
    Thanks,
    Alison

    I don(t understand,my JBuilder use the libraries from Oracle 9.01
    and when I make a connection,
    with this code:
    DatabaseMetaData meta = conn.getMetaData();
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
    It send me back thin driver 8.17
    how is it possible?

  • JDBC thin driver for oracle 7.1.3

    Hi,
    we r using Oracle 7.1.3. i would like to know where i can get the
    thin driver for java compatible with the oracle version 7.1.3 so
    that i need not install an oracle client in the clients pc.
    thanks
    veera
    null

    Jay (guest) wrote:
    : BUBBA (guest) wrote:
    : : Veera Nagendran (guest) wrote:
    : : : Hi,
    : : : we r using Oracle 7.1.3. i would like to know where i can
    : get
    : : the
    : : : thin driver for java compatible with the oracle version
    : 7.1.3
    : : so
    : : : that i need not install an oracle client in the clients pc.
    : : : thanks
    : : : veera
    : : Thedatabase you're using went out of support over 2 years
    ago.
    : : oracle doesn't provide jdbc drivers for anything less than
    : : supported version 7.3.4.
    : So why does Oracle make this claim
    : "The Thin driver does not require Oracle software on the client
    : side. It connects to any Oracle database of version 7.2.x and
    : higher. The driver requires a TCP/IP listener on the server
    : side. " ???
    : Jay
    re-read my earlier reply -- the comment was :
    Thedatabase you're using went out of support over 2 years
    ago. oracle doesn't provide jdbc drivers for anything less
    than the minimum supported version ---> 7.3.4.At no time did i refer to the client s/w being required !!
    also it was not tested against unsupported version of the
    rdbms ...
    also rdbms 7.1.3 isn't y2k compliant.
    use it at your own risk..
    what "claim" are you saying oracle made ??
    null

Maybe you are looking for

  • What happens to the music files when I delete iTunes?

    OK, I have iTunes and over the years I have moved files about and tried to organize and back up stuff! And now it seems like I have three of each track showing in iTunes. Some of these, when you click on you get an exclamation mark and a file can't b

  • Type conflict when calling a FORM

    Hi, when we have callled function module "PYXX_READ_PAYROLL_RESULT" in out HR-ABAP program then shows the short dump as: procedure "PYXX_READ_PAYROLL_RESULT" "(FUNCTION)", nor was it propagated by RAISING clause. Since the caller of the procedure cou

  • How to create lineNum for group?

    There is a customer which uses BP catalog №. I have created Delivery.  This delivery contains some items with different values in ItemDecription field and with the same values in the BPCatalogNo field. I want to create a Print Template. In this templ

  • SolMan alert prioritizing

    Hi All, We have implemented Technical monitoring in our Solution Manager(7.1 SP8) system. We are reciving the mails for the yellow and red alerts. Is there any way to differentiate the red and yellow alerts for mail alerts(like sending alerts with "h

  • Odd error message when attempting to start up iTunes

    Whenever I attempt to start up iTunes it tells me "The file "iTunes Library" cannot be read because it was created by a newer version of iTunes." It was working fine 30 minutes ago and I have the latest version installed. Can someone help me?