M
Marcus Krieger
I am using JBuilder and I would like to connect to a mysql database.
I was able to connect to a oracle database, however it does not work with
mysql!
I downloaded the newest drivers from the mysql webseite and put them into my
java/bin directory.
As I don't know exactly which java folder Jbuilder is using I have put them
in both folder - my java folder and the java folder in jbuilder.
Additionally, I tried to import the file from Jbuilder, and put them into
"Project", "User Home" and "Jbuilder".
Whatever that exactly does, with oracle it had worked.
Using mysql, I get the following error message:
driver:com.mysql.jdbc.Driver url:jdbc:mysql:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.sql.SQLException: No suitable driver
java.sql.SQLException: No suitable driver
That's my code:
[..]
jdbc_driver="com.mysql.jdbc.Driver";
db_login = "root";
db_password = "";
db_url = "jdbc:mysql://localhost:3306/dbname";
try
{
Class.forName(jdbc_driver);
}
[..]
DriverManager.getConnection(db_url, db_login, db_password);
Any ideas, what I am doing wrong here?
Thanks,
Marcus
I was able to connect to a oracle database, however it does not work with
mysql!
I downloaded the newest drivers from the mysql webseite and put them into my
java/bin directory.
As I don't know exactly which java folder Jbuilder is using I have put them
in both folder - my java folder and the java folder in jbuilder.
Additionally, I tried to import the file from Jbuilder, and put them into
"Project", "User Home" and "Jbuilder".
Whatever that exactly does, with oracle it had worked.
Using mysql, I get the following error message:
driver:com.mysql.jdbc.Driver url:jdbc:mysql:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.sql.SQLException: No suitable driver
java.sql.SQLException: No suitable driver
That's my code:
[..]
jdbc_driver="com.mysql.jdbc.Driver";
db_login = "root";
db_password = "";
db_url = "jdbc:mysql://localhost:3306/dbname";
try
{
Class.forName(jdbc_driver);
}
[..]
DriverManager.getConnection(db_url, db_login, db_password);
Any ideas, what I am doing wrong here?
Thanks,
Marcus