Advertisement
alxsy

con_JAVA

Aug 12th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4. public class con {
  5. public static Connection con(){
  6. Connection con=null;
  7. try{
  8. con=DriverManager.getConnection("jdbc:mysql://localhost:3306/alx","root","");
  9. System.out.println("conectado...");
  10. }
  11. catch(SQLException e){
  12. System.out.println("desconectado...");
  13. }
  14. return con;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement