Java.lang.ClassNotFoundException:   net.sourceforge.jtds.jdbc.Driver

Help!
  I've created a simple program that should connect to a client of mine using jdbc.  I was given the driver class which I have imported and added to my build path.  I deploy the application and it errors saying it cannot find the class.  Here is the code:
public void wdDoInit()
    //@@begin wdDoInit()
    IWDMessageManager mm = wdThis.wdGetAPI().getComponent().getMessageManager();
    String host = "host";
    int port = 1433;
    String SID = "hostsid";
    String user = "username";
    String pass = "pwd";
    String driver_class = "net.sourceforge.jtds.jdbc.Driver"; 
    String access = "jdbc:jtds:sqlserver://" + host + ":1433" + "/" + SID;
    Connection con;
     try
      try
        Driver driver = (Driver)Class.forName(driver_class).newInstance();
       } catch (Exception e)
        mm.reportWarning("msg = " + e.toString());
      con = DriverManager.getConnection(access, user, pass);
    } catch (SQLException e)
      mm.reportWarning("Error: " + e.getMessage());

Hi Steve,
Put jar file with JDBC driver to lib folder under your WD project and it will be included to wda and ear files.
BTW, may be it is beeter to register driver and datasource instead of using direct connect to DB? See how to register data source http://help.sap.com/saphelp_nw04/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm
Best regards, Maksim Rashchynski.

Similar Messages

  • -net.sourceforge.jtds.jdbc.Driver ERROR WHILE CONNECTING TO SQL SERVER

    Hi,
    While making a new connection to Sql Server Express Edition Database, through Oracle Sql Developer i am getting a problem when retrieving the database.The error is "-net.sourceforge.jtds.jdbc.Driver" .I have downloaded the "jTDS - SQL Server and Sybase JDBC driver " from sourceforge website, but i am confused about where to paste it.
    thanks.

    I'm not sure why you are having the error but I am sure of the following:
    1. This forum is not appropriate for SQL*Developer questions.
    2. Or questions about code from SourceForge
    3. Or Microsoft products.
    It seems unlikely this has anything to do with Oracle so I would recommend you find a forum related to the driver if one exists. Otherwise you can try the SQL*Developer forum but I would be there aren't more than a dozen other people on the product trying to do this.

  • Java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver...the same old pr

    Hi,
    I am a new user in this forum..
    I have just installed tomcat and mysql and jdbc fresh on my new system..
    first of all here is what i have done...
    i have installed mysql integrated in xampp at c:\xampp\mysql
    i have installed my tomcat at C:\Programme\Apache Software Foundation\Tomcat 5.5
    i have put jdbc <dirver>.jar file copied in all sorts of directories like ....
    <tomcat_home>\common\lib
    <tomcat_home>\webapps\axis\WEB-INF\lib\ext
    <java_home>\lib
    <java_home>\jre\lib\ext
    my calsspath looks something like this
    .;C:\Programme\QuickTime\QTSystem\QTJava.zip;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\mysql-connector-java-5.0.6-bin.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\webapps\axis\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\servlet-api.jar;C:\Programme\"Apache Software Foundation"\"Tomcat 5.5"\common\lib\jsp-api.jar;C:\Programme\Java\jdk1.5.0_05\jre\lib\ext\mysql-connector-java-5.0.6-bin.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\activation.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis-ant.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\commons-discovery-0.2.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\commons-logging-1.0.4.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\jaxrpc.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\log4j-1.2.8.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\mail.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\saaj.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\wsdl4j-1.5.1.jar;C:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar
    which is basically all the jar files in the web-inf\lib folder and references to all the copies of driver as mentioned before
    these are results of a lot of desperatio but still the code which i run....
    package mypackage;
    import java.sql.*;
    public class JDBCConnector
    public static void main(String[] arg) throws Exception
         System.out.println("Initiating Database Mysql Connection");
         //try {
                   Statement stmt;
                        //     Register the JDBC driver for MySQL.
                   Class.forName("org.gjt.mm.mysql.Driver ").newInstance();
                        //     Define URL of database server for
                        // database named mysql on the localhost
                        //      with the default port number 3306.
                   String url = "jdbc:mysql://wifh-1.fhso.ch:3306/";
                        //          Get a connection to the database for a
                        // user named root with a blank password.
                        // This user is the default administrator
                        // having full privileges to do anything.
                   Connection con = DriverManager.getConnection(url,"root", "birnExy");
                        //Display URL and connection information
                   System.out.println("URL: " + url);
                   System.out.println("Connection: " + con);
                        //Get a Statement object
                   stmt = con.createStatement();
                        //     Create the new database
                   stmt.executeUpdate("CREATE DATABASE JunkDB3");
                        //Register a new user named auser on the
                        // database named JunkDB with a password
                        // drowssap enabling several different
                        // privileges.
                   stmt.executeUpdate("GRANT SELECT,INSERT,UPDATE,DELETE," +"CREATE,DROP " +"ON JunkDB3.* TO 'nishant'@'localhost' " +"IDENTIFIED BY 'nishant';");
                   con.close();
         //}catch( Exception e ) {
              //     e.printStackTrace();
         //}//end catch
              //return hook;
         }//end main
    }//end class JDBCConnector
    gives the following error.....
    <soapenv:Envelope>
    &#8722;
         <soapenv:Body>
    &#8722;
         <soapenv:Fault>
    <faultcode>soapenv:Server.userException</faultcode>
    &#8722;
         <faultstring>
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    </faultstring>
    &#8722;
         <detail>
    <ns1:hostname>SADMC0087</ns1:hostname>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>
    please help me

    20.05.2007 22:43:26 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programme\Java\jdk1.5.0_05\jre\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\QuickTime\QTSystem\;C:\Programme\ATI Technologies\ATI Control Panel;C:\Programme\Java\jdk1.5.0_05\bin;C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib;
    20.05.2007 22:43:27 org.apache.coyote.http11.Http11BaseProtocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    20.05.2007 22:43:27 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1203 ms
    20.05.2007 22:43:27 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    20.05.2007 22:43:27 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
    20.05.2007 22:43:27 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    20.05.2007 22:43:28 org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive SIpages.war
    20.05.2007 22:43:31 org.apache.coyote.http11.Http11BaseProtocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    20.05.2007 22:43:31 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    20.05.2007 22:43:31 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/109 config=null
    20.05.2007 22:43:31 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    20.05.2007 22:43:32 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4813 ms
    now this is when i run from eclipse where SIpages.war is my war file to be deployed...which looks something like this
    sipages/web-inf/classes
    sipages/web-inf/src
    sipages/web-inf/lib-this has the jar file as you mentioned
    and come other files...nwo where soes my .java file go in this war and how do i compile the java file

  • Java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

    hi
    I am facing followig error.
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    How to set the class path.
    I am using Windows XP, NetBeans IDE 5.5, MySQL-5.0
    I have made one simple servlet program in order to read one small table from the MySQL database.
    I got the connectivity but above error is i have been facing.
    Please tell me how to write to set the class path and where should i put my mysql-connector-java-5.0.4-bin file. so i can read the data from the database.
    thanking you.
    regards
    discuss.

    hi
    I am facing followig error.
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    How to set the class path.
    I am using Windows XP, NetBeans IDE 5.5, MySQL-5.0
    I have made one simple servlet program in order to read one small table from the MySQL database.
    I got the connectivity but above error is i have been facing.
    Please tell me how to write to set the class path and where should i put my mysql-connector-java-5.0.4-bin file. so i can read the data from the database.
    thanking you.
    regards
    discuss.

  • Java.lang.OutOfMemoryError (Microsoft SQL Server JDBC driver)

    Hi everyone,
    I am getting a java.lang.OutOfMemoryError when performing a simple query to a database. The query produces only one row (and will always produce only one row). However, the statement that produces the second column in the resultset is very long (>256) characters, so could that be it?
    Also, I am executing thousands of SQL statements with no difficulty. I have double-checked that I am cleaning up all of my database resources, so I don't think that this is it. Do I have to do anything else besides closing the statement and resultset?
    There is no stack trace, otherwise I would have posted it :(
    Also, as an aside - is the Microsoft JDBC driver for SQL Server the best one to use? It seems poorly supported and slow at times. Are there any alternatives?
    Thanks for your time :)
    Ben

    It is running after thousands of other queries. I'll test to see what happens if I run it by itself.
    I am closing the connection. In fact, I am running all of these statements over the same connection and simply opening and closing resultsets.
    So a bug in the driver you think?
    Thanks for the reply :)
    Ben

  • Java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver when using RMI

    I am trying to connect to mysql Db through RMI but i am getting this exception.
    When trying to connect to db through a normal class implementation without RMI it is connected succesfully.
    What is causing the problem????
    Thanks in advace

    CLASSPATH, man. The RMI server needs to have the MySQL driver JAR in its CLASSPATH.
    That's usually what that exception means.
    %

  • Websphere 5.1 Jtds jdbc driver issue

    Can some one suggest the possible solution to this issue.
    I am trying to use Jtds 1.2 jdbc driver to connect to Sqlserver 2000 from the websphere 5.1 app server ( actually test server environment from WSAD 5.1.2) and I am getting the SQLException as follows "The requested size is greater than the maximum number of rows" . We have the same Jtds driver running fine on JBoss app server for the same application. So I am guessing it must be some configuration that I am missing in websphere that I could nt able to figure out. Appreciate if some one can direct me.
    The run time error....
    [7/3/06 11:34:47:297 CDT] 7c2fe6bb WebGroup I SRVE0181I: [Form Action Servlet] [ARJ] [Servlet.LOG]: java.sql.SQLException: java.sql.SQLException: The requested fetch size is greater than the maximum number of rows.
         at net.sourceforge.jtds.jdbc.JtdsStatement.setFetchSize(JtdsStatement.java:956)
         at net.sourceforge.jtds.jdbcx.proxy.StatementProxy.setFetchSize(StatementProxy.java:393)
         at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.enforceStatementProperties(WSJdbcStatement.java:290)
         at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeQuery(WSJdbcStatement.java:443)
         at com.actek.j2ee.common.sessionbean.QuerySessionBean.processQueryParm(QuerySessionBean.java:140)
    and the concised SQL query, app error are as follows...
    SELECT TOP 101 P.CreditTrnNo, P.CreditType, P.CustomerNo, P.Reviewed, P.NextReviewDate, P.DateComp .......... FROM CreditTrn P LEFT OUTER JOIN Customer Customer_CreditTrn ON P.CustomerNo = Customer_CreditTrn.CustomerNo LEFT OUTER JOIN Dealer Dealer_CreditTrn ON P.DealerNo = Dealer_CreditTrn.DealerNo LEFT OUTER JOIN UsrSet UsrSet_CreditTrn ON P.ChkUserNo = UsrSet_CreditTrn.UserNo WHERE Customer_CreditTrn.CustomerId = '013108' ORDER BY P.SalePend DESC, P.CompReq DESC, P.TrnType, P.FstDate, P.FstTime
    java.sql.SQLException: The requested fetch size is greater than the maximum number of rows.
         at net.sourceforge.jtds.jdbc.JtdsStatement.setFetchSize(JtdsStatement.java:956)
         at net.sourceforge.jtds.jdbcx.proxy.StatementProxy.setFetchSize(StatementProxy.java:393)
         at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.enforceStatementProperties(WSJdbcStatement.java:290)
         at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeQuery(WSJdbcStatement.java:443)

    It passes the J2EE 1.3 certification ...So it is JDBC 2.0 compliant.
    How does it rate with JDBC 3.0? Like mostly
    complete? Or all complete but just not certified
    (presuming such a certification exists.)It's both JDBC 2.0 and 3.0 compliant. The problem with the J2EE 1.4 compliance test suite is that it's not publicly available (1.3 is) so we simply can't test against it. We are trying to get jTDS certified, but it costs $2000 and we don't have that kind of money (not unless we pay from our pockets). We intend to do it, from donations and commercial support, but we're currently quite far from the $2k target. Even without an official certification jTDS is the driver of choice for a number of applications that need JDBC 3.0 features (e.g. Hibernate).
    The only missing JDBC 3.0 features are connection pooling and row sets. The reason we did not implement these features is that there are good, free third party implementations out there, which are probably better implemented and tested than anything we could come up with (namely DBCP and c3p0 for connection pooling and the Sun reference implementation for row sets). Regarding connection pooling, jTDS does implement the PooledConnection interface, it just doesn't implement the pooling DataSource.
    And it does windows auth as well as database auth
    right (not a new feature but I want to make sure I
    remember?)Yes, it does both SQL Server and Windows authentication. Windows authentication can be done using the credentials of the currently logged user (i.e. without the need to specify a user name and password) or by providing a Windows user name and password (this is useful when logging in from a non-Windows machine or a machine outside of the domain to an SQL Server that is only configured to accept Windows authentication). As far as I know the second Windows authentication mode is only supported by jTDS.
    Alin.

  • Problem XI 2.0  java.lang.ClassNotFoundException

    We are trying to connect a DB2 system to XI via adapter. We get
    java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.net.DB2Driver
    error when we try the restart.
    CLASSPATH includes the .jar and .zip fies for the DB2 JDBC driver.
    xidadm> echo $CLASSPATH
    /usr/opt/db2_08_01/java/db2java.zip:/usr/opt/db2_08_01/java/db2jcc.jar:/
    usr/opt/db2_08_01/java/db2fs.jar:/usr/opt/db2_08_01/java/db2jcc_license_
    cu.jar:/usr/opt/db2_08_01/java/Common.jar:/usr/sap/XID/SYS/global/tech_a
    dapter/aii_rfcadapter.jar:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server/add
    itionallib/servlet.jar:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server/additi
    onal-lib/sapjco.jar:
    We updated EXTLIBS and ADAPTERLIBS with the .jar and .zip locations.
    What is missing ?

    Hi Hart - Our Basis person made the change noted, but still getting the same problem. He also posted the problem in OSS. Adapter configuration are --
    jdbc adapter java class
    classname=com.sap.aii.messaging.adapter.ModuleDB2XMB
    mode=DB2XMB
    Integration Engine address and document settings (example, see docu)
    XMB.TargetURL=http://xid:50000/sap/xi/engine?type=entry
    XMB.SenderBusinessSystem=abcXXXX
    XMB.SenderInterfaceNamespace=http://sap.com/xi/xidemo
    XMB.SenderInterfaceName=ExtAdapterSenderIF
    XMB.QualityOfService=EO
    db.jdbcDriver=COM.ibm.db2.jdbc.net.DB2Driver
    db.connectionURL=jdbc:db2://xxxxx.xxxxxxx.com:50000;user=xxxxxxx;databaseName=xxxxx
    db.table=<sapprodorders>
    db.processDBSQLStatement=select zorder status from sac.sapprodorders where status = 'R'
    db.pollInterval=600
    Log msg--
    15:57:48 (4205): JDBC adapter stopped
    15:57:59 (4207): JDBC adapter terminated
    Thu Sep 23 15:57:59 EDT 2004 *****
    15:57:59 (4210): ERROR: Attempt to load JDBC driver failed ("java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.net.DB2Driver ")
    Attempt to intialize JDBC adapter failed
    15:57:59 (4203): Unable to start JDBC adapter (not initialized)

  • Error: when connecting to sqlServer2005 java.lang.ClassNotFoundException:

    Hi SDN,
    I am trying to connect to sqlServer2005 using the following code
    try{
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection con = java.sql.DriverManager.getConnection("jdbc:sqlserver://obtdev15:1433;DatabaseName=O50");
    response.write("connection succeded<br>");
    Statement st=  con.createStatement();
    response.write("statement created<br>");
    ResultSet c = st.executeQuery("select * from [SAPO50DB].[OGP_PROJECT]");
    response.write(" rows selected-->" + c.getString("PROJECTNAME"));
    }catch(Exception e){
                  e.printStackTrace();
                  response.write("exception in --"+e);
    when i execute it, it throws the following exception
    <b>java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver Found in negative cache -
    Loader Info -
    ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@b460e20] Parent loader name: [com.sapportals.portal.prt.util.AutoClassLoader@a52a72a] References: not registered! Resources: F:\usr\sap\O50\DVEBMGS50\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\ConnectingtoDB\lib\api.jar -
    </b>
    Please suggest me to rectify the above error.
    your help will be awarded.
    Thanks in Advance.
    Regards
    Basha

    Hi Basha,
    basically, your application is missing a java class. However, the proper way to connect to a database is discussed in this <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=86307">thread</a>.
    Follow Detlev's advise:
    <i>In general, using a J2EE server means that you have a DB connection pool at hand where you can attach your database and then retrieve the Datasource object from the JNDI. That way, you won't have to care about connection pooling etc, and using tools like oject-relational-mappers also is quite easy, for they also expect just the Datasource or even better the JNDI lookup name.</i>
    You will find detailed information in the<a href="http://help.sap.com/saphelp_nw04/helpdata/de/bb/69da54d8aedc419d46d9ea074e4d41/frameset.htm">SAP Library</a>.
    Best regards,
    Martin

  • 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.ClassNotFoundException: weblogic/jdbc/mssqlserver4/Driver

    Hello,
    I am moving my database from Sybase to SQL Server. I have a program that ran fine with JConnect driver (Sybase) on both unix and windows. But now when I try to use the weblogic driver to connect to SQL Server the program fails. I am 100% positive that the weblogic drive is in the classpath. Whether the weblogic drive is in the classpath or not I get the same error:
    Unexpected error:java.lang.ClassNotFoundException: weblogic/jdbc/mssqlserver4/Driver
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:124)
    at com.trilogy.tools.core.DBUtil.loadDriver(DBUtil.java:16)
    at com.trilogy.loader.core.LoadInitUtil.<init>(Compiled Code)
    at com.trilogy.loader.mass.MassInitUtil.<init>(MassInitUtil.java:15)
    at com.trilogy.loader.mass.Loader2CLI.execute(Compiled Code)
    at com.trilogy.tools.core.CLIBase.execute(CLIBase.java:45)
    at com.trilogy.loader.mass.Loader2CLI.main(Loader2CLI.java:805)
    java.lang.NullPointerException
    at com.trilogy.loader.mass.Loader2CLI.execute(Compiled Code)
    at com.trilogy.tools.core.CLIBase.execute(CLIBase.java:45)
    at com.trilogy.loader.mass.Loader2CLI.main(Loader2CLI.java:805)
    Pease help me fix this problem. I am not sure why the weblogic driver is not working. Thanks.

    The error message says it can't find a class named "weblogic.jdbc.mssqlserver4.Driver". That looks rather odd to me.
    Are you sure that you defined the connection information correctly in the configuration file?

  • 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.

Maybe you are looking for