class Testdb
{
public static void main(String ...arg)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c =DriverManager.getConnection("jdbcdbc:jatindsn","system","pwd");
System.out.println("Connection ok.");
//String t1 = "raam";
//int t2 = 10;
Statement s = c.createStatement();
ResultSet result1 = s.executeQuery("select * from Tsable1");
while(result1.next())
{
System.out.println("name" + result1.getString(1));
System.out.println("id" + result1.getString(2));
System.out.println("roll num"+result1.getString(3));
}
}
catch(SQLException e)
{
System.out.println(e);
}
catch(Exception i)
{
System.out.println(i);
}
}
}