Problems connecting using MM.MySQL JDBC driver - Please Help

I have been trying to get the driver to work for the past two days and have hit a brick wall. If someone could offer any ideas on what other steps to try I would so much appreciate it. Here's the situation:
I'm working on Mac OS X.1, jdk 1.3, mysql (database) and using the mm.mysql driver version 2.0.6.1. I'm using a test script which loads the driver, tries to connect to the 'test' database (which doesn't require a username/password) and then prints out the systems date when successful.
//load the driver
Class.forName("org.gjt.mm.mysql.Driver");
//Try connecting to db
Connection conn = DriverManager.getConnection(jdbc:mysql:///test", "", "");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("SELECT now();");
while (rset.next())
System.out.println(rset.getString(1));
// Close result set, statement and DB connection
rset.close();
stmt.close();
conn.close();
The problem is that everytime I run the script I get an error telling me that the driver could not be found:
Exception in thread "main" java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
��������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:297)
��������at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.j
The mysql database is running in the background, the driver's path location has been added to my classpath and I've also tried modifying the driver name as well as using older versions of the driver itself, but still no luck. This needs to be up and running so I can finalize a project I've been working on. If anyone has any ideas on what I could possibly try next, I welcome the suggestions.
Thanks in advance.

I didn't realize you had to extract the information either.
Ok.. so I downloaded the latest jar file from sourceforge, extracted the data and IT WORKED!! Thank you so much. You saved my head from exploding.
Many thanks.
-c

Similar Messages

  • Protocol Confusion of freeTDS jdbc driver, please help!

    I use freeTDS jdbc driver to connect to MS SQL 2000. In my programme, firstly I need to select sth out, and base on this update the other field in the same table. TOC will like that
    Statement stmt1 = conn.createStatement();
    ResultSet rs1 = stmt1.executeQuery("select sth from table");
    stmt1.executeUpdate("update table set field1 = 'xxx'");
    exception throw: java.sql.SQLException: Protocol confusion. Got a 0x79 packet
    I checked from the source of TDS driver, this exception throws when the sql query output is not a resultset.
    These 2 querys are prefectly okay individually, I tried to reverse the order, doesn't work neither. Even I disconnect the DB Connection and reconnect it before running the 2nd query, it won't help.
    Please help!

    I haven't used freetds, but seems like defaul version is 5.0. Try it with 7.0 and see it works better. By the way, JDBC driver's readme says that it was only tested with MSSQL 6.5 and 7.0.
    ---- FAQ from freetds.org ----
    Do I need to configure anything?
    When you untar the package you will need to run:
    $ ./configure
    You also have the following options you can add to the configure statement:
    --with-tdsver=VERSION
    specify the TDS version to use
    (4.2, 4.6, 5.0, or 7.0) [default is 5.0].
    --enable-msdblib
    enable Microsoft APIs and behaviour for DBLib
    --enable-dbmfix
    rename dbopen() to tdsdbopen() as a work around for dbm name conflict
    --with-gnu-ld
    assume the C compiler uses GNU ld [default=no]
    --enable-shared
    build shared libraries [default=yes]
    --enable-static
    build static libraries [default=yes]
    IMPORTANT You must build with TDS version 4.2 to access a MSSQL server or Sybase prior to 10.0! TDS 7.0 may also be used to talk to MS SQL 7 and above.

  • Anyone using sata_promise w/ SATA drives, please help.

    A recently submitted a kernel patch to ensure that PATA ports are detected on Promise FastTrak controllers with both PATA and SATA ports. I have no way of testing SATA drives with this patch. Could someone using one of these controllers with SATA drives please patch a kernel and see if everything is still good?
    Bug Report #4770

    I'm using sata_promise with a SATA HD. Unfortunately, since Linux 2.6.17 it doesn't want to boot anymore (kernel oops on startup). For now I am using  2.6.15-archck which I still had lying around fortunately, though 2.6.16 also worked for me.
    Do you by any chance know about this problem? According to linux changes, this has happened to the promise driver:
    * Add support for the Promise Fasttrak TX4300/TX4310 4-port PCI SATA controllers based on the PDC40719 chip to sata_promise driver (commit)
    But that was actually a very minor patch, I guess some other promise/sata related change broke it.

  • Problem running Itunes from external hard drive- Please Help!

    So, last night I transferred my entire music folder over to an external hard drive. It copied all the files and I then proceeded to tell itunes where my new music folder was located. The problem I ran into was when I actually deleted the music files from my internal hard drive my library won't automatically find the files. When I click on a song it comes up with an error message saying, "original file cannot be found, would you like to locate file?". If I tell it yes, I can then manually tell it where the file is, and it will play. I'm really hoping there is an easier way around this issue because going in and doing this for every song in my library would take years. Should I clear out the library and then drag it from the external hard drive? Any help would be greatly appreciated. Thanks a lot.
    Sean

    I am experiencing a similar problem. I already had all my files on an external drive, where I had transfered them a few months back, and everything was working fine. I have now moved them, again, to a larger external drive, did everything the same, but now receive the message "original file cannot be found, would you like to locate file?" I was advised to use the "add to library" button under "FILE" in the menu bar and all the music was finally imported into iTunes, but the problem now is that the new data on the music files is missing all the metadata, and I am still stuck with all the original files with the "!" in front of each file that is going to have to be manually deleted one file at a time, all 30,000 of them. I would like a way to start over and get it right the first time. Anyone have any solutions? I have found a program, "Super Remove Dead Tracks" which should solve the problem of eliminating the "!" tracks, but so too all the metadata. Ideally I'd like to be able to locate the original files with all the attached metadata and get back to where I was 24 hours ago.

  • HT201250 My Time Machine Icon in the Toolbar is dimmed, and I'm unable to connect to my external Hard Drive, please help!

    Time Machine seems to be dead, since I'm unable to reset it. As soon as I try  anything, it goes to back to the "OFF" Position. Would appreciate any Help, to get my external Hard Drive to work. Adolffrom Peachland!
    Product, 2012 IMac 21.5"

    There's an apple store in my city but it is about a 20 minute drive and I do not have apple care. Do you think they would still help me?

  • Using mysql jdbc driver leads to exception

    I try to use com.mysql.jdbc.Driver with JDeveloper 9i business components. The following is the code I use to test if mysql driver works with business components:
    package test;
    import oracle.jbo.*;
    import java.util.Hashtable;
    import javax.naming.*;
    public class Test { 
    public static void main(String[] args) {   
    final String amName = "test.TestModule";
    final String voName = "test.TesttableView";
    final String userName = "some_user";
    final String password = "some_password";
    final String connStr = "jdbc:mysql://localhost:3306/test";
    System.setProperty("jdbc.drivers", "com.mysql.jdbc.Driver");
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    ApplicationModule appMod = null;
    try {     
    javax.naming.Context ic = new InitialContext(env);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(amName);
    appMod = home.create();
    java.util.Properties props = new java.util.Properties();
    props.put("user",userName);
    props.put("password",password);
    props.put("defaultRowPrefetch","15");
    appMod.getTransaction().connect(connStr, props);
    } catch(Exception e) {     
    e.printStackTrace();
    ViewObject vo = appMod.createViewObject("vo", voName);
    Row r = vo.first();
    r.setAttribute("Testcolumn", "Some text");
    System.out.println("vo before AppMod post " + r.getAttribute("Testcolumn"));
    try {   
    appMod.getTransaction().commit();
    System.out.println("Commit succeeded.");
    } catch (oracle.jbo.JboException e) {   
    System.out.println("Commit failed. " + e);
    r = vo.first();
    System.out.println("vo after AppMod commit " + r.getAttribute("Testcolumn"));
    Everything works fine until ViewObject.first() is called, then the following exception is thrown:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.ClassCastException, msg=com.mysql.jdbc.PreparedStatement
         void oracle.jbo.JboException.<init>(java.lang.Throwable)
              JboException.java:344
         oracle.jbo.Row oracle.jbo.server.ViewRowSetIteratorImpl.first()
              ViewRowSetIteratorImpl.java:1156
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.first()
              ViewRowSetImpl.java:2240
         oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.first()
              ViewObjectImpl.java:4345
         void test.Test.main(java.lang.String[])
              Test.java:32
    ## Detail 0 ##
    java.lang.ClassCastException: com.mysql.jdbc.PreparedStatement
         void oracle.jbo.server.OracleSQLBuilderImpl.doStatementSetRowPrefetch(java.sql.Statement, int)
              OracleSQLBuilderImpl.java:894
         java.sql.PreparedStatement oracle.jbo.server.DBTransactionImpl.createPreparedStatement(java.lang.String, int)
              DBTransactionImpl.java:2695
         java.sql.PreparedStatement oracle.jbo.server.DBTransactionImpl2.createPreparedStatement(java.lang.String, int)
              DBTransactionImpl2.java:418
         java.sql.PreparedStatement oracle.jbo.server.DBTransactionImpl.createReUsePreparedStatement(java.lang.String, int)
              DBTransactionImpl.java:3467
         java.sql.PreparedStatement oracle.jbo.server.ViewObjectImpl.getPreparedStatement(int, boolean[])
              ViewObjectImpl.java:6496
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:483
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:2600
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:521
         void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
              ViewRowSetIteratorImpl.java:2197
         oracle.jbo.Row oracle.jbo.server.ViewRowSetIteratorImpl.first()
              ViewRowSetIteratorImpl.java:1141
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.first()
              ViewRowSetImpl.java:2240
         oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.first()
              ViewObjectImpl.java:4345
         void test.Test.main(java.lang.String[])
              Test.java:32
    Exception in thread main.
    Is there anyone who would be able to help me with this problem?
    Thank you in advance!

    Use
    Class.forName("com.mysql.jdbc.Driver");Is the MySQL JDBC JAR file listed in project path.?

  • MySQL "JDBC" driver

    Hi all,
    I am trying to configure a MySQL Database Resource on IDM.
    I keep getting the error : "*suitable driver not found for MySQL*.........blah blah."
    From previous postings on this forum, some people suggest removing any other drivers which may exist in the "*WSHOME/idm/WEBINFO/lib*" folder.
    But, this does not make much sense to me. I already have another driver there (the "*sqljdbc*" driver for my MS-SQL database, which acts as the Repository for my IDM). If I remove this driver, won't this affect the connection to my Repository?
    Any tips would be greatly appreciated, thanks.

    Wow this makes me cringe...
    Please... for security's sake, don't download and install binaries you intend on running in production from random strangers. Even from a .edu address. Get the drivers you need from the vendor, that is the MySQL web site. (FYI the official site is here .) This is identity data you're dealing with here!
    See the documentation on configuring and using the MySQL JDBC driver: [http://docs.sun.com/app/docs/doc/820-5594/ghmbe?l=en&a=view|http://docs.sun.com/app/docs/doc/820-5594/ghmbe?l=en&a=view]
    For the record the mysql-connector-java-5.1.5.jar file is the JDBC driver you need. All you needed to do is rename it and even that's not strictly required. You do not need two copies of the file in WEB-INF/lib.
    Finally, as for the root problem: suitable driver not found... I've generally found that when I encounter that issue it's a Java version mismatch between what version of the JVM I'm running and what version the driver was compiled for. Eg. 1.4 driver for a 1.5 JVM. That's not 100% true in all cases and nailing down the suitable version error is a bit tough.

  • Com.mysql.jdbc.driver and jdbc:odbc bridge driver

    Hi All,
    I want to update mysql database from data in hashtable. My application already uses JDBC:OBDC bridge driver for retrieving data from excel sheet and putting in hashtable.
    For connecting to mysql i need to use com.mysql.jdbc.driver too in the same code.
    How to do that?
    my code uses.
    Read(String strFilePath,String strFileName)
               filepath = strFilePath;
               filename = strFileName;
                strDriver= "jdbc:odbc:Driver={MicroSoft Excel Driver (*.xls)}";Thanks

    Please stay with one thread:
    http://forum.java.sun.com/thread.jspa?threadID=5145466&tstart=0
    Please don't cross-post this way.

  • I want to connect to a Profile database using the Sanchez JDBC Driver.

    I want to connect to a Profile database using the Sanchez JDBC Driver. Is that possible? Would I need to create an extension?

    You can't do it directly - only those databases listed in the help under third party databases are supported.
    You may well be able to write an extension to connect to an additional database, but it seems like a lot of work.

  • I use iPhone 4S .earlier with ios 6 and now ios 6.while I connect the charger for charging my phone network lost while midway in charging.that problem always while 3G connection is active.but this problem not arise while 3G mode off.please help me.

    I use iPhone 4S .earlier with ios 6 and now ios 6.while I connect the charger for charging my phone network lost while midway in charging.that problem always while 3G connection is active.but this problem not arise while 3G mode off.please help me.

    reset all settings
    settings-general-reset-reset all settings
    now reconnect to wifi
    settings- wifi- click network name- enter password - join
    if issue persists back up and restore as new via iTunes
    Peace, Clyde

  • Unable to create : com.mysql.jdbc.Driver error with JDeveloper 10.1.3

    Hi all,
    I got this error when I tried to execute a simple JSF app. I am using JDeveloper 10.1.3 release edition. Please advice
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    **** Unable to obtain password from principals.xml. Using default.
    C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\config>
    C:\JDeveloper10g\jdk\bin\javaw.exe -ojvm -classpath C:\JDeveloper10g\j2ee\home\oc4j.jar;C:\JDeveloper10g\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\config\server.xml
    [waiting for the server to complete its initialization...]
    2006-01-31 21:40:47.062 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms.war...
    2006-01-31 21:40:47.093 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms.war in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms
    2006-01-31 21:40:47.093 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\dms.war
    2006-01-31 21:40:47.156 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources.rar...
    2006-01-31 21:40:47.156 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources.rar in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources
    2006-01-31 21:40:47.171 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\connectors\datasources\datasources.rar
    2006-01-31 21:40:47.218 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j.ear...
    2006-01-31 21:40:47.281 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j.ear in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j
    2006-01-31 21:40:47.359 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j.ear
    2006-01-31 21:40:47.375 NOTIFICATION Auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp.war...
    2006-01-31 21:40:47.375 NOTIFICATION Unjar C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp.war in C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp
    2006-01-31 21:40:59.296 NOTIFICATION Finished auto-unpacking C:\JDeveloper10g\jdev\system\oracle.j2ee.10.1.3.36.73\embedded-oc4j\applications\bc4j\webapp.war
    2006-01-31 21:41:08.421 WARNING J2EE OJR0107 Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
    06/01/31 21:41:08 SEVERE: ApplicationStateRunning.initConnector Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
    Jan 31, 2006 9:41:08 PM com.evermind.server.ApplicationStateRunning initConnector
    SEVERE: Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
    06/01/31 21:41:08 SEVERE: ApplicationStateRunning.initConnector Stack trace: oracle.oc4j.sql.DataSourceException: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:2016)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1961)
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1220)
         at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:356)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:208)
         at com.evermind.server.Application.setConfig(Application.java:391)
         at com.evermind.server.Application.setConfig(Application.java:309)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
         at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1532)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:939)
         at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:113)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.resource.ResourceException: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
         at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:106)
         at oracle.oc4j.sql.DataSourceUtils.getDataSourceConnectionPool(DataSourceUtils.java:322)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:1997)
         ... 11 more
    Caused by: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:247)
         at oracle.oc4j.sql.DataSourceConnectionPoolImpl.<init>(DataSourceConnectionPoolImpl.java:107)
         at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:99)
         ... 13 more
    Caused by: oracle.classloader.util.AnnotatedClassNotFoundException:
         Missing class: com.mysql.jdbc.Driver
         Dependent class: oracle.oc4j.sql.config.DataSourceConfigUtils
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDeveloper10g/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDeveloper10g\j2ee\home\oc4j.jar
    This load was initiated at current-workspace-app.root:0.0.0 using the Class.forName() method.
    The missing class is not available from any code-source or loader in the system.
         at oracle.classloader.PolicyClassLoader.handleClassNotFound(PolicyClassLoader.java:2061)
         at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1665)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1621)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1606)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:244)
         ... 15 more
    Jan 31, 2006 9:41:08 PM com.evermind.server.ApplicationStateRunning initConnector
    SEVERE: Stack trace: oracle.oc4j.sql.DataSourceException: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:2016)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1961)
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1220)
         at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:356)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:208)
         at com.evermind.server.Application.setConfig(Application.java:391)
         at com.evermind.server.Application.setConfig(Application.java:309)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
         at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1532)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:939)
         at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:113)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.resource.ResourceException: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
         at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:106)
         at oracle.oc4j.sql.DataSourceUtils.getDataSourceConnectionPool(DataSourceUtils.java:322)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnectionPool(ApplicationStateRunning.java:1997)
         ... 11 more
    Caused by: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:247)
         at oracle.oc4j.sql.DataSourceConnectionPoolImpl.<init>(DataSourceConnectionPoolImpl.java:107)
         at oracle.oc4j.sql.spi.ResourceAdapterImpl.createDataSourceConnectionPool(ResourceAdapterImpl.java:99)
         ... 13 more
    Caused by: oracle.classloader.util.AnnotatedClassNotFoundException:
         Missing class: com.mysql.jdbc.Driver
         Dependent class: oracle.oc4j.sql.config.DataSourceConfigUtils
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDeveloper10g/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDeveloper10g\j2ee\home\oc4j.jar
    This load was initiated at current-workspace-app.root:0.0.0 using the Class.forName() method.
    The missing class is not available from any code-source or loader in the system.
         at oracle.classloader.PolicyClassLoader.handleClassNotFound(PolicyClassLoader.java:2061)
         at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1665)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1621)
         at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1606)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createConnectionFactory(DataSourceConfigUtils.java:244)
         ... 15 more
    06/01/31 21:41:08 WARNING: Application.setConfig Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
    Jan 31, 2006 9:41:08 PM com.evermind.server.Application setConfig
    WARNING: Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
    2006-01-31 21:41:08.531 WARNING J2EE 0JR0013 Exception initializing deployed application: current-workspace-app. Error occurred initializing connectors. Exception is: Exception creating connection pool. Exception: oracle.oc4j.sql.config.DataSourceConfigException: Unable to create : com.mysql.jdbc.Driver
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 29125 ms.

    I did what Manu suggested with no success. Alternatively, I registered the driver jar with embedded OC4J preferences > global > libraries. Still does not work. Please, note, that when I run JUnit tests against my BC4J application modules with JDBC URL as connection type, everything works just fine. The problem comes while running the JSF application when the application module is using JDBC DataSource as connection type.

  • No suitable driver with com.mysql.jdbc.Driver

    Ok. here's the issue. I have a windows box. (first problem) but let's pretend that it's ok. :) I installed Tomcat 4.1 installed J2SDK1.4.0
    start serving pages GREAT!. I have Mysql working perfectly with PHP on this system. I JUST want to connect with JDBC :)
    I've downloaded the MySQL Jdbc Connector/J 3.08 stable installed the .jar file in the $JAVA_HOME/jre/lib/ext as per the README
    Now granted I am a little new to JSP. but I have checked over this again and again. used different code. connected as many ways as I can think of and I still get the same result.
    Database Error :
    No suitable driver
    Please Try Some Other Time
    So I figure it's a MYSQL issue. no I also went thru and did the Microsot connection to MS SQL 2000 with the same result.
    Here's where the drivers are (tried using the other method for installing the MySQL connector as well, and my class path
    Y:\j2sdk1.4.0\com\mysql\jdbc\Driver.class
    com.mysql.jdbc.Driver.class
    Y:\j2sdk1.4.0\org\gjt\mm\mysql\Driver.class
    org.gjt.mm.mysql.Driver.class
    My classpath is:
    .;F:\j2sdk1.4.0\;F:\j2sdk1.4.0\bin\;F:\j2sdk1.4.0\lib\;F:\j2sdk1.4.0\lib\classes\
    [ Here's The Enviorment]
    Windows 2000 5.00.2195 SP3
    MS SQL 2K SP3
    Apache Tomcat/4.1.27
    j2sdk1.4.0
    MySql 3.23.57-nt
    mysql Jdbc Connector/J 3.08 stable
    <!-- mysql.jsp BEGIN-->
    <%@ page import="java.sql.*" %>
    <%
    Connection conn;
    ResultSet results;
    try      {
         String jdbc_driver = "com.mysql.jdbc.Driver";
         System.out.println("jdbc_driver = " + jdbc_driver);
         Class.forName(jdbc_driver).newInstance();
         catch (ClassNotFoundException cnfe)
         System.out.println(cnfe.getMessage());
    try      {
         String url = "jdbc:mysql://localhost:3306/javatest?username=root,password=****"; // pass hidden
         conn = DriverManager.getConnection(url);
         System.out.println("connected to mySql DataBase");
         Statement stmt = conn.createStatement();
         Statement smt=conn.createStatement();
         results=smt.executeQuery("select * from testdata");
              while(results.next())
                   %>
                   <%= results.getString("foo")%>
                   <%= results.getString("bar")%>
                   <%= results.getString("id")%>
                   <%
              results.close();
              conn.close();
         catch(Exception exp)
         %>
              <H3>Database Error : </H3><B><%= exp.getMessage() %></B><H3>Please Try Some Other Time</H3>
         <%
    %>
    <!-- mysql.jsp end -->
    BTW i aslo tried connecting to MicrosoftSQL 2K
    <!-- microsoft.jsp Begin -->
    <%@ page import="java.sql.*" %>
    <%
    Connection conn;
    ResultSet results;
    try      {
         String jdbc_driver = "sun.jdbc.odbc.JdbcObdcDriver";
         System.out.println("jdbc_driver = " + jdbc_driver);
         Class.forName(jdbc_driver).newInstance();
         catch (ClassNotFoundException cnfe)
         System.out.println(cnfe.getMessage());
    try      {
         String url = "jdbc:odbc:contacts";
         String username = "javauser";
         String pw = "javauser";
         conn = DriverManager.getConnection(url, username, pw);
         System.out.println("connected to Msoft DataBase");
         Statement stmt = conn.createStatement();
         Statement smt=conn.createStatement();
         results=smt.executeQuery("select * from contacts");
              while(results.next())
                   %>
                   <%= results.getString("name")%><br>
                   <%
              results.close();
              conn.close();
         catch(Exception exp)
         %>
              <H3>Database Error : </H3><B><%= exp.getMessage() %></B><H3>Please Try Some Other Time</H3>
         <%
    %>
    <!-- microsoft.jsp end -->
    got the exact same results.
    Just to show you mysql is Good. with localhost.
    mysql -u root -h localhost -p
    mysql> use javatest
    Database changed
    mysql> select * from testdata;
    | id | foo | bar |
    | 1 | hello | 12345 |
    1 row in set (0.00 sec)
    mysql>

    Nope, it's not a MySQL issue.
    I'd recommend NOT putting the JDBC JAR file (or any others, except Sun-sanctioned extensions) in JAVA_HOME/jre/lib/ext.
    JDBC JARs belong in TOMCAT_HOME/common/lib or in the WEB-INF/lib directory for your particular app. If you put them in the former, all apps running under Tomcat can have access to them. If you put them in the latter, only your app can see them.
    After you've done that, do some reading about JNDI data sources under Tomcat:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    That way you can get that connection code out of your JSPs and into the web.xml and <Context>, where it belongs. You'll be able to change data sources without rewriting your pages.
    Good luck - MOD

  • Error in Class.forName("com.mysql.jdbc.driver")

    Hi forum,
    Please help me to solve the issue.
    im using the following jsp code for genrating the reports using JASPER REPORTS
    the JSP FILE
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="javax.sql.DataSource"%>
    <%@ page import="javax.naming.InitialContext"%>
    <%@ page import="net.sf.jasperreports.engine.*"%>
    <%@ page import="net.sf.jasperreports.engine.design.JasperDesign"%>
    <%@ page import="net.sf.jasperreports.engine.xml.JRXmlLoader"%>
    <%@ page import="net.sf.jasperreports.engine.export.*" %>
    <%@ page import ="net.sf.jasperreports.engine.*"%>
    <%@ page import ="net.sf.jasperreports.engine.JasperFillManager"%>
    <%@ page import ="net.sf.jasperreports.engine.JRException"%>
    <%@ page import="net.sf.jasperreports.engine.JasperReport"%>
    <%@ page import="net.sf.jasperreports.engine.JasperPrint"%>
    <html>
    <body bgcolor="00ffcc">
    <%
    try{
    Connection con = null;
    String url="jdbc:mysql://localhost/customer";
    String username = "root";
    String password = "cmsadmin";
    InputStream input=new FileInputStream(new File("C:/Documents and Settings/user/My Documents/NetBeansProjects/jasperreports/web/helloworld.xml"));
    JasperDesign design = JRXmlLoader.load(input);
    JasperReport report = JasperCompileManager.compileReport(design);
    Map params = new HashMap();
    params.put("reportTitle", "helloworld");
    params.put("author", "Muthu Kumar");
    params.put("startDate", (new java.util.Date()).toString());
    params.put("ReportTitle", "PDF JasperReport");
    <img class="emoticon" src="images/emoticons/confused.gif" border="0" alt="" />Class.forName("com.mysql.jdbc.Driver");<img class="emoticon" src="images/emoticons/confused.gif" border="0" alt="" /><img src="images/emoticons/confused.gif" border="0" alt="" />
    con = DriverManager.getConnection(url,username,password);
    JasperPrint print = JasperFillManager.fillReport(report, params, con);
    OutputStream output=new FileOutputStream(new File("C:/Documents and Settings/user/My Documents/NetBeansProjects/jasperreports/helloreportworld.pdf"));
    JasperExportManager.exportReportToPdfStream(print, output);
    // JasperViewer.viewReport(print);
    catch(SQLException es) {
    out.println(es);
    catch(JRException ex){
    //ex.printStackTrace();
    out.println(ex);
    %>
    </body>
    </html>The error it is saying is in the line Class.forName(....) ;
    Please look for the emoctions with question mark
    i DOn know what to do.
    Please help
    Im comparin the below JRXML file as with the above code
    <?xml version="1.0"?>
    <!DOCTYPE jasperReport
    PUBLIC "-//JasperReports//DTD Report Design//EN"
    "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
    <jasperReport name="helloworld">
    <parameter name="reportTitle" class="java.lang.String"/>
    <parameter name="author" class="java.lang.String"/>
    <parameter name="startDate" class="java.lang.String"/>
    <queryString>
    <![CDATA[SELECT * FROM customer order by UserID ]]>
    </queryString>
    <field name="UserID" class="java.lang.String"/>
    <field name="UserName" class="java.lang.String"/>
    <field name="City" class="java.lang.String"/>
    <field name="State" class="java.lang.String"/>
    <title>
    <band height="60">
    <textField>
    <reportElement x="0" y="10" width="500" height="40"/>
    <textElement textAlignment="Center">
    <font size="24"/>
    </textElement>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$P{reportTitle}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="0" y="40" width="500" height="20"/>
    <textElement textAlignment="Center"/>
    <textFieldExpression class="java.lang.String">
    <![CDATA["Run by: " + $P{author}
    + " on " + $P{startDate}]]>
    </textFieldExpression>
    </textField>
    </band>
    </title>
    <columnHeader>
    <band height="30">
    <rectangle>
    <reportElement x="0" y="0" width="500" height="25"/>
    <graphicElement/>
    </rectangle>
    <staticText>
    <reportElement x="5" y="5" width="50" height="15"/>
    <textElement/>
    <text><![CDATA[UserID]]></text>
    </staticText>
    <staticText>
    <reportElement x="55" y="5" width="150" height="15"/>
    <text><![CDATA[UserName]]></text>
    </staticText>
    <staticText>
    <reportElement x="205" y="5" width="255" height="15"/>
    <text><![CDATA[City, State]]></text>
    </staticText>
    </band>
    </columnHeader>
    <detail>
    <band height="20">
    <textField>
    <reportElement x="5" y="0" width="50" height="15"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{UserID}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="55" y="0" width="150" height="15"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{UserName}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="205" y="0" width="255" height="15"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{City} + ", " + $F{State}]]>
    </textFieldExpression>
    </textField>
    </band>
    </detail>
    </jasperReport>

    Glass_Fish wrote:
    I have set the classpath in the environment variables in the my computer properties.The web container has it's own properties. The "system" classpath means absolutely nothing to it. Read your server's documentation.

  • Mm.mysql JDBC Driver and the WHERE clause

    Anybody has succesfully performed a MySQL/JDBC query in a JSP application using more than one variable in the WHERE clause?
    It works fine when I run queries with one fixed value assigned to a column and one variable assigned to the other column in the WHERE clause; but when I do it with more than one variable in the WHERE clause, it screws up throwing an error.
    I wonder if it is a code error, a syntax error or if it is something tricky about the mm.mysql JDBC Driver. Following is a section of the code and the error. The variables are s_description and s_status. I read some examples in a book but they use SQL Server. Thank you in advance for any information.
    CODE:
    <% String sqlStatement = "" ; %>
    <% String s_description = "Mexican Style Rice" ; %>
    <% String s_status = "available" ; %>
    <% java.sql.Statement stmt = con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_UPDATABLE); %>
    <% java.sql.ResultSet rs ; %>
    <% sqlStatement = "SELECT code, description, status FROM products WHERE products.description =" + s_description + " AND products.status =" + s_status + ";" ;%>
    <% rs = stmt.executeQuery(sqlStatement); %>
    <% rs.beforeFirst(); %>
    <% while (rs.next()) { %>
    <% rs.updateString(3, "sold"); %>
    <% rs.updateRow(); %>
    <% }%>
    <% rs.close(); %>
    This is the ERROR it throws
    java.sql.SQLException: Column not found: Unknown column 'available' in 'where clause'
         at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
         at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
         at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)
         at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
         at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
         at org.gjt.mm.mysql.Statement.executeQuery(Statement.java:169)
         at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78)
         at pagecompile._GetFood_xjsp._jspService(_GetFood_xjsp.java:45)
         at com.newatlanta.servletexec.JSP10HttpJspPage.service(JSP10HttpJspPage.java:41)
         at com.newatlanta.servletexec.JSP10Servlet.service(JSP10Servlet.java:779)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1679)
         at com.newatlanta.servletexec.ServletExec.processServletRequest(ServletExec.java:1654)
         at com.newatlanta.servletexec.ServletExec.processServletAlias(ServletExec.java:1602)
         at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1343)
         at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1113)

    I think perhaps this sentence has problems:
    <% sqlStatement = "SELECT code, description, status FROM products WHERE products.description =" + s_description + " AND products.status =" + s_status + ";" ;%>
    You can
    <% sqlStatement = "SELECT code, description, status FROM products WHERE products.description ='" + s_description + "' AND products.status = '" + s_status + "'" ;%>
    You perhaps ignore the ���� when using String variable s_description and s_status.
    Hope this will help you. Good lucky!

  • Connect Forms to MySQL JDBC

    Hi,
    I need help connecting to a MySQL db through oracle reports using a jdbc connection.
    I have downloaded the MySQL JDBC driver:mysql-connector-java-3.0.17-ga-bin.jar.
    I can succesfully use it to connect if I write a simple java program. So I know the driver works.
    I have set it in my classpath & edited the jdbcpds.conf file by adding the following:
    <driver name = "mysql-merant"
    sourceDatabase = "other"
    subProtocol = "mysql"
    connectString = "mainProtocol:subProtocol://databaseName"
    class = "com.mysql.jdbc.Driver"
    connection = "oracle.reports.plugin.datasource.jdbcpds.JDBCConnectionHandling">
    </driver>
    When I try to connect, I get the following error, ERR 62002 failed to connect to the data source.
    What do I have to do to connect? Is there a way to directly give the connect string?
    I can connect to an oracle DB using a the Oracle drivers no problem, why does forms not accept the MySQL driver? What can I do to make this work?
    Any help would be appreciated.
    Michael Baran
    [email protected]

    With Reports 9i the mysql-connector-java doesn´t work for that. You don´t have to edit the jdbcpds.conf. mysql-merant doesn´t exist. Just download MyODBC conector and then stand up your database in your DSN system. Use the wizard to make a report, then use JDBC Query and using jdbc-odbc driver, fill the fields
    then you have connected MySQL
    very easy.
    I hope this help you

Maybe you are looking for

  • Homepage always opens to same old album - Can I change this?

    My homepage always opens to the same album - the first one I created. How do I create an album that can function as the initial page that visitors see rather than have them opening to a particular album?? It seems that it should be easy to open to a

  • I do not have a photo button option

    I do not have the option to sync or upload photos to itunes because I do not have the button as an option. This is a new computer and a new ipad. I was able to get it to work once and upload pictures to my ipad from my old laptop but now its not even

  • How to find out, whether any invoice is having header text or not.

    HI all, How to find out, whether any invoice is having header text or not. wheich table we have to refer. Thanks mahaboob

  • How to copy using 0fiscper

    Hi Experts, How can i copy ONE year to another year when the data is in 0fiscper. I want to copy the actuals from year 001.2006 to 012.2006 into 001.2007 to 012.2007. But when i copy thru FOX, it didnt allow me to do this using a variable restricted

  • A handy guide for Activity Monitor processes?

    Hello. Is there a handy guide to all (or most/many) of the processes going on in Activity Monitor? I am thinking along the lines of this page: http://www.westwind.com/reference/OS-X/background-processes.html ..but with more processes (e.g., this one