Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String url = "jdbc:mysql://url/base_de_donnée";
- private String user = "Nom_d'utilisateur";
- private String password = "mot_de_passe";
- public Connection conn;
- public ResultSet result;
- public Statement state;
- public void connect()
- {
- try
- {
- Class.forName("com.mysql.jdbc.Driver");
- }
- catch (ClassNotFoundException e1)
- {
- e1.printStackTrace();
- }
- try
- {
- this.conn = DriverManager.getConnection(url, user, password);
- System.out.println("Connexion établie!");
- }
- catch (SQLException e)
- {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement