Menu

can not get connector/J working

Help
2003-03-17
2003-03-18
  • Damon L. Chesser

    I will try to be brief:

    System:  win2k service pack 3 w/MySQL 3.23.55-max-nt and j2sdk1.4.1_02 installed.

    I have moved the .jar file for connector/j into the j2sdk1.4.1_02\lib\exe folder.  I can compile simple jave scripts and run them.  I have tested the connector/J with:

    public class test  {
       public static void main (String []  args)  {
          try {
            Class.forName ("com.mysql.jdbc.Driver") .newInstance () ;
            System.out.println ("Good to go") ;
          }  catch  (Exception E)  {
              System.out.println ("JDBC Driver error") ;
          }
       }
    }

    My "Driver Settings" are:  Driver Name:  com.mysql.jdbc.Driver, URL:  jdbc://mysql://localhost, Database:  test, Table:  TestBill

    I get the error when testing "could not find JDBC driver com.mysql.jbdc.Driver. Make sure you have the correct driver files and that ...etc.

    This is from the connector/J readme:  "If you are going to use the driver with the JDBC DriverManager, you would use
    "com.mysql.jdbc.Driver" as the class that implements java.sql.Driver."  If I use "java.sql.Driver" I get asked for the password, then get the same error code.

    I am very new to (first day) java and have some knowlege of  sql managment.  I must be missing something very basic but can't find it in any of the various FM's I have read, so if you can at least point me in the right direction of the FM I will RTFM. :)

    Let me know if you need more info, I have tried to cover all the bases.

    Damon Chesser
    dchesser2bigfoot.com

     
    • DeckerEgo

      DeckerEgo - 2003-03-18

      The driver should go into j2sdk1.4.1_02\jre\lib\ext - it's the standard extensions folder that driver files should go into.

      If all else fails, you can use the most recent beta of ConsultComm 3. There you can specify the .jar file in the plugin preferences.

       
      • Damon L. Chesser

        It is correct that the entire .jar file goes there (I mean after you unpack the connector/j jar file you have mysql-connector-java-3.0.6-stable-bin.jar still in .jar format).

        mysql-connector-java-3.0.6-stable-bin.jar is the file I put in G:\Program Files\Java\j2re1.4.1_02\lib\ext (My win2k drive).

         
        • DeckerEgo

          DeckerEgo - 2003-03-18

          The whole jar does go in there. But be wary - earlier you said you had things listed in the j2sdk folder. If you have both the JRE and the SDK installed, make sure you know which java version you're actually running when you use ConsultComm. To be safe, you probably want the jar in both the SDK's jre/lib/ext directory and the JRE's /lib/ext directory.

          Confusing enough? ;) Now you see why I added it as a preference in 3.0....

           
          • Damon L. Chesser

            Well, it looks like it looks for it in  g:/2sdk1.4.1_02 etc. according to the error message if I change the driver name to something else.

            But now with connector/j in g\2sdk1/4/1_02\jre\lib\ext, it asks for a login name and pswd (root and "blank", using stock mysql test db)  when I put in root and hit enter I get "Could not build JDBC connection:  java.aql.SQL Exception:  No suitable driver". 
            As I see it that is saying that "com.mysql.jdbc.Driver" does not exist.  If that is so, then what do I do to make it since I downloaded the connector/j?

            I realy apprieciate the time you take to help my out, especialy the speed of your last response.

            Damon

             
            • DeckerEgo

              DeckerEgo - 2003-03-18

              MySQL can be tricky with remote access. First, make sure the MySQL listener is setup to accept remote connections. Next, make sure it approves of password requests (and not just local logins) for the given user.

              The "No suitable driver" error can mean that it either can't connect or it can't actually find a good classfile to connect. You might want to check Sun's JDBC driver page at java.sun.com to make sure you have the right JDBC driver for MySQL.

               
    • Damon L. Chesser

      Never mind!!  I was not following directions even after you were nice enough to post them for me.  I finaly moved the connector/j to G:\j2sdk1.4.1_02\jre\lib\ext just like your app tried telling me, and you told me.  I will work on it some more and try to RTFM and actualy read what is written.

      Thank you for your time.

      Damon

       

Log in to post a comment.

MongoDB Logo MongoDB