Advertisement
Guest User

Untitled

a guest
Mar 30th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package pe.libreriavirtual.util;
  2.  
  3. import java.sql.DriverManager;
  4. import java.sql.Connection;
  5.  
  6. public class Conexion {
  7. public static Conexion conectar() {
  8. Conexion conexion = null;
  9. try {
  10. Class.forName("com.mysql.cj.jdbc.Driver");
  11. conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/semana01", "root", "admin");
  12.  
  13. } catch (Exception e) {
  14. System.out.print(e.getMessage());
  15. }
  16. return conexion;
  17. }
  18.  
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement