Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. package application;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. public class Connexion {
  6. Connection con;
  7. public Connexion(){
  8. try {
  9. Class.forName("com.mysql.jdbc.Driver");
  10. con=DriverManager.getConnection("jdbc:mysql://localhost/ecole","root","0000");
  11.  
  12. System.out.println("connection établie");
  13.  
  14. } catch (Exception e) {
  15.  
  16.  
  17. System.out.println("Base de donnee introuvable");
  18. }
  19. }
  20. public Connection etablirconnection() {
  21. return con;
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement