Advertisement
Guest User

Untitled

a guest
May 7th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class Main {
  4.  
  5. public ResultSet executeQuery(String Query){
  6. ResultSet rs;
  7. try {
  8. rs = Main().executeQuery(Query);
  9. return rs;
  10. } catch (SQLException e1) {
  11. e1.printStackTrace();
  12. }
  13. return (null);
  14. }
  15.  
  16. public static void main(String[] args) {
  17. try{
  18.  
  19. Class.forName("oracle.jdbc.driver.OracleDriver");
  20. Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
  21. Statement stmt=con.createStatement();
  22.  
  23. con.close();
  24.  
  25. }catch(Exception e){ System.out.println(e);}
  26.  
  27. }
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement