mysql server is already installed in linux and driver also.i want to connect my java(core) application with mysql server in linux.but i have ClassNotFoundExcepition in my programe,why plz tell me with solution.my coding is:
import java.sql.* ;
public class exam
{
public static void main( String[] args )
{
try
{
Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
try
{
Connection con = DriverManager.getConnection( "jdbc:mysql://localhost/scholar", "root", null );
try
{
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery("SELECT NAME FROM STUDENT");
while ( rs.next() )
{
System.out.println( rs.getString( "NAME" ) );
}
rs.close();
statement.close();
}
catch (
2007-02-16
22:56:21
·
2 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design