Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3.  
  4. public class ConnectDb {
  5. public static void main(String []args) {
  6. Connection conn;
  7. try {
  8. conn = DriverManager.getConnection("jdbc:sqlserver://153.19.7.13:1401;databaseName=pkazmierczak;user=pkazmierczak;password=253977");
  9. Statement stmt = conn.createStatement();
  10.  
  11. ResultSet resultSet = stmt.executeQuery("drop table adres;");
  12. while (resultSet.next()) {
  13. System.out.println(resultSet.getString(2));
  14. }
  15. stmt.close();
  16. resultSet.close();
  17. conn.close();
  18. } catch (SQLException err) {
  19. System.out.println(err);
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement