Obtaining an oracle.sql.STRUCT through a pooled JDBC connection

Hello,
I am using WebLogic Server 10 and and Oracle 10 and I am trying to obtain a vendor-specific oracle.sql.STRUCT from a ResultSet using a pooled connection defined in Weblogic. I need the vendor-specific object, rather than simply the java.sql.Struct implementation, because a third party library requires it.
What gets returned in the ResultSet is a non-exposed WebLogic wrapper object which implements java.sql.Struct, but which cannot be cast to an oracle.sql.STRUCT. I can use reflection on this object to find and call the getVendorObj() method to obtain the oracle.sql.STRUCT, but this solution is not acceptable because this is not a published API and is not guaranteed not to change in future versions.
How can I reliably obtain a vendor-specific implementation of java.sql.Struct through a WebLogic connection pool in WebLogic Server 10?
Thanks for any advice,
-Dan Schwemlein

dan schwemlein wrote:
Joe,
Thanks again. With your guidance, I have arrived at the following approach, which I'll post for the benefit of others, and which I'd be thankful if you would validate:
1) Import the jar com.bea.core.datasource-1.0.0.0.jar from %BEA_HOME%\modules, which is the only location of the class WLConnection, which is the only class with the getVendorConnection() method you refer to.
2) Get the logical connection from the pooled data source, cast it to a WLConnection, call getVendorConnection() to obtain an OracleConnection (from the ojdbc jar), and use this connection to obtain the required oracle.sql.STRUCT from an OracleResultSet.
3) Be aware of the limitations and follow the guidelines in the document http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html#1043646 regarding security, error handling, releasing resources (close only the logical connection), etc.
Does this sound like the approach you had in mind?
Thanks again,
-Danyes.
Joe
>
Re: Obtaining an oracle.sql.STRUCT through a pooled JDBC connection
Posted: Jul 16, 2007 3:21 PM
dan schwemlein wrote:
Thanks for the quick response!I was working today...
Thank you for the information about the connection being closed.
I will look into using this configuration setting.
You say that you can describe a way to get a handle on an unwrapped
pool object using some documented WLS-specific code. Are you referring
here to the getVendorConnection() method?yes.
This method does not help me
get the oracle.sql.STRUCT object, because even the connection returned
by getVendorConnection() returns a wrapped WL java.sql.Struct object
from a call to getObject().I don't believe it. If you are running in WLS, with a local pool,
the getVendorConnection() will give you the Oracle connection,
which will give you an Oracle statement, etc, down to an oracle
STRUCT object. Once you have a direct reference to the oracle connection,
we're not in the picture when it returns something to you.
It would be great if getVendorObj() were
documented and could be counted on in future versions. To use this
method, one would still have to access it via Java reflection, because
the wrapper class and its getVendorObj() method would be exposed in an
API, correct? Could this method be exposed in the API, so that reflection
doesn't need to be used, or it is exposed somewhere that isn't documented?getVendorObj() is not yet exposed or therefore supported for the general
wrapped object, so you would have to start from the connection and
derive all subobjects from it.
Thanks again,
-Dan Schwemlein
Hello,
I am using WebLogic Server 10 and and Oracle 10 and I am trying to obtain a
vendor-specific oracle.sql.STRUCT from a ResultSet using a pooled connection
defined in Weblogic. I need the vendor-specific object, rather than simply
the java.sql.Struct implementation, because a third party library requires it.
What gets returned in the ResultSet is a non-exposed WebLogic wrapper object
which implements java.sql.Struct, but which cannot be cast to an oracle.sql.STRUCT.
I can use reflection on this object to find and call the getVendorObj() method to
obtain the oracle.sql.STRUCT, but this solution is not acceptable because this is
not a published API and is not guaranteed not to change in future versions.Understood. We all benefit from sticking to the J2EE standards,
but we could also wish Oracle had done so with it's driver objects.
I will assume your code is running in the WebLogic server, because
an external JVM can never access the real driver object, which will
always really be in the WLS JVM. No active JDBC object is serializable.
How can I reliably obtain a vendor-specific implementation of java.sql.Struct
through a WebLogic connection pool in WebLogic Server 10?There is no way to get a handle on an unwrapped pool object without using some
WLS-specific code, though I can describe a way with documented methods,
and/or I can get our documentation altered to say we'll support the
getVendorObj() method. We introspect every vendor object, and for those
implementations that have done the wise thing, projecting any non-standard
methods as an Interface, we are able to also project that Interface so
the vndor example code should work. However, in some poorly-done
cases, such as for some Oracle stuff, there is either no Interface,
or the Oracle code has extensions that take java.sql objects as input,
(at least that's the signature of the method) but two lines into the
method, the Oracle code assumes and casts the java.sql object to a concrete
Oracle object. In these use cases you need the direct unwrapped object.
We provide and document Connection.getVendorConnection(), and intend
getVendorObj() to serve the same for subobjects, but note the dangers
and responsibilities: We rely on our wrappers to implement the security
and thread-safety of our pooling system. Because user code can get
unrestricted access to the actual connection from most JDBC objects,
we can never trust that we have complete control once a vendor object
is exposed. Therefore, by default we will close and replace every JDBC
connection so exposed, as soon as the current thread is finished with
the pool connection. This hurts performance. We also document a pool
config setting that will tell us that you take responsibility for any such
problems, and not to close connections just because they've been exposed.
HTH,
Joe
Thanks for any advice,
-Dan Schwemlein

Similar Messages

  • Using oracle.sql.STRUCT to pass in a COMPLEX OBJECT

    I need to pass in a complex object (object with nested array of objects) into a oracle stored procedure.
    We are using JDBC 9.2.0.1 drivers...
    Note i am able to retrieve a complex object successfully using an oracle struct however i am not able to pass in the struct.
    I do not want to use JPublisher as we are not using SQLJ.
    I have looked through the documentation on using default structs and am getting an error when i try and create the struct...
    I have created an array of objects with a sub array
    and i create a struct descriptor however when i create the actual oracle struct
    like
    oracle.sql.Struct = new oracle.sql.Struct( structDesc,conn,complexobject)
    I get a "java.sql.SQLException: Internal Error: Unable to resolve name"
    Do i have to create STRUCTS for the nested object first ?
    And then nest that STRUCT within the PARENT STRUCT to pass in complex objects ???
    Any help would be much appreciated...
    Gurinder
    email [email protected]

    Thanks Konstantin Goryachev!
    I'm using Oracle JDBC 9.2.0.3 drivers using a SQLData implementation.
    Unfortunately i have something very similar to your code and i still get the following error
    EXC: testPolicyRate(): java.sql.SQLException: Internal Error: Inconsistent catalog view
    java.sql.SQLException: Internal Error: Inconsistent catalog view
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
              DBError.java:187
         void oracle.jdbc.dbaccess.DBError.throwSqlException(int, java.lang.Object)
              DBError.java:229
         void oracle.sql.StructDescriptor.initMetaData1_9_0()
              StructDescriptor.java:897
         void oracle.sql.StructDescriptor.initMetaData1()
              StructDescriptor.java:864
         boolean oracle.sql.StructDescriptor.isInstantiable()
              StructDescriptor.java:508
         void oracle.sql.STRUCT.<init>(oracle.sql.StructDescriptor, java.sql.Connection, java.lang.Object[])
              STRUCT.java:107
         oracle.sql.STRUCT oracle.sql.OracleSQLOutput.getSTRUCT()
              OracleSQLOutput.java:96
         oracle.sql.STRUCT oracle.sql.STRUCT.toSTRUCT(java.lang.Object, oracle.jdbc.OracleConnection)
              STRUCT.java:408
         oracle.sql.Datum oracle.jdbc.oracore.OracleTypeADT.toDatum(java.lang.Object, oracle.jdbc.driver.OracleConnection)
              OracleTypeADT.java:284
         oracle.sql.Datum[] oracle.jdbc.oracore.OracleTypeADT.toDatumArray(java.lang.Object, oracle.jdbc.driver.OracleConnection, long, int)
              OracleTypeADT.java:327
         oracle.sql.Datum[] oracle.jdbc.oracore.OracleTypeUPT.toDatumArray(java.lang.Object, oracle.jdbc.driver.OracleConnection, long, int)
              OracleTypeUPT.java:143
         oracle.sql.Datum[] oracle.sql.ArrayDescriptor.toOracleArray(java.lang.Object, long, int)
              ArrayDescriptor.java:771
         void oracle.sql.ARRAY.<init>(oracle.sql.ArrayDescriptor, java.sql.Connection, java.lang.Object)
              ARRAY.java:118
         void com.tu.lib.busobject.PolicyRate.main(java.lang.String[])
              PolicyRate.java:198
    Process exited with exit code 0.
    Here's my code
    * Main Method
    public static void main(String[] args)
    throws SQLException, IOException
    Connection conn = null;
    OracleCallableStatement cstmt = null;
    try {
    /* Setup connection */
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@neptune:1521:tu_test", "OPS$WWW", "welcome1");
    conn.setAutoCommit(false);
    System.out.println("conn is open = " + !conn.isClosed());
    /* Setup map */
    System.out.println("Creating type maps...");
    java.util.Map typeMap = conn.getTypeMap();
    typeMap.put(_SQL_NAME,PolicyRate.class);
    typeMap.put(CoverageRate._SQL_NAME, CoverageRate.class);
    typeMap.put(CoverageRate._SQL_ARRAY_NAME,CoverageRate[].class);
    conn.setTypeMap(typeMap);
    /* Create a coverage rate object to be inserted into array of policy rate object */
    CoverageRate covrObj = new CoverageRate(1,
    "HMS",
    30,
    5,
    new BigDecimal(0),
    null,
    null,
    new BigDecimal(0),
    new BigDecimal(0),
    0,
    0);
    /* Create an array */
    System.out.println("Creating descriptor...");
    ArrayDescriptor adesc = new ArrayDescriptor(CoverageRate._SQL_ARRAY_NAME,conn);
    System.out.println("Created descriptor!");
    Object [] covrArray = new Object[1];
    covrArray[0] = covrObj;
    System.out.println("Creating oracle array..");
    ARRAY arr = new ARRAY(adesc,conn,covrArray);
    System.out.println("Created array!!");
    /* Create policy rate object */
    PolicyRate prate = new PolicyRate ("TESTTRA",
    "TRS",
    TUDate.convertToSql("2003","08","27"),
    TUDate.convertToSql("2004","06","25"),
    TUDate.convertToSql("2004","06","29"),
    "NEW",
    1,
    new BigDecimal(0),
    new BigDecimal(0),
    null);
    /* Add coverage rate object to array -- assume array only has one element for timebeing */
    System.out.println("Setting arr in policyrate...");
    prate.setRates(arr);
    System.out.println("Creating array.sql.ARRAY for covrObj..");
    prate.setRates(new oracle.sql.ARRAY(adesc,conn,covrObj));
    System.out.println("Created array.sql.ARRAY for covrObj..");
    /* Setup statemenet object */
    cstmt = (OracleCallableStatement) conn.prepareCall("{call dbpckg_rate_obj.p_rate_obj_calc_rate(?)}");
    /* Bind variables to statement */
    System.out.println("Setting policyrate object...");
    cstmt.setObject(1,prate,OracleTypes.STRUCT);
    System.out.println("Registering out object...");
    cstmt.registerOutParameter(1,oracle.jdbc.OracleTypes.STRUCT,PolicyRate._SQL_NAME);
    cstmt.execute();
    /* Retrieve the object back */
    System.out.println("Getting policy rate object back...");
    prate = (PolicyRate) cstmt.getObject(1);
    System.out.println("Object Retrieved " + prate.getProductcode() + " " + prate.getAgentcode());
    /* Close database connection */
    conn.close();
    catch (Exception exc) {
    System.out.println("EXC: testPolicyRate(): " + exc);
    exc.printStackTrace();
    if (conn != null)
    conn.close();
    finally {     
    if (conn != null)
    conn.close();
    I've opened up a tar through metalink hopefully they can help get past this error...:)
    Gurinder

  • Oracle.sql.BLOB and oracle.sql.STRUCT

    I'm development a application in Java with oracle, to manage media files. When I try to insert into oracle , I have this problem "oracle.sql.BLOB cannot be cast to oracle.sql.STRUCT" , and I don't know what that can be ..
    This is my code , please help with that.. If you have a smaple code of java and oracle to insert media , that will be a great help ..
    public void loadDataFromStream(OracleConnection con)
    try {
    Statement s = con.createStatement();
    OracleResultSet rs = (OracleResultSet)
    s.executeQuery("select * from blobs where id='video2.avi' for update ");
    String index = "";
    while(rs.next())
    index = rs.getString(1);
    index+="1";
    System.out.println("llego hasta aki");
    // el error esta en esta linea de abajo ...
    OrdVideo vidObj = (OrdVideo) rs.getCustomDatum(2, OrdVideo.getFactory());
    //rs.getBfile(3);///
    FileInputStream fStream = new FileInputStream("/home/jova/movie.avi");
    vidObj.loadDataFromInputStream(fStream);
    vidObj.getDataInFile("/home/jova/movie.avi");
    fStream.close();
    System.out.println(" getContentLength output : " +
    vidObj.getContentLength());
    OraclePreparedStatement stmt1 =
    (OraclePreparedStatement) con.prepareCall("update blob_col set image = ? where id = " + index);
    stmt1.setCustomDatum(1,vidObj);
    stmt1.execute();
    stmt1.close() ;
    index+="1";
    System.out.println("OK");
    catch(Exception e) {
    System.out.println("exception raised " + e);
    System.out.println("load data from stream unsuccessful");
    }

    I'm development a application in Java with oracle, to manage media files. When I try to insert into oracle , I have this problem "oracle.sql.BLOB cannot be cast to oracle.sql.STRUCT" , and I don't know what that can be ..
    This is my code , please help with that.. If you have a smaple code of java and oracle to insert media , that will be a great help ..
    public void loadDataFromStream(OracleConnection con)
    try {
    Statement s = con.createStatement();
    OracleResultSet rs = (OracleResultSet)
    s.executeQuery("select * from blobs where id='video2.avi' for update ");
    String index = "";
    while(rs.next())
    index = rs.getString(1);
    index+="1";
    System.out.println("llego hasta aki");
    // el error esta en esta linea de abajo ...
    OrdVideo vidObj = (OrdVideo) rs.getCustomDatum(2, OrdVideo.getFactory());
    //rs.getBfile(3);///
    FileInputStream fStream = new FileInputStream("/home/jova/movie.avi");
    vidObj.loadDataFromInputStream(fStream);
    vidObj.getDataInFile("/home/jova/movie.avi");
    fStream.close();
    System.out.println(" getContentLength output : " +
    vidObj.getContentLength());
    OraclePreparedStatement stmt1 =
    (OraclePreparedStatement) con.prepareCall("update blob_col set image = ? where id = " + index);
    stmt1.setCustomDatum(1,vidObj);
    stmt1.execute();
    stmt1.close() ;
    index+="1";
    System.out.println("OK");
    catch(Exception e) {
    System.out.println("exception raised " + e);
    System.out.println("load data from stream unsuccessful");
    }

  • Oracle sql STRUCT query

    Hi all. I have a simple program running in JDeveloper using JDBC for retrieving SDO_Geometry values from various spatial tables. The program works fine but when I run the following SQL statement to retrieve the geometry column from a table states it is returning the sdo_geometry values in the following format:
    spatialQuery = "select a.geom from states a";oracle.sql.STRUCT@e2dae9,     
    oracle.sql.STRUCT@19209ea,     
    oracle.sql.STRUCT@c8f6f8,     
    oracle.sql.STRUCT@1ce2dd4,     
    oracle.sql.STRUCT@122cdb6,     
    I know the program works but can anyone tell me how to interpret these results or even how to translate them into a more useful format. Cheers Joe

    I assume you are getting back a List (Vector) with the Struct inside it. Try ((List)query.getSingleResult()).get(0).
    In JPA you should get the Struct back directly if the result size was 1, otherwise an Object[], this was a bug in EclipseLink 1.0 that was fixed in EclipseLink 1.1.
    You should probably upgrade to EclipseLink 1.1.
    James : http://www.eclipselink.org

  • Oracle.sql.STRUCT

    Hi,
    when I use functions that returns a geometry (for example SDO_GOEM.SDO_BUFFER, SDO_GEOM.SDO_DIFFERENCE) I have in return oracle.sql.STRUCT@6c08b2..
    What can I do!?
    thanks

    as far as I know, the STRUCT is the returned geometry. so you can declare a SDO_GEOMETRY variable and assing the STRUCT directly to this variable.
    For example you have a variable 'geo_variable' and assign it the result of a function like this:
    geo_variable := SDO_GEOM.SDO_DIFFERENCE(geom1, geom2, tol );
    what you see written like this "oracle.sql.STRUCT@6c08b2.." I believe is the stuct @ the memory address 6c08b2..

  • Oracle.sql.STRUCT cannot be cast to oracle.sql.STRUCT

    I met a problem,I use oracle spatial to store geometry,then get it like this:
    STRUCT dbObject = (oracle.sql.STRUCT)rs.getObject("shape");
    JGeometry geom = JGeometry.load(dbObject);
    tomcat 6 told me java.lang.ClassCastException: oracle.sql.STRUCT cannot be cast to oracle.sql.STRUCT
    does everyone knows this problem?thanks
    Edited by: 811014 on 2010-11-13 下午9:28
    Edited by: 811014 on 2010-11-13 下午9:28

    Hi, this is a known problem for most Spatial 10g Java APIs with WLS.
    WLS is only certified with 11g DB.
    Instead of using Weblogic JNDI Lookup for Datasource, try the following snippet to create your connection/datasource (with Oracle JDBC thin driver):
    String databaseUrl = jdbc:oracle:thin:@1.2.3.4:1521:yourdbname
    String databaseUser = dbusername
    String databasePassword = dbpassword
    DriverManager.registerDriver(new OracleDriver());
    Connection aConnection = DriverManager.getConnection(databaseUrl, databaseUser, databasePassword);
    For more information, see the following:
    Classcast Exception while using Oracle ARRAYs
    regards,
    jack

  • Oracle.sql.STRUCT and returns from procedures

    I need to know how to retrieve information out of a stored procedure. I have a stored procedure that has a IN/OUT parameter that is used to return an array of an oracle TYPE that is set up in the database (it consists of two numbers and a varchar2. So I am returning an array of these types). I need to call this stored procedure from JDBC and retrieve the data out of it. I can setup the outParameter of the statement and also get the Object out of the statement once the procedure is called. But what is returned to me? An array of oracle.sql.STRUCT objects? A single oracle.sql.STRUCT object? A multi-dimensional array of java objects? Or something else?
    Thanks
    null

    as far as I know, the STRUCT is the returned geometry. so you can declare a SDO_GEOMETRY variable and assing the STRUCT directly to this variable.
    For example you have a variable 'geo_variable' and assign it the result of a function like this:
    geo_variable := SDO_GEOM.SDO_DIFFERENCE(geom1, geom2, tol );
    what you see written like this "oracle.sql.STRUCT@6c08b2.." I believe is the stuct @ the memory address 6c08b2..

  • Java.lang.NoClassDefFoundError: oracle/sql/STRUCT after 11g/GF3.1.2 upgrade

    We have recently upgraded all of our servers from:
    Java 1.6.31 to 1.6.32
    and
    Glassfish 3.1.1 to 3.1.2
    We upgraded our development server from Oracle 10g to 11g.
    Our live servers are working fine. Our development server now is spewing out a java.lang.NoClassDefFoundError: oracle/sql/STRUCT error whenever it encounters a servlet or page which uses this class.
    ojdbc14.jar and sdopai.jar were included within the WAR file, and I have tried with them excluded from the WAR file to no avail. We have tried reverting the version of ojdbc.jar on the server to the earlier version, this has made no different.
    Any ideas? The full stack trace is below:
    [#|2012-05-28T16:15:34.950+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=80;_ThreadName=Thread-2;|StandardWrapperValve[EnterDataSS]: PWC1406: Servlet.service() for servlet EnterDataSS threw exception
    java.lang.NoClassDefFoundError: oracle/sql/STRUCT
    at oracle.spatial.geometry.JGeometry.load(JGeometry.java:3097)
    at Bto.Location.LocatorUtils.JavaScriptifySDO(LocatorUtils.java:97)
    at Bto.Chats.Controllers.EnterDataModuleMain.<init>(EnterDataModuleMain.java:136)
    at Bto.Chats.SessionBean.initialiseEdm2(SessionBean.java:348)
    at Bto.Chats.Servlets.Enter.EnterDataSS.processRequest(EnterDataSS.java:36)
    at Bto.Chats.Servlets.ChatsServlet.doGet(ChatsServlet.java:90)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ajp.AjpProcessorTask.invokeAdapter(AjpProcessorTask.java:135)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.ClassNotFoundException: oracle.sql.STRUCT
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 33 more
    |#]

    >
    Our live servers are working fine. Our development server now is spewing out a java.lang.NoClassDefFoundError: oracle/sql/STRUCT error whenever it encounters a servlet or page which uses this class.
    ojdbc14.jar and sdopai.jar were included within the WAR file, and I have tried with them excluded from the WAR file to no avail. We have tried reverting the version of ojdbc.jar on the server to the earlier version, this has made no different.
    >
    If your code can't find the class then you have the classic NoClassDefFoundError problem you get when any other referenced class can't be located.
    The oracle/sql/STRUCT class is in the ojdbc14.jar, ojdbc5.jar and ojdbc6.jar so if it can't be found then that class is missing from the jar you are using (which you can tell by examining the jar contents) or the jar is missing from the classpath being used.
    As already mentioned you need the Oracle 11 JDBC files to support Java 1.6
    Here is the official Oracle JDBC page that shows the Oracle DB versions supported for each of the JDBC drivers available and also describes the JDBC jars and what JDK versions they support.
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#02_01
    >
    Which JDBC drivers support which versions of Javasoft's JDK?
    pre-8i OCI and THIN Drivers - JDK 1.0.x and JDK 1.1.x
    8.1.5 OCI and THIN Drivers - JDK 1.0.x and JDK 1.1.x
    8.1.6SDK THIN Driver - JDK 1.1.x and JDK 1.2.x (aka Java2)
    8.1.6SDK OCI Driver - Only JDK 1.1.x
    8.1.6 OCI and THIN Driver - JDK 1.1.x and JDK 1.2.x
    8.1.7 OCI and THIN Driver - JDK 1.1.x and JDK 1.2.x
    9.0.1 OCI and THIN Driver - JDK 1.1.x, JDK 1.2.x and JDK 1.3.x
    9.2.0 OCI and THIN Driver - JDK 1.1.x, JDK 1.2.x, JDK 1.3.x, and JDK 1.4.x
    10.1.0 OCI and THIN Driver - JDK 1.2.x, JDK 1.3.x, and JDK 1.4.x
    10.2.0 OCI and THIN Driver - JDK 1.2.x, JDK 1.3.x, JDK 1.4.x, and JDK 5.0.x
    11.1.0 OCI and THIN Driver - JDK 1.5.x and JDK 1.6.x
    11.2.0 OCI and THIN Driver - JDK 1.5.x and JDK 1.6.x
    Please note that JDK 1.4 is not supported by the 11 drivers.

  • Oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray

    Hi,
    I am facing following issue in my one environment. but in other environment same class path is working fine. I have compared all jar and classpath for both weblogic server.
    I am using weblogic 11g.
    27 Mar 2013 15:21:09,507 ERROR XXXServlet:293 - oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    java.lang.ClassCastException: oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    at com.emc.nems.wsd.ui.beans.reports.mpapi.FacilityBeanType.nullSafeGet(FacilityBeanType.java:126)
    at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
    at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
    at org.hibernate.loader.Loader.getRow(Loader.java:1230)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
    at org.hibernate.loader.Loader.doQuery(Loader.java:724)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    at org.hibernate.loader.Loader.doList(Loader.java:2232)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
    at org.hibernate.loader.Loader.list(Loader.java:2124)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
    at com.emc.nems.oms.dao.hibernate.util.OMSHibBaseDAO.executeNamedQueryWithoutTransaction(Unknown Source)
    at com.emc.nems.wsd.dao.hibernate.reports.mpapi.MpapiReportHibDAO.findMCR020(Unknown Source)
    at com.emc.nems.wsd.ui.handler.reports.ReportsHandler.getMPAPIData(Unknown Source)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.executeReport(XXXServlet.java:1009)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.generateAuditFile(XXXServlet.java:318)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.execute(XXXServlet.java:273)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.doGet(XXXServlet.java:207)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3731)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3695)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2285)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2184)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1459)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Regards,
    Abhishek

    Creating my Oracle connection works fine ... code as follows:
    <i>Context ctxt = getInitialContext();
    DataSource dataSource = (DataSource) ctxt.lookup(poolName);
    Connection conn = dataSource.getConnection();
    OracleConnection oracleConn = (OracleConnection)((WLConnection)conn).getVendorConnection();</i>
    I also have reviewed documentation:
    http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html. In section 'Using OracleStruct Extension Methods' it highlights that
    <i>java.sql.Struct struct =(weblogic.jdbc.vendor.oracle.OracleStruct)(rs.getObject(2));</i>
    None of the documentation actually mentions <b>oracle.sql.STRUCT</b>. For Weblogic to truely provide support for Oracle it needs an easy way of converting to this data type. At present I cannot interact with Oracle APIs until I can create an oracle.sql.STRUCT.

  • Auto-Commit and Pooled JDBC Connections

    Forum Members,
    If I am using Oracle Pooled JDBC Connections in the OC4J container is auto-commit set to "true" by default?
    If I set auto-commit to "false" and then close the logical connection, when that connection is handed out again on a later call to getConnection(), is auto-commit automatically set back to "true"?
    Thanks,
    Richard

    Richard,
    Pardon me if I am stating the obvious, but you could test that in your code by invoking the getAutoCommit() method in interface java.sql.Connection.
    My experience (with OC4J stand-alone versions up to -- and including -- 10.1.2) is that the behaviour depends on which data source you have configured. For example, if you have defined an "ejb-location" attribute in your "data-sources.xml" file, and you use that as your JNDI lookup for your data source, then OC4J handles transactions and you shouldn't deal with "auto-commit" at all. See the following post for more details:
    Re: OC4J 10.1.3 Preview 4 - Global transaction active
    But if you have defined a "location" attribute and use that, then you do need to handle transactions explicitly.
    Hope this helps.
    Good Luck,
    Avi.

  • Importing oracle.sql.BLOB through SQL Loader

    Hello,
    Currently the system we have creates .sql files and executes them. This takes a long time, so we're attempting to change to using SQL Loader. The one problem I'm having that I can't seem to fix is finding out how to imitate the behavior of this SQL statement through SQL Loader:
    INSERT INTO KRSB_QRTZ_BLOB_TRIGGERS (BLOB_DATA,TRIGGER_GROUP,TRIGGER_NAME)
    VALUES (oracle.sql.BLOB@515263,'KCB-Delivery','PeriodicMessageProcessingTrigger')
    I tried creating a lobfile and placing the text oracle.sql.BLOB@515263 within it this way
    INTO TABLE KRSB_QRTZ_BLOB_TRIGGERS
    WHEN tablename = 'KRSB_QRTZ_BLOB_TRIGGERS'
    FIELDS TERMINATED BY ',' ENCLOSED BY '##'
    TRAILING NULLCOLS
    tablename FILLER POSITION(1),
    TRIGGER_NAME CHAR(80),
    TRIGGER_GROUP CHAR(80),
    ext_fname FILLER,
    BLOB_DATA LOBFILE(ext_fname) TERMINATED BY EOF
    However, as expected, it merely loaded the text "oracle.sql.BLOB@515263" into the database. So does anyone have any ideas of how to imitate that insert statement through SQL Loader? The only information I have available is the string "oracle.sql.BLOB@515263", no other files or anything to aid with actually getting the binary data.
    When the .sql file is run with that insert statement in it, a 1.2kb BLOB is inserted into the database versus a 22 byte BLOB that contains nothing useful when done through SQL Loader.
    Alex

    My preference is DBMS_LOB.LOADFROMFILE
    http://www.morganslibrary.org/reference/dbms_lob.html
    did you try it?

  • Oracle SQL developer 3.2.20.09 connection problem

    hello everyone. I just installed oracle SQL developer on mavericks. active JDK is 1.6.0_65. host name : som3a... now the problem is , whenever i try to make a new connection using the previous info and specifiying the default port 1433 i always get the following error
    Status : Failure -Test failed: Cannot connect to Microsoft SQL Server on som3a
    - can these fields ( connection name , username ,password ) take any values or do they need to be something special like ? i mean the host name must be som3a right so do the same constraint apply on these fields ?
    -i tried telnet som3a 1433 , it gets stuck at "trying..."

    I think you have the wrong forum, as this forum is dedicated to the Oracle Database Cloud Service.
    - Rick Greenwald

  • Pooled jdbc connection(s), and server resources

    Hello All,
    I am curious about the difference between jdbc connections in a connections pool, and 'stand alone' connection. I have Oracle 9.2
    To describe...
    In my application server (WebLogic) I have a connection pool, with 10 connections. Does this take less server resources than 10 separate connections? I notice that there are still 10 server processes appearing.
    thanks!
    JM
    the jdbc Programmer's Guide and Reference says...
    (( start quote ))
    A pooled connection instance encapsulates a physical connection to a database. This
    database would be the one specified in the connection properties of the connection
    pool data source instance used to produce the pooled connection instance.
    A pooled connection instance is an instance of a class that implements the standard
    javax.sql.PooledConnection interface. The getConnection() method
    specified by this interface returns a logical connection instance that acts as a
    temporary handle to the physical connection, as opposed to encapsulating the
    physical connection, as does a non-pooling connection instance:
    (( end quote ))
    ...I had the impression that a connection pool of 10, results in one 'physical' connection. But it appears not!

    No, and yes...
    A pool of 10 connections creates 10 physical database connections, which require exactly the same resources as 10 connections from a standalone Java app or 10 connections from SQL*Plus.
    The connection pool, however, allows those 10 physical connections to server one the order of 100 logical connections (in an average OLTP application). If you have a JSP page that opens a connection, runs a couple of DML statements, and closes the connection, having a connection pool greatly reduces the load on the database because it does not have to create a new physical connection for every JSP page-- the JSP page gets a connection from the pool, uses it for a bit, and returns it to the pool where it can be assigned to another JSP page. Because each user only needs the connection a small percentage of the time, you can server many physical users with only 1 physical database connection.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Problems retreiving varchar attributs from oracle.sql.STRUCT

    Hi,
    I have downloaded the Java + Oracle Object Types examples from the oracle homepage, but instead of the varchar values from a STRUCT the Java-application just displays "???". Numbers and dates are displayed correct.
    Im running JDK1.4 on Windows and Oracle 9.2.0.8 on Unix with corresponding JDBC driver
    Any idea?
    Thanx in advance,
    Jo

    Jo,
    I'm guessing it has something to do with your NLS / I18N settings.
    Do you know what they are?
    Usually, both JDK and Oracle assume an American environment.
    In other words, American English, etc.
    Is your environment different to this?
    Good Luck,
    Avi.

  • Oracle.sql.* with JDBC drivers 8.0.5

    the oracle.sql package is not included in my JDBC driver file classes111.zip given for oracle data server version 8.0.5.
    I would like to use the oracle STRUCT and ARRAY type for calling PL/SQL stored procedures taking STRUCT objects in arguments.
    Are the JDBC drivers 8.1.* compatible with the oracle data server 8.0.5 (if I only use the STRUCT or ARRAY types)? Is it a way for passing ARRAY of VARCHAR2 values to PL/SQL stored procedure with the oracle 8.0.5 JDBC driver?
    thanks

    Unfortunately, these classes (oracle.sql.STRUCT and oracle.sql.ARRAY) are not compatible to 8.0 database. There is server format changes between 8.1 and 8.0, and JDBC driver only supports the 8.1 format.
    Please upgrade your database to 8i.

Maybe you are looking for

  • Web Variables are being displayed and they shouldn't be

    Hi, Our web template is configured to not present the variable screen when the variables are populated. For some reason after I added the dynamic tab functionality using the SAP_BW_URL command our variables screens are appearing after selecting a tab

  • ITunes purchased movies do not run on macbook pro retina display - Error message: HDCP not supported.

    Hello community, If i try to play a iTunes purchased movie on may Macbook Pro 15 Retina, a Error message comes up "HDCP not supported". I try to run it on the notebook screen, I have not plugged in any external device (monitor, beamer..). Full Error

  • What happened to the 17" Macbook Pro?

    I have been using the 17" Macbook Pro since they were created and they have suddenly dissapeared, do they still exist?

  • Disk encryption question

    I encrypted my boot disk when I installed Mountain Lion, however, when the machine boots up, it prompts for three options: the option to enter the disk password, the option for my general user account to login, and the option for a guest account to l

  • Digital Editions could not connect to the activation server.

    I am unable to download books from my local library using Adobe Digital Editions. My library told me to unauthorize which was also supported by the on-line help discussions on the Adobe website. I did that and now when trying to re-authorize continue