Home » Open Source » MySQL » How to connect mySQL by using JDBC?
How to connect mySQL by using JDBC? [message #91639] Sat, 21 December 2002 22:49 Go to next message
stupid student
Messages: 1
Registered: December 2002
Junior Member
Hi,
i cannot connect to the database(mysql) by using JDBC.

I hava set the classpath as
/usr/local/jakarta-tomcat-4.1.12/common/lib/mysql-connector-java-2.0.14

Inside my java program i wrote these statement to
make a connection to the database:

import java.sql.*;
public class CreateTable{
public static void main (String args[[]]) {
Connection con=null;
try{

Class.forName("org.git.mm.mysql.Driver").newInstance();
System.out.println("JDBC driver loaded");
con=DriverManager.getConnection("jdbc:mysql://localhost/test");
......

It give me a CreateTable.class after compile
But it cannot create any table on the database.

Is my setting wrong?
How can i connect to the database properly?
Thank you very much.
Re: How to connect mySQL by using JDBC? [message #91777 is a reply to message #91639] Wed, 12 February 2003 08:53 Go to previous messageGo to next message
Munawar al kabir
Messages: 1
Registered: February 2003
Junior Member
Hi ,
How is doing .....did you receive any correct reply for that please? If yes , could you please send me that information?
I'm also working on "How to connect the MySQL using JAVA"

thanking you

Munawar
Re: How to connect mySQL by using JDBC? [message #92047 is a reply to message #91639] Wed, 18 February 2004 02:34 Go to previous message
slh
Messages: 1
Registered: February 2004
Junior Member
is org.gjt.mm.mysql.Driver
not org.git.mm.mysql.Driver
Previous Topic: Oracle & MySql
Next Topic: oracle to mysql conversion and vice versa
Goto Forum:
  


Current Time: Thu Oct 30 10:57:41 CDT 2014

Total time taken to generate the page: 0.07352 seconds