Link to home
Start Free TrialLog in
Avatar of quin
quin

asked on

JSP and MySQL how to get the two talking

I have a Tomcat install and MySQL installed, now I need to know how install MySQL driver. Where do I need to put the driver and what part of the fiel. I have the mysql-connector-java-3.0.6-stable-bin.jar driver
 My CLASSPATH is already set to
C:\jakarta-tomcat-4.1.18\common\lib\servlet.jar
How can I add on or how should I change it.

Thanx
Joa
Avatar of sfotex
sfotex

Just make sure the jar is in your class path...

Here is a simple program you can run to make sure you can get to the drivers...

import java.sql.*;

public class test { static public void main (String args[])
 {
   //Connection connection = null;

  try


  {
    //name  
   Class.forName("com.mysql.jdbc.Driver");
   System.out.println("Drivers loaded");
   
  }

 catch(Exception e)

  {
   System.out.println("Drivers not loaded");
   System.out.println(e);
  }
 }
}
Avatar of Mick Barry
Add the driver jar to:
C:\jakarta-tomcat-4.1.18\common\lib\
Avatar of quin

ASKER

Thanks thats what I was looking for

Joa
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks :)