when I connect the jdbcodbc independently then its doing the business but when doing in swings it is giving driver not found though the DSN is Same
the code:
import java.sql.*;
class ot {
public static void main(String[] args)
{
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(Exception ClassNotFoundException)
{
System.out.println("Class Not Found Exception");
}
System.out.println("Trying to connect...");
try
{
Connection conn=DriverManager.getConnection("jdbc
dbc:test","","");/test the dsn
Statement stmt=conn.createStatement();
ResultSet result;
System.out.println("Connected.");
String sql1 = "insert into empr(emp,add,zip) values ("+ 5 +","+ 7 +","+ 9 +")";
stmt.executeUpdate(sql1);
conn.close();
}
catch(SQLException sq)
{
System.out.println("SQL exception: " + sq.getMessage());
}
}
}
can anyone help me