Advertisement
Guest User

Untitled

a guest
Aug 29th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public class test {
  2. public static void main (String [] args) {
  3.  
  4. String dbURL = "jdbc:sqlserver://localhost;databaseName=btcuoi;user=sa;password=1234";
  5. Connection conn = null;
  6. try {
  7. conn = DriverManager.getConnection(dbURL);
  8. } catch (SQLException ex) {
  9. Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
  10. }
  11. if (conn != null) {
  12. System.out.println("Connected");
  13. }
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement