Guest User

Untitled

a guest
Nov 7th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import java.sql.*;
  2. public class Sample
  3. {
  4. public static void main(String args[])
  5. {
  6. try
  7. {
  8. //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  9. String url="jdbc:odbc:db1";
  10. Connection con=DriverManager.getConnection("jdbc:odbc:pro");
  11. Statement st=con.createStatement();
  12. ResultSet rs=st.executeQuery("select idno from regs");
  13. int s=rs.getInt("1");
  14. System.out.println(s+ " ");
  15. con.close();
  16. }
  17. catch(Exception e)
  18. {
  19. System.out.println(" "+e);
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment