Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Main {
- static String driver = "com.mysql.jdbc.Driver";
- static String url = "jdbc:mysql://localhost:3306/dice_game";
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- try {
- Class.forName(driver).newInstance();
- System.out.println("Success!");
- } catch (Exception e) {
- System.out.println("Driver error");
- e.printStackTrace();
- }
- try {
- Connection con = DriverManager.getConnection(url, "root", "");
- } catch (Exception e) {
- System.out.println("Connection error");
- //e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement