Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection String

 
basha khan
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic