Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. package bdd;
  2.  
  3. import java.sql.*;
  4.  
  5. public class CBdd {
  6.  
  7. Connection con;
  8. public CBdd(){
  9. try{
  10. Class.forName("com.mysql.jdbc.Driver");
  11. }catch(ClassNotFoundException e){
  12. System.err.println(e);
  13. //pour afficher l erreur
  14. }
  15. try{
  16. con=DriverManager.getConnection("jdbc:mysql://localhost:3306/gds","root","");
  17. }catch(SQLException e){System.err.println(e);}
  18. }
  19.  
  20. Connection obtenirconnexion(){return con;}
  21.  
  22. PreparedStatement prepareStatement(String query) {
  23. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement