how to over come SQL Exception
Hi friends,
I am working in java with linux platform, I would like to connect the java application with mysql (database).
mycode is
import java.sql.*;
publicclass samplejdbc
{
publicstaticvoid main(String args[])
{
try{
Statement stmt;
ResultSet rs;
//Register the JDBC driver for MySQL.
Class.forName("com.mysql.jdbc.Driver").newInstance();
//Define URL of database server for database named mcadb
String url="jdbc:mysql:l10n";
//Get a connection to the database for a user named auser with the password
Connection con =DriverManager.getConnection(url,"mecse102","sample");
//Display URL and connection information
System.out.println("URL: " + url);
System.out.println("Connection: " + con);
//Get a Statement object
stmt = con.createStatement();
rs=stmt.executeQuery("select * from temp");
while(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getString(2));
}
rs.close();
}
catch(Exception e)
{
System.out.println("Error "+e);
}
}//end main
}//end class samplejdbc
The output isError java .sql.SQLException:No suitable driver.
How can I over come this.
Thanks in advance
ARP with reg.

