Guest User

Untitled

a guest
Jan 28th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. package prode;
  2. import java.sql.*;
  3.  
  4. public class Conexion {
  5.  
  6. Connection con;
  7. Statement st;
  8.  
  9. public Conexion(){
  10. try{Class.forName("com.mysql.jdbc.Driver"); // en el debug llega a esta parte mostrando por class file editor la excepción; en ejecución no lanza errores, llega al catch mostrando conexión no establecida
  11. con = DriverManager.getConnection("jdbc:mysql://localhost/prodemios?user=root&password=");
  12.  
  13. }catch(ClassNotFoundException|SQLException e){
  14. System.out.println("conexion no establecida");
  15. }
  16. }
  17.  
  18. }
Add Comment
Please, Sign In to add comment