You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve Madonna <st...@netune.com> on 2002/02/27 01:38:11 UTC

mySQL/JDBC/Tomcat4 documentation

Anyone know were I can get some documentation on installing
mm.mysql-2.0.4-bin.jar file? I keep getting that "not sutible driver" error
everyone keeps talking about.

Thx in advance.

-Steve

Re: mySQL/JDBC/Tomcat4 documentation

Posted by 丁辉 <dh...@bisp.com>.
The installation process is very simple.you simply copy the mm.mysql-2.0.4-bin.jar to somewhere in your computer, and add that JAR file into system's CLASSPATH.
I think your problem is not caused by CLASSPATH, maybe it's  the problem of initilizing the MYSQL JDBC driver.

----- Original Message ----- 
From: "Steve Madonna" <st...@netune.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, February 27, 2002 8:38 AM
Subject: mySQL/JDBC/Tomcat4 documentation


> Anyone know were I can get some documentation on installing
> mm.mysql-2.0.4-bin.jar file? I keep getting that "not sutible driver" error
> everyone keeps talking about.
> 
> Thx in advance.
> 
> -Steve
> 

Re: mySQL/JDBC/Tomcat4 documentation

Posted by DingHui <dh...@bisp.com>.
The following code demonstrate how to initilize MYSQL JDBC driver.

try {
   Class.forName("org.gjt.mm.mysql.Driver");
  } catch (ClassNotFoundException e) {
   System.out.println(e);
  }

  try {
   Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mydata", "username", "password");
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery("SELECT NAME FROM TEST");
      // Display the SQL Results
         while(rs.next()) {
          System.out.println(rs.getString("NAME"));
      }

      // Make sure our database resources are released
      rs.close();
      stmt.close();
      con.close();
   }catch (SQLException se) {
          // Inform user of any SQL errors
       System.out.println("SQL Exception: " + se.getMessage());
       se.printStackTrace(System.out);
   }
----- Original Message ----- 
From: "Steve Madonna" <st...@netune.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, February 27, 2002 8:38 AM
Subject: mySQL/JDBC/Tomcat4 documentation


> Anyone know were I can get some documentation on installing
> mm.mysql-2.0.4-bin.jar file? I keep getting that "not sutible driver" error
> everyone keeps talking about.
> 
> Thx in advance.
> 
> -Steve
>