 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the MySQL JDBC driver connection string?
The MySQL JDBC connection string look like this −
 Class.forName("com.mysql.jdbc.Driver");  Above, Driver is an interface.
Whenever your JDBC is running outside an application server, then the class DriverManager establish the connection. The DriverManager class is as follows −
 conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/yourdatabaseName","yourRootName","yourPassword");  Now, I am applying the above connection string to connect Java to MySQL database. The code is as follows.

The following is the output that shows that MySQL connection with Java is successful.

Advertisements
 