I am sorry i am not familiar with Tomcat
My program is a Java Application, not a Servlet, and the code works well.
----- Original Message -----
From: "Steve Madonna" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
Sent: Thursday, February 28, 2002 6:03 AM
Subject: RE: mySQL/JDBC/Tomcat4 documentation
> Right at line 2 in your code is were we are having trouble. Apparenlty our
> code is written the same way, but it still doesn't seem like the JDBC driver
> has loaded:
>
> java.sql.SQLException: org.gjt.mm.mysql.Driver
>
> The driver is in the WEB-INF/lib/ directory.
>
> Is there a config file that needs to allow permissions for this?
>
> -----Original Message-----
> From: DingHui [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 26, 2002 6:34 PM
> To: Tomcat Users List
> Subject: Re: mySQL/JDBC/Tomcat4 documentation
>
>
> 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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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
> >
>