Java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.lo

I am evaluating the sun RI of javax.sql package . I downloaded the jdbc_rowset_tiger-1_0_1-mrel-jwsdp.zip package and installed in my machine.
I tried the JdbcRowSet implmenation and it worked pretty smooth. I wanted to try the disconnected Rowset implementation. I tried CachedRowSet Implementation with thin driver. I get the following error message.
Exception in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.locatorsUpdateCopy()Z
at com.sun.rowset.CachedRowSetImpl.execute(Unknown Source)
at com.sun.rowset.CachedRowSetImpl.execute(Unknown Source)
at CachedRowSetSampl.main(CachedRowSetSampl.java:79)
I am using thin driver with Oracle8i db.
Appreciate any early responses

I had the same problem initially.
I fixed it by downloading an updated ojdbc14.jar (1).
It may be because I downloaded the ocrs12.jar from there a bit earlier and the versions of ojdbc14.jar and ocrs12.jar need to match (that is, come from the Oracle10g suite of jars).
Here is the class I used:
import java.sql.*;
import javax.sql.*;
import com.sun.rowset.WebRowSetImpl;
import com.sun.rowset.providers.RIXMLProvider;
public class test {
  public static void main(String[] args) {
    try {
      Class.forName("oracle.jdbc.driver.OracleDriver");
      WebRowSetImpl wrs = new WebRowSetImpl();
      wrs.setCommand("select table_name from user_tables");
      wrs.setUsername("scott");
      wrs.setPassword("tiger");
      wrs.setUrl("jdbc:oracle:thin:@paramount.com:1521:ORCL");
      wrs.execute();
      wrs.writeXml(System.out);
    } catch (Exception e) {
      System.out.println("Exception:"+e);
Dale(1) http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101020.html (Oracle Database 10g JDBC Drivers)

Similar Messages

  • Java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSet.isLast()Z

    Hello.
    I'm trying to detect if a row is the last one of a ResultSet (from a
    executeQuery):
    ResultSet results = sql.executeQuery();
    if (results.isLast())
         out.println("EMPTY");
    But I get this error message:
    Error 500
    Servlet internal error:
    java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSet.isLast()Z
         at estructura_10._jspService(mycode_10.java:93)
         at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
    What am I doing wrong?
    Thank you very much.

    What do you want to do with a RS instead at least 1 next() ?
    Only 1 next() - then you know, if it is empty.
    If it's not empty, I assume you will do any retrieval, so you will have needed at least this first next(), don't you?
    Even if you would like to skip the first row (though you have retrieved it), it would not be too much costs.
    If you don't want to retrieve but only count your rows, do a query "SELECT COUNT(*) FROM table WHERE <your condition ...>".
    However, to get the count you would have to do one - only one - next() call.

  • Exception Occur  "java.lang.AbstractMethodError: oracle.jdbc.driver....."

    I am using oracle 10.2.0.1.0. I can able to connect the database using sqlplus. I am executing some ant task. While running the ant script I am getting the following exception.
    [java] INFO: Locale id is:1
    [java] Oct 16, 2006 7:20:24 PM com.cramer.globalisation.resourcebundleloader.DataBaseMgr getLocaleI
    d
    [java] INFO: Using the default locale ID :1
    [java] Oct 16, 2006 7:20:24 PM com.cramer.globalisation.resourcebundleloader.ResourceBundleReader l
    oadPropertyFile
    [java] INFO: .\html\homepages\thersholdhomepage\config\bundle\thersholdhomepage.properties is Crame
    r resource bundle file
    [java] java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setSavepoint(Ljava/lang/Stri
    ng;)Ljava/sql/Savepoint;
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180)
    [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
    [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
    [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
    [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [java] at org.apache.tools.ant.Task.perform(Task.java:364)
    [java] at org.apache.tools.ant.Target.execute(Target.java:341)
    [java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    [java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.ja
    va:37)
    [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    [java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
    [java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
    [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [java] at org.apache.tools.ant.Task.perform(Task.java:364)
    [java] at org.apache.tools.ant.Target.execute(Target.java:341)
    [java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    [java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
    [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    [java] at org.apache.tools.ant.Main.runBuild(Main.java:668)
    [java] at org.apache.tools.ant.Main.startAnt(Main.java:187)
    [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
    [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
    [java] Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setSavepoint(Ljav
    a/lang/String;)Ljava/sql/Savepoint;
    [java] at com.cramer.globalisation.resourcebundleloader.DataBaseMgr.insertBundleRow(DataBaseMgr
    .java:118)
    [java] at com.cramer.globalisation.resourcebundleloader.ResourceBundleLoader.loadPropertyFiles(
    ResourceBundleLoader.java:77)
    [java] at com.cramer.globalisation.resourcebundleloader.ResourceBundleLoader.main(ResourceBundl
    eLoader.java:47)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:324)
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202)
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134)
    [java] ... 24 more
    [java] --- Nested Exception ---
    [java] java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setSavepoint(Ljava/lang/Stri
    ng;)Ljava/sql/Savepoint;
    [java] at com.cramer.globalisation.resourcebundleloader.DataBaseMgr.insertBundleRow(DataBaseMgr
    .java:118)
    Can anyone help me in this issue?.....

    few of my colligue are using the same database, and
    they are not getting these kind of error. Only my
    system and 2 more system is giving these problem.
    All of us are using the same version of oracle
    only.I said driver not database.
    >
    Only I am and 2 more friends are getting the "
    java.lang.AbstractMethodError:
    oracle.jdbc.driver.T4CConnection.setSavepoint(Ljava/la
    ng/String")
    "And are you running the same exact code as everyone else?
    Additionally you might want to check your class path to verify that only what is required is in that.
    You haven't put anything in the ext directory have you?

  • Java.lang.AbstractMethodError: oracle/jdbc/driver/OracleResultSet.getBlob

    Hi,
    I am using WSAD 4.0.3. While I am running application I am getting this error.
    [10/5/02 13:26:17:984 GMT+08:00] 7a483a9b ExceptionUtil X CNTR0020E: Non-application exception occurred while processing method lodge on bean BeanId(CePAC#CePACEJB.jar#CfsControllerBean, f0b300abe8): java.lang.AbstractMethodError: oracle/jdbc/driver/OracleResultSet.getBlob
    I have set the classpath i.e classes111.zip. This function is to insert record to a database having blob field.
    Waiting for a quick response.

    java.lang.AbstractMethodErrorIn jdbc that often occurs because you are using a newer version of JDBC (the jvm) and an older driver. It occurs because you called a method which exists in the newer JDBC but does not exist in the older driver.
    getBlob() was introduced in java 1.2, so it was not in JDBC 1.0.

  • Java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSetImpl.getCl

    Hi Techies,
    I am trying to write the jdbc code which is independent to database. I am trying to access the clob datatype for oracle n mysql.
    But I am getting the following xception
    javax.servlet.ServletException: oracle.jdbc.driver.OracleResultSetImpl.getClob(Ljava/lang/String;)Ljava/sql/Clob;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:830)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:763)
         org.apache.jsp.htmls.jsps.RuleManagement_jsp._jspService(RuleManagement_jsp.java:461)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)Here is my code
    if (dataType.equals("CLOB")) {
         System.out.println("inside if");
         oracle.sql.CLOB expressionClob = (oracle.sql.CLOB) rs
                                  .getClob("EXPRESSION");
         System.out.println("inside");
         long clobLenLong = expressionClob.length();
         int clobLenInt = (new Long(clobLenLong)).intValue();
         System.out.println( clobLenInt);
         String expression = expressionClob.getSubString(1, clobLenInt);
    else {
              System.out.println("inside else");
              msclob = MYSQLUtil.getBlobString((java.sql.Blob) rs
                                  .getBlob("EXPRESSION"));
         }Am i missing something in my code .
    thanks,
    Krish

    no ideas

  • Java.lang.AbstractMethodError: oracle/ jdbc/ driver/ OracleResultSet. getBigDecimal

    My JSP works fine using Sun's JSWDK and Jakarta-Tomcat. I just started using WebSphere Application Server v3.5 and now my JSP blows up at "rs.getBigDecimal"
    I'm using WebSphere v3.5, JDBC 2.0(classes102.zip), and JDK 1.2.2
    What can I do to fix this?
    Thanks,
    Brian
    null

    Hello Brian,
    I am facing the same problem and with JSP only. So if you have solution pl let me know.
    [email protected]
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Brian Stechly ([email protected]):
    My JSP works fine using Sun's JSWDK and Jakarta-Tomcat. I just started using WebSphere Application Server v3.5 and now my JSP blows up at "rs.getBigDecimal"
    I'm using WebSphere v3.5, JDBC 2.0(classes102.zip), and JDK 1.2.2
    What can I do to fix this?
    Thanks,
    Brian <HR></BLOCKQUOTE>
    null

  • Re : Error java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDrive

    Hello All,
    I am writing this simple program which connects to Oracle DB ( 10.2 ). The Java version I have is 1.5.0_13 . I do have oracle client installed. When I run the below code ...I get error
    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:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:164)
            at OraThin.main(OraThin.java:13)The code I have is :
    import java.io.*;
    import java.sql.*;
    public class OraThin {
      public static void main(String[] args) {
        try {
    System.out.println(System.getProperty ("java.class.path") );
          Connection con=null;
          Class.forName("oracle.jdbc.driver.OracleDriver");
          con=DriverManager.getConnection(
            "jdbc:oracle:thin:@hostname:15282:ServiceName",
            "scott",
            "tiger");
          Statement s=con.createStatement();
          s.execute("SELECT SYSDATE FROM DUAL");
          s.close();
          con.close();
      } catch(Exception e){e.printStackTrace();}
    } Please suggest as to what am I missing, I am not that well versed with Java.
    Thanks in advance,
    Sam

    Hello Paul,
    Thanks for you suggestion. Based on it , I did add the exact jar file in the PATH environmental variable in XP.
    Path=C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;C:\oraclexe\a
    pp\oracle\product\10.2.0\server\bin;C:\oracle\product\10.2.0\client_1\bin;C:\Ora
    cle\product\10.1.0\Client_1\bin;C:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\
    client;C:\j2sdk1.4.2_06\bin;Even after adding the specific jar file *("C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar")* ..I am getting the exact same error. moreover, to verify this I also tried to import import oracle.jdbc.driver.*.....and now my code would not even complie and I get error *(c:\Program Files\Java\jdk1.5.0_13\bin\OraThin.java:3: package oracle.jdbc.driver*
    does not exist ) . I also rebooted my machine just to make sure ...that didnt work either. Also, I changed these jar to be first in the PATH varibale ..to avoid conflict with any later .jar's classes. The code is :
    import java.io.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class OraThin {
      public static void main(String[] args) {
        try {
    System.out.println(System.getProperty ("java.class.path") );
          Connection con=null;
          Class.forName("oracle.jdbc.driver.OracleDriver");
          con=DriverManager.getConnection(
            "jdbc:oracle:thin:@hostname:15282:ServiceName",
            "scott",
            "tiger");
          Statement s=con.createStatement();
          s.execute("SELECT SYSDATE FROM DUAL");
          s.close();
          con.close();
      } catch(Exception e){e.printStackTrace();}
    }What am I missing here!! ?
    Thanks again,
    Sam

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

    When I run java servlet test_ora.java with IE6.0 I get the following error page:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2349)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:376)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:518)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
         at test_ora.doGet(test_ora.java:21)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2349)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:376)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:518)
         at java.lang.Thread.run(Thread.java:536)
    Java Web Services Developer Pack/1.0-fcs
    I thought it is about JDBC configuration. But when I run JdbcCheckup.java everything works fine. Can anybody help me, please?
    test_ora.java looks like this:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class test_ora extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    String str_dok_numer, str_f_inkraft;
    int int_dok_wal_id;
    Connection conn=null;
    Statement s = null;
    response.setContentType("text/html;charset=iso-8859-2");
    PrintWriter out = response.getWriter();
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@192.168.15.2:1521:DB2","janusz","kimono");
    s = conn.createStatement();
    } catch (SQLException e) {
    out.println("Blad polaczenia z baza danych: " + e.getMessage());
    try {
    ResultSet r =s.executeQuery("select dok_numer, f_inkraft, dok_wal_id from gndlf_umowy_inkraft");
    out.println("DOK_NUMER\tF_INKRAFT\tDOK_WAL_ID");
    while(r.next()){
    out.println (r.getString (1) +"\t" + r.getString (2) + "\t" +r.getString (3));
    conn.close();
    } catch (Exception e) {
    out.println("Wystapil problem z wyslaniem SQL do bazy danych: " + e.getMessage());
    finally {
    try { conn.close(); }
    catch(SQLException e) {}
    and here is code for JdbcCheckup.java (I get it from Internet and made some modifications):
    * This sample can be used to check the JDBC installation.
    * Just run it and provide the connect information. It will select
    * "Hello World" from the database.
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    // We import java.io to be able to read from the command line
    import java.io.*;
    class JdbcCheckup {
    public static void main(String args[])
    throws SQLException, IOException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Prompt the user for connect information
    System.out.println("Please enter information to test connection to the database");
    String user;
    String password;
    String database;
    user = readEntry("user: ");
    int slash_index = user.indexOf('/');
    if (slash_index != -1)
    password = user.substring(slash_index + 1);
    user = user.substring(0, slash_index);
    else
    password = readEntry("password: ");
    database = readEntry("database(a TNSNAME entry): ");
    System.out.print("Connecting to the database...");
    System.out.flush();
    System.out.println("Connecting...");
    //Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@" + database, user, password);
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.15.2:1521:" + database, user, password);
    System.out.println("connected!!!");
    // Create a statement
    Statement stmt = conn.createStatement();
    // Do the SQL "Hello World" thing
    ResultSet rset = stmt.executeQuery("select 'Hello World' from dual");
    while (rset.next())
    System.out.println(rset.getString(1));
    // close the result set, the statement and connect
    rset.close();
    stmt.close();
    conn.close();
    System.out.println("Your JDBC installation is correct.");
    // Utility function to read a line from standard input
    static String readEntry(String prompt)
    try
    StringBuffer buffer = new StringBuffer();
    System.out.print(prompt);
    System.out.flush();
    int c = System.in.read();
    while (c != '\n' && c != -1)
    buffer.append((char)c);
    c = System.in.read();
    return buffer.toString().trim();
    catch(IOException e) {
    return "";
    I use Java Web Service Developer Pack 1.0 on Win98 SE, database Oracle 8.1.7 is installed on dedicated IBM server (AIX 4.x).
    I put these lines in autoexec.bat:
    set PATH=C:\Perl\bin\;"C:\j2sdk1.4.0\bin";%PATH%
    set CLASSPATH=.;C:\j2sdk1.4.0\lib\tools.jar;C:\j2sdk1.4.0\lib\classes12.zip;C:\j2sdk1.4.0\lib\classes111.zip;%CLASSPATH%
    set CLASSPATH=C:\jwsdp_1_0\common\lib\servlet.jar;C:\jwsdp_1_0\common\lib\jasper-compiler.jar;C:\jwsdp_1_0\common\lib\jasper-runtime.jar;%CLASSPATH%
    set JAVA_HOME=C:\j2sdk1.4.0

    I have the same problem. I created a JSP page that uses a class to retrieve database information. I added a main method to the class so I would be able to test it. When I test the class using the main method the method returns all the information from the database. When I try it using Tomcat, I get the following error: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    Does anyone have an idea of what is going on?
    My CLASSPATH configuration is the same.

  • Error: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

    hi,
    I try a simple connect to a DB 9.2.0.1
    through JDBC
    $javac -d /home/oracle/jdbc Applet1.java
    OK
    but ...
    oracle@pluto:/home/oracle/jdbc$ appletviewer -J-Djava.security.policy=mypolic>
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    at mypackage.Applet1.connectToDB(Applet1.java:55)
    at mypackage.Applet1.access$000(Applet1.java:17)
    at mypackage.Applet1$1.actionPerformed(Applet1.java:41)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1
    64)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstr
    ctButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonMode
    .java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:25
    private void connectToDB(ActionEvent e) {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver())
    con = DriverManager.getConnection ("jdbc:oracle:thin:@pluto:1521:DB
    9IDEV","system","manger");
    empValues.setText("Connected to the Database. Fetching Values from
    TOTO Tables.\n");
    fetchValues();
    } catch (SQLException ex) {
    System.out.println("Connection Error = " + ex.toString());
    I tried with:
    CLASSPATH=/tools/oracle/9.2.0/jdbc/lib/classes12.jar
    and ( loaded from otn for JDK 1.4 and 9.2.0.1)
    CLASSPATH=/tools/oracle/9.2.0/jdbc/lib/ojdbc14.jar
    What I have to put in the CLASSPATH, please ???

    Please don't cross post.
    http://forum.java.sun.com/thread.jsp?thread=541572&forum=57&message=2625798
    http://forum.java.sun.com/thread.jsp?thread=541573&forum=48&message=2625800
    http://forum.java.sun.com/thread.jsp?thread=541574&forum=31&message=2625802

  • Java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriveroracle.j

    My compile works just fine: javac mail_create.java
    but when I try to run I get OracleDriver error. Not sure how to fix this. Using RedHat Linux 7.3
    [ora9ias@tautog classes]$ java mail_create
    Error: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriveroracle.j
    dbc.driver.OracleDriver
    [ora9ias@tautog classes]$ pwd
    /home/oracle/9iAS/j2ee/home/default-web-app/WEB-INF/classes
    [ora9ias@tautog classes]$
    Some of my code...
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    public class mail_create {
    public static void main(String[] arguments) {
    StringTokenizer st1;
         int cnt1, cnt2, cnt3, cnt4, ival, newal;
         String commabv, commemail, comabbrv, commca, commail;
         String comcod []=new String [99];
         String comvar []=new String [800];
         String curabr []=new String [800];
         String comail []=new String [800];
    try {
         Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    .....

    http://search.java.sun.com/search/java/index.jsp?qt=%2Boracledriver+%2Bclassnotfoundexception&nh=10&qp=&rf=1&since=&country=&language=&charset=&variant=&col=javaforums

  • Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.

    Hi!!!
    I�m trying to execute a example program included in http://archive.coreservlets.com/, the file is FruitTest.java....this compile very well...but....when i tried to execute it i have the following error:
    Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    Could somebody tell me what i have to add to my classpath?...and how to know if i have to download something and in what link is it?......
    Thanks in advance...
    Mary

    Hi mary,
    Please try following code, but before that please include classes12.zip in ur classpath. This file contains the oracle thin driver.
    Connection connection = null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String url = "jdbc:oracle:thin:@dbUrl"
    connection = DriverManager.getConnection(url, "dbName", "password");
    }catch (Exception e){
    e.printStackTrace();
    good luck ...san :-)

  • Error : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

    Hi,
    I am writing an application and am trying to open a connection to Oracle database that is on a server. I am using the following test code to check if it connects to the database.
    import java.sql.*;
    class dbAccess {
      public static void main (String args []) throws SQLException
            String DBurl = "jdbc:oracle:thin:@local:1522:DBORA";
            String user = "test";
            String pwd = "test123";
            Class.forName("oracle.jdbc.driver.OracleDriver");
            con = DriverManager.getConnection(DBurl, user, pwd);
    }On running the above program I keep on getting the following error:
    Error : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    java.lang.NullPointerException
    If I open the connection using JDeveloper wizard I can see the DB. But if running the above program in the JDev, JCreator or commandline keep on getting the error. Any help is appreciated. Thanks

    How do I set the path for the Oracle Driver. ThanksI dunno. You're supposed to know where that class is (what jar it lives in). You set it up in JDeveloper in the first place, so you must have known where it is. After you know that, it's up to you to figure out how JCreator projects are set up to include jars in a project (just like JDeveloper projects do). For the command-line way, you set the classpath on the command-line arguments:
    java -cp (your classpath here, which must include the jars it needs) ...

  • JDBC,Oracle - java.lang.ClassNotFoundException: oracle.jdbc.driver.Oracle

    I am using JBuilder5 which comes with jdk1.3. I have installed oracle 8.1.7 Enterprise version.
    I am using Win NT 4.0.
    I have set the PATH variable as E:\oracle\ora81\lib; and
    CLASSPATH as : E:\oracle\ora81\jdbc\lib\classes12.zip;E:\oracle\ora81\jdbc\lib\nls_charset12.zip;
    My JDBC code is
    package sample2;
    import java.sql.*;
    public class Two {
    Connection con;
    Statement st;
    public Two() {
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection("jdbc:oracle:oci8:@First","scott","tiger");
    st = con.createStatement();
    ResultSet rs = st.executeQuery("Select * from Book");
    while(rs.next())
    System.out.print(rs.getInt("ID")+"\t");
    System.out.print(rs.getString("title")+"\t");
    System.out.print(rs.getString("author")+"\t");
    System.out.print(rs.getString("subject")+"\t");
    System.out.println(rs.getInt("copies")+"\t");
    st.close();
    con.close();
    catch(Exception ex)
    System.out.println("Exception : " + ex.toString());
    public static void main(String[] args) {
    Two two1 = new Two();
    I am getting this exception:
    Exception : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    I can understand that the classpath for the driver is the problem here.
    Also, I tried to run this file without JBuilder as a independent file on a notepad. Even then this exception is thrown.
    I have set the PATH to E:\oracle\ora81\bin and also to E:\oracle\ora81\lib.
    I ran "echo %classpath%" from my command prompt and this is what i am getting.
    E:\JBuilder5\jdk1.3\lib\tools.jar;E:\JBuilder5\jdk1.3\dt.jar;E:\oracle\ora81\jdbc\lib\classes12.zip;E:
    \oracle\ora81\jdbc\lib\nls_charset12.zip;
    I searched solution for this probldem in Sun JDC Forum itself. Many of them suggested to unzip classes12.zip and create jar file and add it in the classpath. Alos, some have suggested to copy the classes12.zip in home directory and then include this path in the classpath. I tried those solutions also. But, nothing seem to work.
    Somebody help me fix this problem.
    Thanks in advance.

    Jbuilder5 uses a different means of loading dependent classes. Use menu : Tools -->Configure Libraries - Click New and setup a new named library that points to classes12.zip .
    Then include this in u'r required Libraries of your project using menu Project --> Project Properties - required Libraries tab.
    I don't thnk Jbuilder5 even refers to CLASSPATH set in Windows NT environement. Path may need to be set to include oracle/ora81/bin directory though.
    Hope this helps.

  • 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

  • Java.lang.AbstractMethodError: oracle.sql.BLOB.setBytes

    Hi ,
    When I deployed an application ( In Oracle 10g )that uses oracleresultset i am getting an error as follows java.lang.AbstractMethodError: oracle.sql.BLOB.setBytes
    anybody has a clue ?
    Vishnu

    Hi Vishnu,
    I got the same error, and also when trying blob.setBinaryStream(1L);
    By me the DB is an 8.1.6 and the JDBC Driver I tried are both the new 10.1 and older ones.
    Did you solve your problem ? In which case I would be interested in a solution. A work around seems to be the blob.getBinaryOutputStream() method, but this is a problem for me since it is not portable.
    Regards
    Michele

Maybe you are looking for