Advertisement
Guest User

Untitled

a guest
Mar 11th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. try {
  8.  
  9. Class.forName("com.mysql.jdbc.Driver").newInstance();
  10. System.out.println("Sucess");
  11. Connection con = DriverManager.getConnection("jdbc:mysql://10.0.0.1/feedback","root","myrootpassword");
  12.  
  13. con.setReadOnly(true);
  14.  
  15.  
  16.  
  17. } catch (Exception e) {
  18.  
  19.  
  20. System.err.print("NO CONNECTION");
  21. }
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement