LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-02-2007, 04:16 PM   #1
mrj
Member
 
Registered: Jun 2007
Location: Orange County, California
Distribution: debian
Posts: 41

Rep: Reputation: 15
java and mysql connection difficulties


In SUSE linux I'm trying to establish a connection with MySQL within a java program. First, I tried to get the following code running: public class test { public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); System.out.println("Good to go"); } catch (Exception E) { System.out.println("JDBC Driver error"); } } } When I ran this it just gave me the JDBC Driver error. I tried more detailed code and when I print out the SQLException E.getMessage I just get: No suitable driver I've tried different combinations of things include setting the $CLASSPATH variable to point to the connector, but it says NO SUCH FILE OR DIRECTORY when I do (even though I see the file in the directory ). If anyone has been able to do this in Suse I would appreciate any tips. Thanks.

Last edited by mrj; 07-02-2007 at 04:18 PM.
 
Old 07-04-2007, 02:24 AM   #2
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
Have you used ConnectorJ, if not just get it from
http://www.mysql.com/products/connector/j/

You will get to know about ConnectorJ from this site only. Its basically a JDBC driver

Last edited by hiren_bhatt; 07-04-2007 at 02:25 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java + connection to mysql linux_ub Programming 5 03-04-2012 10:59 AM
Mysql and mysql java connector, connection refused arubin Slackware 3 03-29-2008 01:41 AM
Using Same MySQL Connection for 2 Java Appls MRMadhav Programming 4 09-11-2007 07:42 PM
Java difficulties (setting up a java work box) toaster.waffle Programming 3 03-10-2006 07:54 AM
MySQL/Java connection problem hudy Programming 3 06-23-2004 08:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration