This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC with MYSQL  RSS feed

 
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.
 
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
Boost this thread!