Guest User

Untitled

a guest
Feb 14th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Connection con =null;
  2.  
  3. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  4.  
  5. String connectionURL="jdbc:sqlserver://localhost:1433;databaseName=guBanco;user=Honorato;password=1234";
  6.  
  7. try{
  8.  
  9. con=DriverManager.getConnection(connectionURL);
  10. System.out.println("Connection is successfull");
  11.  
  12. }
  13.  
  14. catch(SQLException e){
  15.  
  16. System.out.println(e);
  17.  
  18. }
  19. return con;
  20. }
  21.  
  22. // TODO code application logic here
  23.  
  24. connect();
  25.  
  26.  
  27. }
Add Comment
Please, Sign In to add comment