Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public final static Connection ConexionMysql()
  2. {
  3. String user = "root";
  4. String password = "sql-pto";
  5. Connection conn = null;
  6. try {
  7. Class.forName("com.mysql.jdbc.Driver");
  8. conn=DriverManager.getConnection("jdbc:mysql://localhost/dsad","root","toor");
  9. System.out.println("conexion establecida");
  10. } catch (SQLException ex) {
  11. } catch (ClassNotFoundException ex) {
  12. Logger.getLogger(MySQL.class.getName()).log(Level.SEVERE, null, ex);
  13. }
  14. return conn;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement