Classes12.jar or ojdbc14.jar?

Which oracle driver do I need? I am trying to connect to DB from my java program and I get "ClassNotFoundException: oracle.jdbc.driver.OracleDriver". I am able to ping/connect/execute sql from eclipse but when I run my java program, I get this exception. I have added ojdbc14.jar file to my classpath and from command prompt If I run "Java oracle.jdbc.driver.OracleDriver", I got the following:
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/driver/Or
acleDriver
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: oracle.jdbc.driver.OracleDriver. Program will ex
it.
My java version is "java version 1.6.0_14". Should I download classes12.jar and replace the ojdbc14.jar in classpath? Any suggestions?

right click ur project and select properties. In Java Build Path add the ojdbc14.jar in the librariies tab.
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html
Edited by: user7361177 on Aug 1, 2009 10:19 PM

Similar Messages

  • Pointing portal server from classes12.jar to ojdbc14.jar JDBC driver

    Hi,
         Some time ago we upgraded our portal landscape from Oracle 9.2.0.7 to Oracle 10.2.0.2. Using OSS Notes 867176 and 915079, we pointed our portal servers to use the newer and recommended ojdbc14.jar driver. This included using Config manager to  change the rdbms.driverLocation parameter to point to the new driver.
         A few months later (last week), thinking that we had our bases covered, we removed the old ORACLE_HOME, /oracle/<SID>/920_32. Upon restarting the portal we got quite a shock- it would NOT come up! The first problem was the bootstrap.properties in the /usr/sap/<SID>/JC00/j2ee/cluster/bootstrap directory which had the same dbms.driverLocation parameter pointed to the old driver in the old ORACLE_HOME. After correcting this, we ran into further problems with neither the dispatcher or the servers (2 per system) coming up. Find this curious, we ran the following unix  commands and identified more *.properties files with the same rdbms.driverLocation parameter-
    cd /usr/sap/<SID>/JC00/j2ee
    find . -name '*.properties' -exec grep -H 920_32 {} \;
    ./deploying/rdb.properties -
                rdbms.driverLocation=/usr/sap/EPP/JC00/j2ee/classes12.jar
    ./cluster/server0/cfg/kernel/ConfigurationManager.properties -
                rdbms.driverLocation=/usr/sap/EPP/JC00/j2ee/classes12.jar
    ./cluster/server0/cfg/kernel/ConfigurationManager.properties -
                rdbms.driverLocation=/usr/sap/EPP/JC00/j2ee/classes12.jar
    ./cluster/dispatcher/cfg/kernel/ConfigurationManager.properties -
                rdbms.driverLocation=/usr/sap/EPP/JC00/j2ee/classes12.jar
    ./templateconfigurator.properties -
               $=/usr/sap/EPP/JC00/j2ee/classes12.jar
    We then proceeded to manually edit each of the files to use the newer ojdbc14.jar driver. Surprisingly, it turns out that editing the ConfigurationManager properties files for the 2 servers and the dispatcher had no effect- upon recycling the portal the entire cfg/kernel directory gets wiped out and replaced.
    So what's the problem here? I don't have an issue with directories being recreated- but why is the ojdbc14.jar driver setting not being picked up from the change made for each server and dispatcher in the Configuration Manager?   I have examined all the services listed in the Configuration Manager and the Visual Administrator and can find no more references to the old ORACLE_HOME.
    Oh, incidently, curiously enough, for single portal systems, the JDBC driver is obtained from the /oracle/<SID>/102_64/jdbc/lib directory and not from the /usr/sap/<SID>/JC00/j2ee directory which is the case for portal servers involving more than 1 server.
    Hoping for help here ...
    Sincerely,
    Steven McElwee, Duke University

    right click ur project and select properties. In Java Build Path add the ojdbc14.jar in the librariies tab.
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html
    Edited by: user7361177 on Aug 1, 2009 10:19 PM

  • Usage of java.sql.Timestamp with classes12.zip and ojdbc14.jar  ?

    Hi all,
    If i'm using java.sql.Timestamp with classes12 it is functioning perfectly,
    if i'm using ojdbc14 and java.sql.Timestamp it is functioning in different way and failing to do the action..
    Example : update set xxx=yy where time = my Timestamp object set in Prepared statement
    Hope to see the answer

    http://forum.java.sun.com/thread.jspa?threadID=460615&messageID=2116517
    Timestamp insert problem
    Using the "classes12.zip" file that comes with the distribution for Oracle versions 8.1.6.x and 8.1.7.x, Oracle's DATE datatype is mapped to the "java.sql.Timestamp" class. However, the "ojdbc14.jar" driver maps DATE to "java.sql.Date", and "java.sql.Date" only holds a date (without a time), whereas "java.sql.Timestamp" holds both a date and a time.

  • Xdb.jar and ojdbc14.jar incompatibility ( XMLType.createXML() ) ??

    I am using the latest xdb.jar (from xdk_java_9_2_0_5_0.zip) and ojdbc14.jar
    and it appears that xdb.jar calls a method that does not exist in ojdbc14.jar.
    It happens when executing
    OPAQUE opaque = rset.getOPAQUE("value");
    XMLType xt = XMLType.createXML(opaque); // <-- here
    The exact error message is:
    java.lang.NoSuchMethodError: oracle.jdbc.internal.OracleConnection.getProtocolType()Ljava/lang/String;
         at oracle.xdb.XMLType.initConn(XMLType.java:2072)
         at oracle.xdb.XMLType.<init>(XMLType.java:903)
         at oracle.xdb.XMLType.createXML(XMLType.java:493)

    Hi,
    There are known problems with xdb.jat that is bundled with XDK 9205.
    As a workaround, you need to use an older version of xdb.jar from either XDK-9.2.0.3 or XDK-9.2.0.4 since the mentioned exception is generally thrown due to problems in xdb.jar that comes with XDK-9205.
    If you do not have any of these versions of XDK, you could use the xdb.jar that comes with the database 9.2.0.3. The xdb.jar is present in <oracle_home>/rdbms/jlib folder.
    Hope that helps.
    Shefali

  • Ojdbc14.jar not integrated in JDev 9.0.5.x?

    Hi,
    the documentation of Oracle 9i DB says, there is a new archiv for the jdbc driver: ojdbc14.jar. Until now we used classes12.zip (or classes12.jar).
    But why is the new driver lib missing in JDev 9.0.5.x?
    Best regards,
    Torsten.

    Can you please recommend some way to use ojdbc14.jar with JDeveloper 9.0.5.2? Ommitting Oracle JDBC from the project libraries and including a new library for ojdbc14.jar does not work for all classpath issues, such as for data source definitions in the data-sources.xml file. What does seem to work is replacing jdbc/lib/classes12dms.jar with ojdbc14.jar but I'm not sure if this will cause strange side effects. Is there any cleaner way of using ojdbc14.jar?
    Thanks,
    Jeff

  • Ojdbc14.jar and nls_charset

    I use nls_charset12.jar and classes12.jar with JDK 1.3 and JDK1.2
    When we use JDK14: ojdbc14.jar.
    Nls_charset include in ojdbc14.jar?

    I believe that you should use nls_charset12.jar with ojdbc14.jar for 9.2.0.3 .
    This is from the JDBC FAQ - http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#02_03
    nls_charset11.jar
    Contains the classes to support all Oracle character sets in Advanced Data Types (objects) when using a Java 1.1 VM. If the database character set is one other than US7ASCII, W8DEC, or ShiftJIS, and the application uses ADTs, then you must include this class in your classpath. Or you can unzip this file and add the appropriate file to your classpath. The files are named with the Oracle character set number.
    nls_charset12.jar
    Same as nls_charset11.jar except for use with Java 1.2, 1.3, and 1.4 VMs. Not used with Oracle 10.1.0 and later. Use orai18n.jar instead.
    Nat

  • Nls_charset include in ojdbc14.jar?

    I use nls_charset12.jar and classes12.jar with JDK 1.3 and JDK1.2
    When we use JDK14: ojdbc14.jar.
    Nls_charset include in ojdbc14.jar?

    I believe that you should use nls_charset12.jar with ojdbc14.jar for 9.2.0.3 .
    This is from the JDBC FAQ - http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#02_03
    nls_charset11.jar
    Contains the classes to support all Oracle character sets in Advanced Data Types (objects) when using a Java 1.1 VM. If the database character set is one other than US7ASCII, W8DEC, or ShiftJIS, and the application uses ADTs, then you must include this class in your classpath. Or you can unzip this file and add the appropriate file to your classpath. The files are named with the Oracle character set number.
    nls_charset12.jar
    Same as nls_charset11.jar except for use with Java 1.2, 1.3, and 1.4 VMs. Not used with Oracle 10.1.0 and later. Use orai18n.jar instead.
    Nat

  • Corrupted ojdbc14.jar file

    I have twice attempted to download the latest version of the Oracle JDBC drivers. Both times, the files seem to be corrupt.
    Attempting to examine the ojdbc14.jar file contents with the following command:
    jar tvf ojdbc14.jar
    leads to the following error message:
    java.util.zip.ZipException: incomplete literal/length tree
    Attempting to examine the ojdbc14_g.jar file contents with the following command:
    jar tvf ojdbc14_g.jar
    leads to the following error message:
    java.util.zip.ZipException: invalid stored block lengths
    Attempting to read either file with EnZip utility program gives the following errors:
    Warning - Error in Zip structure
    A central header signature is wrong
    Can anyone tell me how to get around these errors?
    Dave Eland
    [email protected]

    Well. On the third try, it worked OK. The first two times, I was using Netscape to access the web site, and the third time I had switched to Internet Explorer.
    This is the first time I have seen this phenomena. Whatever was causing the file corruption seems to have been resolved.

  • Performance problem with ojdbc14.jar

    Hi,
    We are having performance problem with ojdbc14.jar in selecting and updating (batch updates) entries in a table. The queries are taking minutes to execute. The same java code works fine with classes12.zip ans queries taking sub seconds to execute.
    We have Oracle 9.2.0.5 Database Server and I have downloaded the ojdbc14.jar from Oracle site for the same. Tried executing the java code from windows 2000, Sun Solaris and Opteron machines and having the same problem.
    Does any one know a solution to this problem? I also tried ojdbc14.jar meant for Oracle 10g, that did not help.
    Please help.
    Thanks
    Yuva

    My code is doing some thing which might be working well with classes12.zip and which does not work well with ojdbc14.jar? Any general suggestions to make the code better, especially for batch updates.
    But for selecting a row from the table, I am using index columns in the where cluase. In the code using PreparedStatement, setting all the reuired fields. Here is the code. We have a huge index with 14 fields!!. All the parameters are for where clause.
    if(longCallPStmt == null) {
    longCallPStmt = conn.prepareStatement(longCallQuery);
    log(Level.FINE, "CdrAggLoader: Loading tcdragg entry for "
    +GeneralUtility.formatDate(cdrAgg.time_hour, "MM/dd/yy HH"));
    longCallPStmt.clearParameters();
    longCallPStmt.setInt(1, cdrAgg.iintrunkgroupid);
    longCallPStmt.setInt(2, cdrAgg.iouttrunkgroupid);
    longCallPStmt.setInt(3, cdrAgg.iintrunkgroupnumber);
    longCallPStmt.setInt(4, cdrAgg.iouttrunkgroupnumber);
    longCallPStmt.setInt(5, cdrAgg.istateregionid);
    longCallPStmt.setTimestamp(6, cdrAgg.time_hour);
    longCallPStmt.setInt(7, cdrAgg.icalltreatmentcode);
    longCallPStmt.setInt(8, cdrAgg.icompletioncode);
    longCallPStmt.setInt(9, cdrAgg.bcallcompleted);
    longCallPStmt.setInt(10, cdrAgg.itodid);
    longCallPStmt.setInt(11, cdrAgg.iasktodid);
    longCallPStmt.setInt(12, cdrAgg.ibidtodid);
    longCallPStmt.setInt(13, cdrAgg.iaskzoneid);
    longCallPStmt.setInt(14, cdrAgg.ibidzoneid);
    rs = longCallPStmt.executeQuery();
    if(rs.next()) {
    cdr_agg = new CdrAgg(
    rs.getInt(1),
    rs.getInt(2),
    rs.getInt(3),
    rs.getInt(4),
    rs.getInt(5),
    rs.getTimestamp(6),
    rs.getInt(7),
    rs.getInt(8),
    rs.getInt(9),
    rs.getInt(10),
    rs.getInt(11),
    rs.getInt(12),
    rs.getInt(13),
    rs.getInt(14),
    rs.getInt(15),
    rs.getInt(16)
    }//if
    end_time = System.currentTimeMillis();
    log(Level.INFO, "CdrAggLoader: Loaded "+((cdr_agg==null)?0:1) + " "
    + GeneralUtility.formatDate(cdrAgg.time_hour, "MM/dd/yy HH")
    +" tcdragg entry in "+(end_time - start_time)+" msecs");
    } finally {
    GeneralUtility.closeResultSet(rs);
    GeneralUtility.closeStatement(pstmt);
    Why that code works well for classes12.zip (comes back in around 10 msec) and not for ojdbc14.jar (comes back in 6-7 minutes)?
    Please advise.

  • Which ojdbc14.jar JDBC driver to use for Oracle 10g database

    When ODI is installed there seems to be an Oralce JDBC driver in place in the drivers folder (ojdbc14.jar).
    When we connect to an Oracle datastore and point to a table and use the 'reverse' function to populate the columns - it sort of works OK but does not bring back the datatypes properly. This is found to be when the Oracle table has UNICODE character datatypes NCHAR and NVARCHAR. If a table has CHAR and VARCHAR it is all OK but any table that has UNICODE datatyoe has a problem.
    Is this likely to be the JDBC driver ?
    We have tried replacing this ojdbc14.jar with the older classes12 and this, as expected, did not resolve the issue.
    We then tried replacing it with the latest 10.2.0.4 ojdbc14.jar but again no difference.
    Does anyone have any experience with Oracle JDBC drivers and what release level to use - and using against UNICODE datatypes in tables ?
    Regards

    Our problem is that when we use 'reverse' to populate the columns from a physicla table in an Oracle database - ODI is obviously 'seeing' the ORacle table and is correctly understanding the columns in the table and defining them in it's model - but wherever there is a column with a datatype in the ORacle database of NCHAR or NVARCHAR it fails to populate the datatype or the 'length' of these columns. If I manually try to specify the datatype these 2 unicode data types do NOT exist in the pull down list of datatypes.
    I see what you are asking - if these datatypes are actually defined as datatypes within the actual technology - I cant access my lab right now but will check as soon as I can. Thanks for the suggestion.

  • Non supported character set with ojdbc14.jar

    Hi.
    I have an application that uses JMS/AQ and works great under JDK1.4 and with libraries:
    -classes12.jar
    -nls_charset12.jar
    I looked at the oracle web site that says you should use the new JDBC drivers(ojdbc14.jar) but I fail to get it working. I keep getting;
    oracle.jms.AQjmsException: Non supported character set: oracle-character-set-178
    at oracle.jms.AQjmsSession.addDurableSubscriber(AQjmsSession.java:2616)
    at oracle.jms.AQjmsSession.createDurableSubscriber(AQjmsSession.java:2124)
    at oracle.jms.AQjmsSession.createDurableSubscriber(AQjmsSession.java:1872)
    at prevision.socketserver.JMSThread.checkForNewAlarms(JMSThread.java:84)
    Any help would be greatly appreciated!
    Best regards,
    Christer Nordvik

    hi Christer,
    I have looked at the drivers download page at:http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html and there isn't any nls_charset12.jar for JDK1.4. I've tried using the one with JDK1.3
    There isn't any nls_charset12.jar for 1.4, its the one that comes with 1.3, just wanted to check it you are using the latest version of nls_charset12.jar
    BTW are you running this program from command-line or app server ? Incase of app server the latest jar's must be replaced in oc4j_home/jdbc/lib dir.
    Elango.

  • JDBC 4.0 and ojdbc14.jar

    Hello everyone
    i need to know abt jdbc-4.0 api tutorial and abt ojdbc14.jar tutorial which one is better ojdbc or classes12
    Thanks

    ojdbc14.jar is for JDK 1.4 or higher. classes12.zip
    is for JDK 1.2 and 1.3.
    http://www.oracle.com/technology/software/tech/java/sq
    lj_jdbc/htdocs/jdbc9201.htmlYes, although only the latest version of ojdbc14.jar (10gR2, or 10.2.0.1.0) is Oracle-approved-and-supported for Java 1.5. That doesn't mean older versions don't work with newer Java, they do, at least mostly, but Oracle does not certify-and-support them. In fact, I know that the last 8.1.7 version of classes12 works very well with Java 1.4 and an 8.1.7 DB (at lease for the driver functions my company happens to use, we're pretty "plain vanilla" on that project).
    For new code, you should probably be using the latest ojdbc14.jar, unless you're using an antique version of Java.

  • How to use two different ojdbc14.jar for two web application.

    Hi,
    I have two web application running in same tomcat, I need to use the two different ojdbc14.jar for two application, now both are taking the jars from tomcat common/lib directory, I tried copying the new ojdbc14.jar in web-inf/lib folder of one application, but it is not working.
    Could you please let me know whether this will take the jar from tomcat by befault or from web-inf, and a solution how to proceed with this.
    Thanks in advance.

    Yes, I tried removing the jars from common/lib, but as the connection string is mentioned inside the server.xml it is showing db connection error while trying to connect to the database

  • Problem with ojdbc14.jar (oracle10g Rel. 2 driver) in updating a BLOB field

    Hello All,
    Our web application uses oracle10g Release 2 jdbc driver with websphere 5.1.1.4 and oracle 9i. When it tries to update a BLOB field in the database updation is successful but it is updating that field with a null value. So rest of our application fails as this value is becoming null. We use an entity bean to update this table and websphere uses a prepared statement to update this table. Just before setting this BLOB field using setBinaryStream() on prepared statement I am printing to see whether it is null or not as shown in the code snippet below. And it is printing it correctly as non null. But after execution of the prepared statement some how the value stored in database is null.
    Is this a known issue with this driver? Does any one know work around or a solution to this? We have 3 BLOB fields in that table. Is that a problem? If we separate these BLOB fields into separate tables will the problem be solved? Any input on this is very much appreciated.
    // For column ORIGINAL_CONTENT
    byte[] tempbyteArray;
    tempbyteArray=(byte[])inputRecord.get(25);
    if (tempbyteArray == null) {
    System.out.println("DqPageBeanFunctionSet_f9c724af: tempbyteArray NULLLLLLL");
    } else {
    System.out.println("DqPageBeanFunctionSet_f9c724af: orig tempbyteArray length: " + tempbyteArray.length);
    if(tempbyteArray != null) {
    pstmt.setBinaryStream(25,new java.io.ByteArrayInputStream(tempbyteArray),tempbyteArray.length);
    else pstmt.setNull(25,java.sql.Types.BLOB);
    Thanks & Regards,
    -Sunitha

    I have similar problem and I solved it using ojdbc14.jar oracle9i version.
    try...

  • Oracle Type4 driver (ojdbc14.jar) connection proble

    Hi,
    I'm trying to connect to my oracle 8i installed in my local machine through type4 driver.
    I've downloaded ojdbc14.jar and included its path to classpath
    The following lines are included in my code
    Class.forName("oracle.jdbc.OracleDriver");
    cn = DriverManager.getConnection("jdbc:oracle:thin:scott/tiger@localhost:1521:dbmsConnect ")
    I've created the DSN as follows (in Windows XP)
    Control Panel - Administrative Tools - Data Sources - Add - Took Oracle ODBC Driver - entered DSN name as dbmsConnect -added user id as scott
    When I ran the code, Igot following exception
    Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(ERR=12505)
    (ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    Could anyone help me please

    You may need a later version of the driver:
    http://www.dbforums.com/showthread.php?t=971271
    Pl. also see:
    http://forum.java.sun.com/thread.jspa?threadID=563288&messageID=2773243
    http://forum.java.sun.com/thread.jspa?threadID=300137&messageID=1189780

Maybe you are looking for

  • Search for text and font

    I have an 800 page pdf document to index and so far I have a script that will search for a list of keywords. But the text has large sections of code in a different font, and I think we would like to generate an index of just code examples. Is there a

  • Repetición notas

    Estimados. Me ocurre que las notas que escribo en mi iPhone o iPad se ven varias veces repetidas cuando se sincronizan por iCloud en la aplicación notas de mi Mac. Al parecer a medida que se escribe la nota, el historial o versiones va quedando en el

  • How do I print General Ledger Balances for a particular day

    HI Sap Gurus, I want to print general ledger balances as of a particular day/date.  I did use FBL3n, but it gives me with line items, I want just the totals.  Do you know of any other report I can use. Would really appreciate the help Thanks so much

  • 1.6 language change(s) (or (unnecessary) bug fix?)

    Hi Is this rather "Programming" or "JDK"? Something changed for 1.6? That this compiles without problem on 1.5 public class Test {     private abstract interface X {         static abstract class Y {             private abstract class Z {}     privat

  • High Contrast Controls?

    In 'settings' what does changing 'High Contrast Controls' do?