Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

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
0
quin
Asked:
quin
  • 3
1 Solution
 
sfotexCommented:
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);
  }
 }
}
0
 
objectsCommented:
Add the driver jar to:
C:\jakarta-tomcat-4.1.18\common\lib\
0
 
quinAuthor Commented:
Thanks thats what I was looking for

Joa
0
 
objectsCommented:
Good to hear, let me know if you have any problems with it.
If not, then please close the q so it can be PAQ'ed.
0
 
objectsCommented:
Thanks :)
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now