Connecting Tech Pros Worldwide Forums | Help | Site Map

problem while installing mysql/connector j dirver

Member
 
Join Date: Mar 2007
Posts: 40
#1: Jul 25 '08
i want to access mysql database server from jsp program

for this i downloaded mysql-connector-java-3.1.14.zip

mysql-connector-java-3.1.14 folder contains mysql-connector-java-3.1.14-bin.jar
file.

then the mysql-connector-java-3.1.14-bin.jar is placed in classpath

after that,i started tomcat server and executed the jsp program

but i am gettting the following error
rootcause: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

if any one know how to access mysql database server using
mysql-connector-java-3.1.14 driver,please explain me....

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,752
#2: Jul 26 '08

re: problem while installing mysql/connector j dirver


Hi.

I've moved this over the Java forum, seeing how this is more of a Java problem.
Needs Regular Fix
 
Join Date: Nov 2007
Location: Cebu City, Philippines
Posts: 510
#3: Jul 27 '08

re: problem while installing mysql/connector j dirver


Actually(for me), the jarred mysql essential was designed for ready-to-use stand-alone apps, but you can change the settings inside the manifest file....

Before doing this, please have a back-up copy of the mysql library(jar file)

Remove the INDEX.LIST

in the MANIFEST.MF
Change the Name: common into Name: com/mysql/jdbc/Driver.class

Add the following below the Name:

Java-Bean: true

Please put a new line after the last visible character on MANIFEST.MF
a must newline... ( I don't know why, maybe because their parser needs it)

and save it again, i prefer to use WinRAR for this.....

and put the modified jar file into WEB_INF


OR

extract the jar file, copy and save the com folder to WEB_INF/classes directory.

PLEASE don't forget to RESTART the tomcat server after doing this....

Hope that helps
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#4: Jul 27 '08

re: problem while installing mysql/connector j dirver


Quote:

Originally Posted by sukatoa

Actually(for me), the jarred mysql essential was designed for ready-to-use stand-alone apps, but you can change the settings inside the manifest file....

[ and there he goes: ripping out valuable organs from the manifest, amputating
essential information, destroying the precious jar; blood is all over the place ... ]

Hope that helps

No it does not; stay away from that .jar file; it is correct as it is. Please first
read that link I supplied on the classpath before you start operating on that
poor .jar file.

kind regards,

Jos ;-)
Needs Regular Fix
 
Join Date: Nov 2007
Location: Cebu City, Philippines
Posts: 510
#5: Jul 27 '08

re: problem while installing mysql/connector j dirver


Quote:

Originally Posted by JosAH

No it does not; stay away from that .jar file; it is correct as it is. Please first
read that link I supplied on the classpath before you start operating on that
poor .jar file.

kind regards,

Jos ;-)

My reply happens before i realized...... If i can only remove my 1st reply here, i will....
i feel guilt with what ive done here.... :(

But that is the only way i know before i got the real/proper and exact answer

regards,
sukatoa :)
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#6: Jul 27 '08

re: problem while installing mysql/connector j dirver


Quote:

Originally Posted by sukatoa

My reply happens before i realized...... If i can only remove my 1st reply here, i will....
i feel guilt with what ive done here.... :(

But that is the only way i know before i got the real/proper and exact answer

regards,
sukatoa :)

Ok, because you're so sorry I'll cancel the defenestration festivities ;-)

kind regards,

Jos
Member
 
Join Date: Mar 2007
Posts: 40
#7: Jul 28 '08

re: problem while installing mysql/connector j dirver


after placing the mysql-connector-java-3.1.14-bin.jar file in
tomcat/webapps/root/web-inf/classes

my problem is solved i.e.,the program written in jsp is executed

thanks
Reply