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 5 of 11 Topic 3700 of 3800
Post > Topic >>

Re: trouble connecting to mysql

by =?ISO-8859-1?Q?Arne_Vajh=F8j?= <arne@[EMAIL PROTECTED] > Apr 7, 2008 at 09:40 PM

naveen wrote:
> On Apr 7, 12:07 am, Arne Vajhøj <a...@[EMAIL PROTECTED]
> wrote:
>> 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.

Not too. Only there.

You should not put jar files all over the system.

>> 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"

No. You connect to localhost (on ****t 3306) and select database
neo. The MySQL servers knows where it is actually stored.

> though i have tried putting database as //localhostneo also
>  but this didnt work too

Unless you have a host called localhostneo then it will not work.

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

<%
Class.forName("com.mysql.jdbc.Driver");
Connection con = 
DriverManager.getConnection("jdbc:mysql://localhost/Test", "", "");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM T1");
....

works for me.

Arne
 




 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 Fri Jul 25 23:17:33 CDT 2008.