Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: trouble con...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 11 Topic 3700 of 3850
Post > Topic >>

Re: trouble connecting to mysql

by naveen <naveen.cse217@[EMAIL PROTECTED] > Apr 7, 2008 at 02:28 AM

On Apr 7, 12:07=A0am, Arne Vajh=F8j <a...@[EMAIL PROTECTED]
> wrote:
> naveen wrote:
> > hello friends
> > i have just touched jsp programming and i m having trouble connecting
> > to mysql database.
> > I m using tomcat 6
>
> > the connection part of the code of my jsp (HelloMySql.jsp) is-->
> > String dbURL=3D"jdbc:mysql:localhost\\neo";
> > String username=3D"root";
> > String passwd=3D"abc";
> > try{
> > =A0 =A0Class.forName("com.mysql.jdbc.Driver");
> > =A0 =A0Connection
conn=3DDriverManager.getConnection(dbURL,username,pass=
wd);
> > i m using this driver -->
> > mysql-connector-java-5.1.6-bin.jar
> > and have put it in this location
> > C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib
>
> > further i have appended this to the Classpath environment variable -->
> > C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\mysql-
> > connector-java-5.1.6-bin.jar
>
> > but the sever returns error that
> > No suitable driver found
>
> Unless you want to use container managed connection pool you
> should put the jar file in your web apps WEB-INF/lib.
>

well i have put it the jar file there too.

> The connection URL looks wrong as well. It should be
> something like:
>
> "jdbc:mysql://localhost/neo"

well i thought that you have to provide the location of the database
in this place "jdbc:mysql://localhost/neo"
though i have tried putting database as //localhostneo also
 but this didnt work too

please suggest something
or if you could give me a working example it would be very kind of
you
thanks
 




 11 Posts in Topic:
trouble connecting to mysql
naveen <naveen.cse217@  2008-04-06 10:03:41 
Re: trouble connecting to mysql
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-06 15:07:58 
Re: trouble connecting to mysql
Lew <lew@[EMAIL PROTEC  2008-04-06 15:54:55 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-07 02:28:27 
Re: trouble connecting to mysql
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-07 21:40:57 
Re: trouble connecting to mysql
"joeNOSPAM@[EMAIL PR  2008-04-07 09:23:31 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-08 19:05:48 
Re: trouble connecting to mysql
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-08 22:24:21 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-09 06:02:49 
Re: trouble connecting to mysql
Lew <lew@[EMAIL PROTEC  2008-04-09 19:52:50 
Re: trouble connecting to mysql
naveen <naveen.cse217@  2008-04-10 11:56:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 3:38:04 CDT 2008.