Guest User

Untitled

a guest
Jul 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. public class ConnectionFactory {
  6.  
  7. public Connection getConnection() {
  8.  
  9. String url = "jdbc:mysql://localhost:3306/Carro";
  10. try {
  11. return DriverManager.getConnection(url, "root", "root");
  12. } catch (SQLException e) {
  13. throw new RuntimeException(e);
  14. }
  15.  
  16.  
  17. }
  18.  
  19. }
Add Comment
Please, Sign In to add comment