Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. import java.io.*;
  4.  
  5. import oracle.jdbc.pool.OracleDataSource;
  6.  
  7. class DevOracleSucks {
  8. public static void main (String args []) throws SQLException, IOException {
  9.  
  10. // connect to the database
  11. OracleDataSource ods = new OracleDataSource();
  12. ods.setURL("jdbc:oracle:oci8:test_cvtech/cvtech@devoracle.toronto.terida.net");
  13.  
  14. System.out.flush();
  15.  
  16. Connection conn = ods.getConnection();
  17.  
  18. System.out.println("Connected.");
  19.  
  20. Statement stmt = conn.createStatement();
  21.  
  22. // Select some value
  23. ResultSet rset = stmt.executeQuery("SELECT * FROM USER_ACCOUNT");
  24.  
  25. while (rset.next()) {
  26. System.out.println(".");
  27. }
  28.  
  29. rset.close();
  30. stmt.close();
  31. conn.close();
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement