File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes connecting java(j2se) and mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "connecting java(j2se) and mysql" Watch "connecting java(j2se) and mysql" New topic

connecting java(j2se) and mysql

Anand Divakaran

Joined: Jul 20, 2007
Posts: 6
Hi all,
I'm trying to connect my java application with mysql running on the same machine. I'm also using Connector/j driver.
However its throwing an SQLException i.e the quoted statement seems to be an error

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46424
I presume you have checked in the MySQL documentation? Most of it looks all right just at a quick glance.

Do you need the port number 3036? Try omitting that. If that doesn't work, please post the stack trace.
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1323

3306 is the default mysql port.
try with this port.

or in case of any error please post the stack trace as Campbell suggested.

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46424
Originally posted by Muhammad Saifuddin:
3306 is the default mysql port.
If that's the problem, it goes to show what a tiny error can mess up the whole application.
[ July 18, 2008: Message edited by: Campbell Ritchie ]
I agree. Here's the link:
subject: connecting java(j2se) and mysql
It's not a secret anymore!