CODE
import java.sql.*;
class Database
{
public static void main(String args[])throws
Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:nitin");
Statement st=con.createStatement();
ResultSet res=st.executeQuery("select * from Student");
while(res.next())
{
System.out.println(res.getInt(1)+" "+res.getString(2)+" "+res.getString(3)+" "+res.getString(4));
}
}
}OUTPUT DISPLAY
0 comments:
Post a Comment