This week's book giveaway is in the Other Open Source APIs forum.
We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line!
See this thread for details.
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 Storm Applied this week in the Other Open Source APIs 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 ]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: how to mysql database?