Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC mysql connection error

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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});
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic