GeeCON Prague 2014*
The moose likes JDBC and the fly likes Connection String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection String" Watch "Connection String" New topic
Author

Connection String

basha khan
Ranch Hand

Joined: Jan 26, 2002
Posts: 516
How to make a connection String?.
I m having mysql-4.1.1-alpha as database server.
My username to connect the database is "root" and there is no password.
I m having com.mysql.jdbc.Driver as database driver to connect to database in my classpath and i m using that driver.
I m having a database named "mydatabase".
I wanna use a connection String to connect to that database.i does'nt wanna create a datasource name etc.else i need a connection String to connect to the database.
How to create a connection String?.Or what will be my connection String?.i hav provided all data above to create one.
thanks in advance.
---
basha
basha khan
Ranch Hand

Joined: Jan 26, 2002
Posts: 516
I hav used
jdbc:mysql://localhost:3306/mydatabase?user=root&password=&autoReconnect=true
as connection String.but error occuring as "server connection failed during transaction".
I m using Tomcat4.1 as webserver.
anyone experienced it?.or knowing how to solve?.
---
basha
Lu Battist
Ranch Hand

Joined: Feb 17, 2003
Posts: 104
Make sure your mysql database is up and running first of all, and that you can connect to it with the command-line tools mysql gives you.
Also, make sure your don't have a firewall that is blocking whichever port it is using.
If that still doesn't work, show us your connection code.
basha khan
Ranch Hand

Joined: Jan 26, 2002
Posts: 516
Originally posted by Lu Battist:
Make sure your mysql database is up and running first of all, and that you can connect to it with the command-line tools mysql gives you.
Also, make sure your don't have a firewall that is blocking whichever port it is using.
If that still doesn't work, show us your connection code.

mysql is working.firewall havin permission to mysql port.that was'nt the prob.
if i use mysql 3.1 as db server,it's working.and with mysql-4.1.1-alpha,its's making probs..
something very strange!.
---
basha
 
GeeCON Prague 2014
 
subject: Connection String