Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public static void main(String[]args) throws SQLException, ClassNotFoundException{
  2. try {
  3. Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
  4. }
  5. catch (ClassNotFoundException e) {
  6. System.out.println("Please include Classpath Where your DB2 Driver is located");
  7. e.printStackTrace();
  8. return;
  9. }
  10. System.out.println("DB2 driver is loaded successfully");
  11. Connection conn = null;
  12. PreparedStatement pstmt = null;
  13. ResultSet rset=null;
  14. boolean found=false;
  15. conn = DriverManager.getConnection("jdbc:db2:hostname/dbname", "uid" , "pwd");
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement