This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Problem with connecting a java application from with netbeans to a database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with connecting a java application from with netbeans to a database" Watch "Problem with connecting a java application from with netbeans to a database" New topic
Author

Problem with connecting a java application from with netbeans to a database

Olakunle Oladipo Oni
Greenhorn

Joined: Aug 28, 2008
Posts: 18
A beautiful day to someone out there. Please i'll appreciate someone to give an assistance on how i'm to resolve a problem involving connecting a desktop java application to a database. I had no problem connecting from the application
when it's loaded using the java command line utility. I was able to carry out the necessary processes like insert, delete, update and retrieve from the desktop java application if i loaded using the command line. I transferred the application to my netbeans editor, ran it and it loaded successfully as well. But i sense a logic error somewhere because when i tried inserting data using the destop java application form i kept recieving the message 'No suitable Driver found'. I checked the 'services' window in netbeans, i discovered that a mysql connector/J driver is already bundled with the IDE (Precisely in C:\Program Files\NetBeans 6.5\ide10\modules\ext\mysql-connector-java-5.1.6-bin.jar) because i saw it the drivers node i believe it is added and registered with the IDE already. The version of the connector/J driver i used previously that the program was assessing successfully is mysql-connector-java-5.1.19-bin.jar and i had it in drive C. I had the classpath system variable path for the driver (BOTH THAT FOR THE NETBEANS INSTALLATION PATH and that of the version i used successfully earlier) in place. I kept having the same response of not seeing the suitable driver from within the netbeans IDE. I'LL appreciate if someone can help to point out where the problem is and how to resolve it.

Olakunle Oni
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37907
    
  22
Sounds like a classpath problem.
What is the classpath you use for the command line version of your app, and which connector does it find?
What is the classpath which NetBeans is using?
 
 
subject: Problem with connecting a java application from with netbeans to a database
 
Similar Threads
classpath JDBC driver
JDBC Driver connection
JDBC drivers/getting JDBC started
How Tomcat Works: connection pooling in tomcat
upgrade from mysql3.23 to mysql4.1 charset problem