Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC mysql connection error

 
michael wilson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,
I am having terrible errors. I have the mm.blah.blah driver installed/configured correctly. My db seems to be working correctly. When i execute a testJdbcConnection, I receive the following error:
java.sql.SQLException: General Error: 79
at org.gjt.mm.mysql.Connection.<init>(Connection.java)
at org.gjt.mm.mysql.Driver.connect(Driver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at JdbcTest.main(JdbcTest.java:53)

and am becoming quite frustrated. The server is running with the right root password. when I do a ps -A |grep mysqld, the server shows up as running. Please advise. Thanks.
\mw
**********************************
And here is the connection code segment used. I have all of the imports for the mm.blah and java.mysql.

Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String urlPath ="jdbc:mysql://localhost:3306/mysql";
Connection conn = (Connection) DriverManager.getConnection(strUrl,"user","passwd");
That's it. I cast the DriverManager.getConnection as a Connection as the mm.blah Connection is not the same as the java.mysql.Connection...atleast according to my compiler.
Thanks again in advance.
[This message has been edited by michael wilson (edited June 06, 2001).]
 
kichu kichu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai michael,
can u please post the code that u have written for database connectivity(in java i presume).
regards,
kichu.
 
Samuel Chan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for mm mysql driver, you need to change your url to
Conn = DriverManager.getConnection(
jdbc:mysql://{URL}/{DBname}?user={loginID}&password={password});
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a support list for java programmers who use mysql. You can get on this list if you mail
java-subscribe@lists.mysql.com
frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic