aspose file tools*
The moose likes JDBC 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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to mysql database?" Watch "how to mysql database?" New topic
Author

how to mysql database?

Markandey Sahu
Greenhorn

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..
Class.forName("???");
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


SCJP1.4
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Have you read the
manual?
[ December 27, 2006: Message edited by: Scott Johnson ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to mysql database?