Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.DriverManager;
- import java.sql.Connection;
- import java.sql.SQLException;
- /**
- * Created by c15osn on 2016-12-05.
- */
- public class test{
- public static void main(String[] args) {
- String url = "jdbc:mysql://127.0.0.1:3306/v135h16g14";
- String username = "v135h16g14";
- String password = "Neungee6";
- System.out.println("Connecting database...");
- try (Connection connection = DriverManager.getConnection(url, username, password)) {
- System.out.println("Database connected!");
- } catch (SQLException e) {
- throw new IllegalStateException("Cannot connect the database!", e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement