Advertisement
Guest User

Untitled

a guest
May 9th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. package awsdeghjkl;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6. import java.sql.Statement;
  7.  
  8. public class testest {
  9.  
  10. public static void main(String[] args) {
  11. Connection conn;
  12. //Create the connection
  13. try {
  14. Class.forName("com.mysql.jdbc.Driver"); // MySQL database connection
  15. conn = DriverManager.getConnection("jdbc:mysql://178.62.22.192:3360/HollowSystems","root","SadBoys132");
  16. String query ="Select * from User";
  17. Statement st = conn.createStatement();
  18. Object rs = st.executeQuery(query);
  19. } catch (ClassNotFoundException e) {
  20. e.printStackTrace();
  21. } catch (SQLException e) {
  22. e.printStackTrace();
  23. }
  24.  
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement