LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-04-2006, 07:41 PM   #1
jun_tuko
Member
 
Registered: Oct 2005
Location: Seattle, WA
Distribution: Fedora Core 4
Posts: 67

Rep: Reputation: 15
JSP and MySQL - unable to load JDBC driver


hello gurus,
need your help once again. i am trying to program using jsp to do simple data insertion and extraction to and from mysql database. i have some .jsp files that works at my school but when i transferred them here at my home linux box, it's giving:

Unable to load MySQL JDBC driver.
SQLException: No suitable driver SQLState: 08001 VendorError: 0


here's what i have done:
1) previously installed apache, mysql, and php. my linux distro is fedora core 4. i know mysql works because i have programs written in php to write and read data to and from mysql.
2) i just installed tomcat. it shows my html files that i put in its webapss folder so i know tomcat works.
3) i have java sdk installed. i know it works too because i can run java programs.
4) when doing research, i read somewhere that i need to copy jdbc driver on to my tomcat_folder/server/lib. i have copied two (2) drivers there. a)mm.mysql-2.0.8-bin.jar from my books cd. b) mysql-connector-java-3.1.13-bin.jar from mysql's website (j connector).

in my jsp program, here are the lines i got from my school versus and my edited version. both of them does not work on my linux machine.

School (works at school but not at home):
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conn = DriverManager.getConnection ( "jdbc:mysql://repost.insttech.wa.edu/jtuko", "jtuko", "password" );

Edited:
Class.forName("com.mysql.jdbc.Driver").newInstance();
**or the from school**
Connection conn = DriverManager.getConnection ( "jdbc:mysql://localhost/jtuko", "jtuko", "password" );

im am not sure what the url is supposed to be in connection line. my understanding is jdbc:mysql:// should be followed by nameofserver/nameofdatabase then username and password.

please help.
thanks.
jun
 
Old 09-04-2006, 11:11 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Two suggestions:

1. Try copying the two jar files to your common/lib directory (and *definitely* reboot Tomcat!)

2. Try looking in your tomcat /log directory: it might give you some better clues as to the exact problem.

'Hope that helps .. PSM
 
Old 09-05-2006, 12:02 PM   #3
jun_tuko
Member
 
Registered: Oct 2005
Location: Seattle, WA
Distribution: Fedora Core 4
Posts: 67

Original Poster
Rep: Reputation: 15
hi paul,
thank you!!!!! i copied the 2 drivers to /tomcat/common/lib folder and it works!!!! also, i tried using:

Class.forName("org.gjt.mm.mysql.Driver").newInstance();

and

Class.forName("com.mysql.jdbc.Driver").newInstance();

and both of them work as well. so thank you for the suggestions.

have a great day!

jun
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Unable to load wacom driver module after compiling for a 2.6.14.4 kernel dr_zayus69 Linux - Kernel 1 06-28-2006 10:38 AM
Unable to load i915 driver using FC4 on an Inspiron 6000 Sedmic Linux - Laptop and Netbook 1 01-06-2006 09:26 PM
KDE unable to load after driver-installation primetime2 Linux - General 3 12-19-2004 04:55 AM
JDBC and MySQL Driver White R4bbit Debian 2 08-13-2004 05:55 PM
MySQL and JDBC oulevon Programming 1 07-16-2001 07:18 PM


All times are GMT -5. The time now is 03:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration