but it give exception:java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

what sholud i do..??

04-08-2010, 08:20 PM

PhQ

You need a MySQL library.

04-08-2010, 08:21 PM

Tolls

First off don't do this sort of thing in a JSP...that's what servlets and database layers are for. JSP are for displaying things.

Second, learn SQL...that select and then looping through the resultset offends the eye...;)

And finally, that error means you haven't got the drivers jar file in the classpath of wherever it is you're running this.

04-09-2010, 02:05 PM

pranjul137

thanks for your reply......but in myeclipse if i execute the code in simple java file then connection to mysql is establish then why not with jsp??

04-09-2010, 02:08 PM

pranjul137

i am also using Mysql-connector-java version 5.0.7

04-09-2010, 02:12 PM

Tolls

Myeclipse knows where the jar file is, since it used it to build the code, so running straight java is a doddle for it.

When you're running the JSP it will use a server (Tomcat maybe?) to run it, deploying your app to that server...if it fails to deploy (for whatever reason) the jar file then you get that exception.

04-10-2010, 12:34 PM

pranjul137

ok...then how can i deploy the jar file in myeclipse....i used
Project's context-menu select Properties > Java Build Path >Libraries the add mysql-connector-java-5.1.6.jar

04-10-2010, 12:46 PM

pranjul137

i just want to run a web application on myeclipse and connect to mysql database...please resolve my problem..

04-12-2010, 09:47 AM

Tolls

I would suggest looking through the documentation.
You want to deploy the jar when the web app is deployed...having it in the build path is no use to the JSP, which is translated into a java class and then compiled on the server, not in your IDE.

So dig out the docs.

02-02-2014, 05:29 PM

atulkushwaha

Re: connection my mysql in jsp in myeclipse

ok pranjul. have you copied jdbc.jar file in your eclipse library?? if not then copy this file.

02-02-2014, 06:53 PM

superhaNds

Re: connection my mysql in jsp in myeclipse

Quote:

Originally Posted by atulkushwaha

ok pranjul. have you copied jdbc.jar file in your eclipse library?? if not then copy this file.

OK, I understand that you were probably a necromancer in Skyrim, but stick with it only in the game.

02-03-2014, 10:23 AM

gimbal2

Re: connection my mysql in jsp in myeclipse

lol, took me a while to understand that one :) Being a long time player of the game myself I was reasoning from the perspective of necromancers being the most useless character to play in the game rather than just assuming thread necro :)