Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class ConnectionFactory {
- public Connection getConnection() {
- String url = "jdbc:mysql://localhost:3306/Carro";
- try {
- return DriverManager.getConnection(url, "root", "root");
- } catch (SQLException e) {
- throw new RuntimeException(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment