Dear All
I don't think that this message has been asked before but if it has my apologies.
I have a linux machine set up with MySQL, and I would like to connec to the database using Java
I have already connected to the database using the [mysql-connector-java-3.0.9-stable-bin.jar] but I would like to connect using ODBC.
I tested that mysql was running
I have modified the ini files
odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver =/usr/libg/libmyodbc.so
FileUsage =1
odbc.ini
[Mic]
Description =MySQL database test
Driver =MySQL
Server =localhost
Database =test
Port =3306
I then tested using :-
isql Mic
and it was OK.
but when I tried to run a java program to test the connection, It failed on the line
Connection con = DriverManager.getConnection("jdbc
dbc:Mic");
throwing a NullPointerException.
I found a similar question to the one that I am asking in the MySQL mailing list
(Nov 28 2002)
but the answer was using a different connection.
Any suggestions ?
#
###
#####
#######
Ziggurat
I don't think that this message has been asked before but if it has my apologies.
I have a linux machine set up with MySQL, and I would like to connec to the database using Java
I have already connected to the database using the [mysql-connector-java-3.0.9-stable-bin.jar] but I would like to connect using ODBC.
I tested that mysql was running
I have modified the ini files
odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver =/usr/libg/libmyodbc.so
FileUsage =1
odbc.ini
[Mic]
Description =MySQL database test
Driver =MySQL
Server =localhost
Database =test
Port =3306
I then tested using :-
isql Mic
and it was OK.
but when I tried to run a java program to test the connection, It failed on the line
Connection con = DriverManager.getConnection("jdbc
throwing a NullPointerException.
I found a similar question to the one that I am asking in the MySQL mailing list
(Nov 28 2002)
but the answer was using a different connection.
Any suggestions ?
#
###
#####
#######
Ziggurat