Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Sample
- {
- public static void main(String args[])
- {
- try
- {
- //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- String url="jdbc:odbc:db1";
- Connection con=DriverManager.getConnection("jdbc:odbc:pro");
- Statement st=con.createStatement();
- ResultSet rs=st.executeQuery("select idno from regs");
- int s=rs.getInt("1");
- System.out.println(s+ " ");
- con.close();
- }
- catch(Exception e)
- {
- System.out.println(" "+e);
- }
- }
- }
Add Comment
Please, Sign In to add comment