Guest User

Untitled

a guest
Nov 26th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. public class Conexion {
  6.  
  7. private final static String user = "root";
  8. private final static String password = "";
  9. static Connection connection = null;
  10.  
  11. public static Connection getConexion(String value) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {
  12.  
  13. Class.forName("com.mysql.jdbc.Driver");
  14. connection = DriverManager.getConnection("jdbc:mysql://localhost/agenciabus", user, password);
  15.  
  16. return connection;
  17. }
  18. }
Add Comment
Please, Sign In to add comment