getting error as "com.mysl.jdbc.Driver" when trying to run a simple programe named as iit registration
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) {
throwe;
}
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!
Learn more about our help with Assignments:
JavaJSPJSF