Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I connect to mysql database using jdbc?

Connect database JDBC MySQL
0
Posted

How can I connect to mysql database using jdbc?

0

Location: http://www.jguru.com/faq/view.jsp?EID=444472 Created: Jun 24, 2001 Modified: 2001-06-30 20:04:35.74 Author: Luigi Viggiano (http://www.jguru.com/guru/viewbio.jsp?EID=101985) Question originally posed by vikrant charde (http://www.jguru.com/guru/viewbio.jsp?EID=433268 Use something like: // loads the JDBC driver Class.forName(“org.gjt.mm.mysql.Driver”).newInstance(); // get a database connection Connection conn = DriverManager.getConnection( “jdbc:mysql://hostname/databaseName”, “user”, “password”); obviously the JDBC driver “org.gjt.mm.mysql.Driver” must be in classpath. You can download it from here.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123