Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- String connectionURL = "jdbc:mysql://localhost/employees";
- Connection connection = null;
- Statement statement = null;
- ResultSet resultSet = null;
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- connection = DriverManager.getConnection(connectionURL, "root", "");
- statement = connection.createStatement();
- if(!connection.isClosed()){
- out.println("Successfully connected to MySQL server" + "<br/>");
- }
- } catch(Exception ex){
- out.println("Unable to connect to database: "+ ex);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement