This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connecting java(j2se) and mysql" Watch "connecting java(j2se) and mysql" New topic
Author

connecting java(j2se) and mysql

Anand Divakaran
Greenhorn

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
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
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: 1321

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

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


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

Joined: Oct 13, 2005
Posts: 38075
    
  22
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: http://aspose.com/file-tools
 
subject: connecting java(j2se) and mysql
 
Similar Threads
Mysql and connection refused
Problem in Java Connection with MySQL in Linux Mandriva.
"Function sequence error!" what is it mean
MySQL & JDBC
Prepared Statement problem in my servlet's data manager