File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes how to mysql database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "how to mysql database?" Watch "how to mysql database?" New topic

how to mysql database?

Markandey Sahu

Joined: Jun 29, 2006
Posts: 13
Can any one give me code for connecting mysql database?
Wich driver we can use for connecting database.
pls give me complete code..
Connection con =DriverManage.getConnection("???","??","??");
what i have to write in place of ???
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
"jdbc:mysql://localhost:3306/test" , "test", "test"

the first localhost is your mysql database. Can be any ip number
3306 is the mysql port. Often 3306 used
the first test is the database name.
second test is the username to the database
third test is the password

// Mathias

Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Have you read the
[ December 27, 2006: Message edited by: Scott Johnson ]
I agree. Here's the link:
subject: how to mysql database?
It's not a secret anymore!