Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC with MYSQL

 
Patrick Mugabe
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers!
How do you load a driver when using MySQL as your database.
 
marko stone
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i do it like this
Class.forName("org.gjt.mm.mysql.Driver");
if (myCon==null)
{
myCon=DriverManager.getConnection("jdbc:mysql://database","username","password");
mySta=myCon.createStatement();
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic