76 951
Assignments Done
Successfully Done
In June 2019

Answer to Question #23743 in Java | JSP | JSF for Sourabh Vishal

Question #23743
getting error as "com.mysl.jdbc.Driver" when trying to run a simple programe named as iit registration
Expert's answer
Firstly, to start working with MySQL database in Java youhave to download the JDBC driver (or howit is called MySQL connector). Install it.

Secondly, in your code you have to import some packagesfrom it:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

Then when trying to access to your database:
try {
Class.forName("com.mysql.jdbc.Driver"); //loading your JDBC driver Connection connect =
DriverManager.getConnection("jdbc:mysql:databasename”, “login”,
“password”); Statement statement = connect.createStatement(); // Result set get
the result of the SQL query ResultSet resultSet =
statement.executeQuery("select * from table_name"); } catch
(SQLException e) {

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions