Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- /**
- *
- * @author miguelaburto
- */
- public class conectar {
- Connection conectar=null;
- public Connection conexion(){
- try {
- Class.forName("com.mysql.jdbc.Driver");
- conectar=DriverManager.getConnection("jdbc:mysql://localhost/nombre_bbdd?user=root&password=");
- } catch (Exception e) {
- System.out.print(e.getMessage());
- }
- return conectar;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement