JGeometry / oracle.jdbc.OracleDriver ClassCastException

Hi-
I can't seem to store my JGeometry (from the SDO API) back to the database. The code that causes the problem is this:
===== Sample Code ========
import oracle.jdbc.OracleConnection;
OracleConnection oc = (OracleConnection) st.getConnection();
STRUCT struct = JGeometry.store((JGeometry)value,oc);
==========================
That last line of code throws this error:
===== Exception ============
05/01/04 16:50:26 [ERROR] ResultForm - Could not save the ResultBean <java.lang.ClassCastException>java.lang.ClassCastException
     at oracle.jdbc.driver.OracleConnection.unwrapCompletely(OracleConnection.java:5075)
     at oracle.jdbc.driver.OracleConnection.physicalConnectionWithin(OracleConnection.java:5126)
     at oracle.sql.TypeDescriptor.setPhysicalConnectionOf(TypeDescriptor.java:494)
     at oracle.sql.TypeDescriptor.<init>(TypeDescriptor.java:147)
     at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:186)
     at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:118)
     at oracle.spatial.geometry.JGeometry.createDBDescriptors(JGeometry.java:1323)
     at oracle.spatial.geometry.JGeometry.store(JGeometry.java:1257)
     at gov.usgswim.wdnr.fishform.GeometryType.nullSafeSet(GeometryType.java:54)
=========================
It looks like the oracle.jdbc.driver.OracleConnection.unwrapCompletely method is assuming the connection to be something that it is not - but I'm stumped without the source code.
I've seen someone speculate that this is a classloader issue, but I'd have no idea how to resolve that within OC4J.
Here is my setup:
Running from JDev 9.0.5.2 using OC4J 9.0.5.
JDBC connections are provided via JNDI by specifying the datasource thru JDev. I've tried replacing the JDBC drivers that come with OC4J with the newer versions (that is, classes12.jar --> classes14.jar)
Database version is 10.1.0.3.0
I'm pretty much stuck until I can work this out, so any help would be appreciated.
Thanks in advance,
Eric Everman

Hi LJ - Thanks for the reply.
I'm leaving out detail about the framework I'm working within. For instance, the full method that saves the JGeometry back to the db is part of a Hibernate UserType for which I can't change the method signiture - thus the PreparedStatement.getConnection(). The full method looks like this:
=========== Java Method =================
public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
STRUCT struct = null;
if (value != null) {
if (value instanceof JGeometry) {
JGeometry jg = (JGeometry)value;
System.out.println("Storing a Geom object to the db. Info:");
System.out.println(" Type: " + jg.getType());
System.out.println(" # of points: " + jg.getNumPoints());
System.out.println(" isPoint: " + jg.isPoint());
System.out.println(" X, Y: " + jg.getFirstPoint()[0] + ", " + jg.getFirstPoint()[1]);
//System.out.println(" elemInfo length: " + jg.getElemInfo().length); (throws error)
OracleConnection oc = (OracleConnection) st.getConnection();
struct = JGeometry.store(jg,oc);
} else {
throw new HibernateException("Cannot set GeometryType value to " + value.getClass().getName());
} //keep null value
st.setObject(index, struct);
==================================
==== Typical Output ==============
05/01/04 20:53:08 Storing a Geom object to the db. Info:
05/01/04 20:53:08 Type: 1
05/01/04 20:53:08 # of points: 1
05/01/04 20:53:08 isPoint: true
05/01/04 20:53:08 X, Y: 385343.3057, 562597.748
==================================
I've no reason to think that the connection I'd get from the prepared statement would be anything other then the connection returned from JNDI, but I'll try a simplified test to make sure.
My Geom is point data - would I expect JGeometry.getElemInfo() to return null in that case? Currently it does return null immediately after I load the JGeom from the database.

Similar Messages

  • A sign Applet unable to load "oracle.jdbc.OracleDriver" class

    hi,
    i am chiranjit , i am now working in a web based ERP. where i am using a signed applet which unable to load "oracle.jdbc.OracleDriver" class but it easily loading "sun.jdbc.odbc.JdbcOdbcDriver", i am also giving my code:
    import java.sql.*;
    import java.math.*;
    import java.io.*;
    import java.awt.*;
    class JdbcTest extends Applet{
    public static void main (String args[]) throws SQLException {
    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    // Connect to the local database
    Connection conn =
    DriverManager.getConnection
    ("jdbc:oracle:thin:@192.168.16.7:1521:kris",
    "plsql", "oracle");
    // Query the employee names
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("SELECT FIRST_NAME FROM
    AUTHORS");
    // Print the name out
    while (rset.next ())
    System.out.println (rset.getString (1));
    // Close the result set, statement, and the connection
    rset.close();
    stmt.close();
    conn.close();
    }

    Hint: The sun.jdbc.odbc.JdbcOdbcDriver is available in any JRE distribution. The Oracle driver is not.

  • Java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

    Hi everyone,
    Can any one plz help me with this problem in connection with the database...im unable to connect from the servlet where my jdbc connectivity code is written when i compile it gives me this error:
    Ljava.lang.String;@e53220java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at shoppingcart.shoppingcartservlet.doit(shoppingcartservlet.java:83)
         at shoppingcart.shoppingcartservlet.doPost(shoppingcartservlet.java:30)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)

    Hi
    The server is not able to load the jdbc driver path. Place your driver in server classpath
    Venkat

  • Connect to an Oracle database by using oracle.jdbc.OracleDriver: error

    Hi,
    I'm trying to connect to an Oracle database so we can retrieve notes of tables, views and packages.
    By using the API of Data Modeler (transformation script) we want to add these notes to corresponding objects in Data Modeler.
    I'm starting with this:
    importPackage(java.lang);
    importPackage(java.awt);
    importPackage(java.sql); 
    java.lang.Class.forName("oracle.jdbc.OracleDriver");
    An error occurs when I run this code:
    It has to be a Java thing...
    Anyone a suggestion?

    Problem solved! One of my colleagues referred to this post: Import user defined properties from Oracle Designer
    More in detail: it's about this couple of lines:
    // Copy the ojdbc6.jar file to ..\datamodeler-home\jlib directory 
    // Add this line to datamodeler.conf 
    //      AddJavaLibFile  ../../jlib/ojdbc6.jar 
    I changed my datamodeler.conf file, restarted DM and now there's no longer an error when I am trying to use the Oracle JDBC drive.

  • NoClassDefFoundError: oracle/jdbc/OracleDriver

    I have a servlet that is supposed to connect to an oracle database select from a table and then return the results. This works in JDeveloper but when I try to deploy it to tomcat I get an error saying the following.
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
         at LoginServlet.doPost(LoginServlet.java:44)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    How can I resolve this problem ?

    I have the same problem.
    I wrote a simple program as follows.
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.sql.*;
    public class OracleConnect
    public static void main (String args []) throws SQLException
              DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
         Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@10.0.0.8:1521:ORCL","scott","tiger");
         Statement stmt = conn.createStatement ();
              ResultSet rset = stmt.executeQuery ("SELECT ename FROM emp");
              while (rset.next ())
         System.out.println (rset.getString (1));
    rset.close();
    stmt.close();
    conn.close();
    I am compiling like this.
    C;>javac -classpath c:\oracle\ora92\jdbc\lib\classes12.jar;c:\oracle\ora92\jdbc\lib\nls_charset12.jar;. OracleConnect.java
    Everything is fine upto now.
    But at the time of execution
    C:\>java OracleConnect
    Java is crying like this.
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/OracleDri
    ver at OracleConnect.main(OracleConnect.java:11)
    Can any one help me to resolve this issue please? By the way, I did not install Jdeveloper. I am using command prompt to do the stuff.
    Thanks,

  • Java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver

    I am trying to connect from a servlet running in Tomcat on my desktop to an instance of Personal Oracle9i running on my desktop. I am gettiung NoClassDefFoundError. The code compiles.
    I know it is a path issue but I am at a loss to figure out where. Tomcat does not find the driver however it is in my machines path.
    Running following:
    j2sdk1.4.1_02
    Personal Oracle 9.2
    Tomcat 4.1.29
    Windows XP
    I have added the location of Classes12.zip to the class path: .;c:\Sun\AppServer\lib\j2ee.jar;c:\Sun\AppServer\lib\j2ee-svc.jar;d:\oracle\ora92\jdbc\lib\classes12.zip;
    The "root cause" of error is:
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
         at OOP.OracleConnectionDemo.doPost(OracleConnectionDemo.java:34)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    The code is as follows:
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jdbc.OracleDriver;
    //import oracle.jdbc.driver.*; //did not work either
    public class OracleConnectionDemo extends HttpServlet {
         public void doPost(HttpServletRequest req, HttpServletResponse resp)
              throws ServletException, IOException{
              Connection con = null;
              // Load the Oracle JDBC driver
              try{
                   //two versions did not work
                   //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver);
              DriverManager.registerDriver(new OracleDriver());
         con = DriverManager.getConnection
                   ("jdbc:oracle:thin:@micron.1521:MCAP","scott","scott");     
              catch (SQLException e){
              catch (Exception e){
              finally{
                   try{
                        if (con != null)
                   con.close();
              catch(SQLException ignored){
              }//finally
    }

    What you should be realizing is that Tomcat doesn't give a hoot about your system CLASSPATH. It totally ignores it. You really shouldn't even have one, because IDEs and app servers don't even take it into account. Get rid of it.
    You're making lots of mistakes here:
    (1) The Tomcat docs explicitly state that it won't look inside ZIP files. Change it to a JAR file.
    (2) You're using JDK 1.4.1 and classes12.zip? You realize, of course, that there's an ojdbc14.jar available for download from Oracle. Go get it.
    (3) Put the JDBC JAR in the WEB-INF/lib directory of your Web app. If you don't have one, you're not deploying your Web app properly.
    (4) You've got Java code with empty catch blocks? That's one of the most foolish things a person can do. If an exception's thrown you'll never know it. For goodness sake, at least print the stack trace.
    (5) Why do you have those Oracle imports? That ties your code to Oracle. The design of the java.sql package lets you use interfaces. Why don't you write JDBC the way it was meant to be written?
    (6) Why aren't you setting up a JNDI data source?
    %

  • Location of 'oracle.jdbc.OracleDriver'

    Hi everyone,
    I am starting out learning JDBC and am trying to compile and run this sample Java program:
    package project1;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import oracle.jdbc.OracleDriver;
    public class jdbc_test1 {
    * @param args
    * @throws SQLException
    public static void main (String[] args) throws SQLException {
    try {
    DriverManager.registerDriver(new OracleDriver());
    catch (SQLException e) {
    e.printStackTrace();
    Runtime.getRuntime().exit(1);
    When I 'make' the project, I get the error 'OracleDriver not found' on the 'import' line.
    My environment:
    Windows Vista
    Oracle 10.2.0.3.0
    JDeveloper 10.1.3.3 and 11.1.1
    CLASSPATH: .;d:\App\Oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;d:\App\Oracle\product\10.2.0\db_1\jlib\orai
    18n.jar
    I searched both jar files looking for OracelDriver, but found nothing. What am I missing?
    Thanks.
    rr

    I get the error 'OracleDriver not found' Note that this kind of driver to be imported is depreciated.....
    http://forums.oracle.com/forums/ann.jspa?annID=201
    As a substitution for this use....the following packages....
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.OracleDataSource;
    and make then the appropriate changes in your main() method... such as:
    public static void main(String args[]) throws Exception
       Connection con =null;
       try
         OracleDataSource ods = new OracleDataSource();    
         ods.setURL("jdbc:oracle:thin:scott/tiger@//<host_name>:<listener_port>/<your_tns>");
         con = ods.getConnection();
       catch (Exception ex)
         //System.out.println("Unable to connect..."+ex.printStackTrace());
         System.out.println("Unable to connect..."+ex);
         System.exit(-1);
       }Greetings...
    Sim

  • Oracle.jdbc.oracledriver not found

    Hi,
    i have this code .. given below. I installed the oracle client version 8. but everytime i run this code i get the oracledriver not found message. I put the oracle jdbc drivers in the class path. but the code just refuses to compile.
    Can anyone tell me what is wrong here. i have a funny feeling that the classpath is not set properly. let me know whats wrong here.
    ps: i havent set the system DSN - coz i am getting stuck at the drivers itself.
    It says the following .
    AccessDB.java:26: Class oracle.jdbc.driver.OracleDriver not found.
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    i have the CLASSPATH=D:\oracle\ora81\jdbc\lib\classes111.zip;D:\oracle\ora81\jdbc\lib;D:\oracle\ora81\jdbc\lib\classes12.zip;D:\oracle\ora81\jdbc\lib\nls_charset11.zip
    the code is as follows
    //: AccessDB.java
    import java.sql.*;
    * Access the Database through JDBC
    public class AccessDB {
    private Connection con = null;
    private Statement stmt = null;
    private DatabaseMetaData meta = null;
    private String dbURL;
    private String dbUser;
    private String dbPassword;
    * Connects to JDBC driver
    public void connect(String dbURL, String dbUser, String dbPassword){
    try {
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(dbURL,dbUser,dbPassword);
    stmt = con.createStatement();
    meta = con.getMetaData();
    catch(Exception e){
    System.out.println("connect: " + e);
    System.exit(0);
    * Disconnects from JDBC driver
    public void disconnect(){
    try {
    if (stmt != null) stmt.close();
    if (con != null) con.close();
    catch(Exception e){
    System.out.println("disconnect: " + e);
    System.exit(0);
    * Retrieves a Statement object
    public Statement getStatement(){
    return stmt;

    hi,
    i have some problem in JSP oracle connectivity,
    I'm running JRUN, PWS under WIN98.
    the following is the code for Oracle connection from JSP
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD>
         <title>Example JSP</title>
    </HEAD>
    <BODY>
    <table width="50%" border=1>
         <th>Table Name</th>
         <th>Table Type</th>
    <%
    java.sql.Connection con;
    java.sql.ResultSet rs;
    java.sql.Statement sta;
              Class.forName("oracle.jdbc.driver.OracleDriver");
              con=java.sql.DriverManager.getConnection("jdbc:oracle:thin:@NTSERVER1:1521:orcl","DOHMS","TA");
              sta=con.createStatement();
              rs=sta.executeQuery("select * from USERS");
              while(rs.next()) {
                        out.println("<tr><td>"+rs.getString(1)+"</td><td>"+rs.getString(2)+"</td></tr>");
    %>
    </table>
    <BODY>
    the following is the error:
    Exception thrown on line '21' from page 'C:\\Program Files\\Allaire\\JRun\\servers\\default\\demo-app\\jsp\\dbtest.jsp'.
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver [oracle.jdbc.driver.OracleDriver]
         at allaire.jrun.servlet.JRunServletLoader.loadClass(../servlet/JRunServletLoader.java:430)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:265)
         at allaire.jrun.jsp.JSPClassLoader.loadClass(../jsp/JSPClassLoader.java:118)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:265)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:325)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:135)
         at jrun__jsp__dbtest2ejspf._jspService(jrun__jsp__dbtest2ejspf.java:49)
         at allaire.jrun.jsp.HttpJSPServlet.service(../jsp/HttpJSPServlet.java:39)
         at allaire.jrun.jsp.JSPServlet.service(../jsp/JSPServlet.java:228)
         at allaire.jrun.jsp.JSPServlet.service(../jsp/JSPServlet.java:196)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1416)
         at allaire.jrun.session.JRunSessionService.service(../session/JRunSessionService.java:1082)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1270)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:89)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1552)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1542)
         at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:364)
         at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:115)
         at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
         at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)
    ---------------

  • Needing help in oracle.jdbc.OracleDriver

    the problem is when i perform a select statement from a database link to another database in another machine the resultset returns empty, but when i am created the database in the same machine all goes fine.
    i dont no where is the problem??????
    is the problem in oracle or in oracle driver or i miss something else
    plz help me.

    i dont no where is the problem??????
    is the problem in oracle or in oracle driver or i miss
    something elseYeah, the problem must be in Oracle. It couldn't be you or your code. That's perfect, of course.
    Call Larry Ellison and demand that he fix that stinking pile of c-r-a-p code he's sold you.

  • Oracle.jdbc.driver.OracleDriver not found in Sun ONE Studio

    I get this message when I try to connect to the database while creating an EJB. I have tried adding the path to my CLASSPATH, and to adding it to the various CLASSPATHs within Sun ONE Studio. IDE_HOME is defined correctly but OracleDriver.class is still not found. Anyone know what my problem might be?
    Thanks,
    Michael A. Moran

    Hi Sujatha,
    Thanks for responding. My CLASSPATH is as follows:
    madonna% echo $CLASSPATH
    /export/oracle/jdbc/lib:/export/oracle/jlib:/export/oracle/jsp/lib:/export/oracle/sqlj/lib/runtime.zip:/export/oracle/oem_webstage:/export/oracle/lib/aurora_client.jar:/export/oracle/jdbc/lib/classes12.zip:/export/oracle/sqlj/lib/translator.zip:/export/oracle/sqlj/lib/runtime12.jar:/export/oracle/lib/vbjorb.jar:/export/oracle/lib/vbjapp.jar:/export/oracle/lib/mts.jar:/export/oracle/javavm/lib/aurora.zip:/export/oracle/javavm/utl/ejb/lib/vbj30ssl.jar:/export/oracle/jlib/javax-ssl-1_2.jar:/export/oracle/jlib/jssl-1_2.jar:/export/oracle/lib/servlet.jar:/export/oracle/lib/http_client.jar:/export/oracle/lib/http_server.jar:/export/oracle/oem_webstage/oracle/jdbc/OracleDriver.class:/export/oracle:/export/oracle/jdbc/lib/nls_charset12.jar
    Which as you can see includes classes12.zip and /export/oracle/oem_webstage/oracle/jdbc/OracleDriver.class
    I have also set all the IDE internal classpath variables to the same settings. It has no effect. I still get the same message.
    Michael

  • Web Server 6.1 and ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    I am trying to set up the Oracle jdbc on Sun ONE Web Server Enterprise Edition 6.1 but do not seem to be having any luck. It seems that OCI and thin fails.
    I have installed the Oracle client in the folder c:\oracle\ora92. I have selected the following items to install in the Oracle client: Oracle 9i Client 9.2.0.1.0, Common files, JDBC/OCI, JDBC/Thin, and Internet Directory Client. (I then downloaded ojdbc14.jar and placed it in jdbc\lib folder.)
    I am seeing the following error: ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    From the following web page:
    <code>
    <%@page language="java"
    import="java.sql.*,
    oracle.jdbc.driver.*,
    oracle.sql.*
    "%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>
    Hello World
    </title>
    </head>
    <body>
    <%
    //connections to ops2
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@wydot-ops2","username","password");
    Statement stmt = conn.createStatement();
    ResultSet rset = null;
    rset = stmt.executeQuery("SELECT AGENCY_NUMID,AGENCY_NAME FROM flightsch.state_agencies ORDER BY agency_name");
    while(rset.next())
    String ag_name = rset.getString("agency_name");
    %>
    <%= ag_name%>
    <%
    } //end of while loop
    rset.close();
    stmt.close();
    conn.close();
    %>
    </body>
    </html>
    </code>
    I have made the following entries into the Sun One Administration pages:
    Java Tab
    JVM path Settings
    Classpath suffix = c:\oracle\ora92\jdbc\lib
    Ignore Env Class Path = on
    Native Lib Path Prefix = c:\j2sdk1.4.2_02\lib
    Native Lib Path Suffix =
    JDBC Connection Pools
    Pool = jdbc-oracle-pool
    DataSource Classname = oracle.jdbc.pool.Oracle.DataSource
    URL = wydot-ops2
    User = username
    Password = password
    (Rest of items = defaults)

    oracle.jdbc.driver.OracleDriver is deprecated, you may be having an issue with that. Try oracle.jdbc.OracleDriver instead.
    Typically you don't need to registerDriver, just load the classes:
    Class.forName("oracle.jdbc.OracleDriver");
    WEB-INF/lib is the correct place to place application jar files, it is part of the automatic CLASSPATH for typical containers.

  • Oralce 10G2 JDBC Driver - Error Loading oracle.jdbc.driver.OracleDriver

    When attemping to use the 10G2 jdbc driver the following NoClassDefFoundError is encountered:
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: oracle.jdbc.driver.OracleDriver
    <<No stacktrace available>>
    Caused by: java.lang.ClassNotFoundException: oracle.security.pki.OracleWallet not found in [file:./, file:ojdbc1410g2.jar, file:/usr/share/java/libgcj-3.4.4.jar, file:./, core:/]
    <<No stacktrace available>>
    The error does not occur when reverting back to the 9 jdbc driver. Does anyone know what is causing this behavior?
    Regards,
    Paul

    Paul,
    Actually, class "oracle.jdbc.OracleDriver" extends class "oracle.jdbc.driver.OracleDriver".
    So check the JAR files in the list displayed by your error message and see if any of them contain the [missing] class, for example:
    jar tvf ojdbc1410g2.jar oracle/jdbc/driver/OracleDriver.classGood Luck,
    Avi.

  • Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.dr

    Hi
    I am trying to use type 4 driver to connect to my Oracle 9i Rel2 database. I downloaded the odbc14.jar from oracle and added in the C:\Oracle9i\jdbc\lib path. As on the website, I setup my environment:
    Setting Up Your Environment
    On Win95/Win98/NT:
    - Add [ORACLE_HOME]\jdbc\lib\classes111.zip and
    [ORACLE_HOME]\jdbc\lib\nls_charset11.zip to your CLASSPATH.
    (Add classes12.zip and nls_charset12.zip if JDK 1.2.x or 1.3 is
    used. Add ojdbc14.jar and nls_charset12.zip if JDK 1.4 is used.)
    - Make sure [ORACLE_HOME]\bin is in your PATH.
    Still I am getting the following error during runtime:
    Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at jdbc.InsertQueryEx.main(InsertQueryEx.java:11)
    Below is the source code:
    import java.sql.*;
    import java.io.*;
    public class InsertQueryEx {
    public static void main(String[] args)throws Exception{
    Class.forName("oracle.jdbc.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@Prashy:1521:orcl", "scott", "tiger");
    DataInputStream din = new DataInputStream(System.in);
    Statement stmt = con.createStatement();
    while(true){
    try{
    System.out.println("enter emp name");
    String name = din.readLine();
    System.out.println("enter emp no");
    int no = Integer.parseInt(din.readLine());
    System.out.println("enter emp salary");
    float sal = Float.parseFloat(din.readLine());
    System.out.println("enter emp address");
    String addr = din.readLine();
    int count = stmt.executeUpdate("insert into myemp values("+no+",'"+name+"',"+sal+",'"+addr+"')");
    if(count>0)
    System.out.println("Record added");
    else
    System.out.println("Failed");
    catch (Exception e){
    System.err.println("Exception: "+e.getMessage());
    Any help is appreciated
    Thanks
    Prashant

    I am sorry but I did add those in the classpath but still getting this error:
    This is what I have for user variable in classpath:
    .;C:\Oracle9i\jdbc\lib\ojdbc14.jar;C:\Oracle9i\jdbc\lib\nls_charset12.jar
    error is:
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at jdbc.InsertQueryEx.main(InsertQueryEx.java:14)
    Thanks

  • Exception:org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection

    Hi All,
    i am using jdev version 11.1.1.5.0
    and deployed my Adf application on Apache Tomcat 6.0.
    in my use case i have created simple adf application using adf business component. create a vo based on eo and drag-drop on jspx page.
    i have created JNDI data source in Apache server using edit context.xml file and add following line-
    <Resource name="jdbc/TestDB" auth="Container"
                  type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
                  url="jdbc:oracle:thin:@localhost:1521:dst"
                  username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"
                  maxWait="-1"  accessToUnderlyingConnectionAllowed="true" />
    3.using same data source in my adf applicatioin as -
      right click on AM --> Configuration-->edit-->select connection type jdbc datasource  -->java:/comp/env/jdbc/TestDB  
    4. after that i have deployed my application on apace server but when i have running application i have got following error-
    org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
    i have goggling and find  following solution-
    oracle.jdbc.driver.OracleConnection delConn = (oracle.jdbc.driver.OracleConnection) ((org.apache.tomcat.dbcp.dbcp.DelegatingConnection)c_stmt.getConnection()).getDelegate();
    but my problem is that i'm using Adf Business Component so where i set following type casting.
    Is there any method on ADF BC which handle JNDI Data source setting or any other way to do this.
    thanks in Advance
    Manish

    Hi dvohra21,
    thanks for reply.
    i don't understand where i go to set accessToUnderlyingConnectionAllowed =true
    i have already set this property on context.xml file
    <Resource name="jdbc/TestDB" auth="Container"
                  type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
                  url="jdbc:oracle:thin:@localhost:1521:dst"
                  username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"
                  maxWait="-1"  accessToUnderlyingConnectionAllowed="true" />
    any other place where i set this propery
    please elaborate this steps how to Configuree DBCP

  • Package oracle.jdbc does not exist

    I am trying to connect oracle 8.1.7 from jdk1.4 using jdbc. but when i am trying to compile the java file an error with message"package oracle.jdbc does not exist" is experienced.
    error generation code:
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    please try to help.
    GOOD LUCK
    Mahmood

    Hi Mahmood,
    Oracle.jdbc package will be present in classes12.zip file in <oracle_home>/jdbc/lib directory where <oracle_home> is the directory where Oracle is installed. Place this zip file in classpath and check again.
    Regards,
    Anupama

Maybe you are looking for