Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String sql = "CREATE TABLE users (user_id int AUTO_INCREMENT,"
- + " user_name varchar(255),"
- + " user_email varchar(255) UNIQUE, "
- + " PRIMARY KEY(user_id))";
- try (Connection conn = DriverManager.getConnection(
- "jdbc:mysql://localhost:3306/my_db?useSSL=false&characterEncoding=utf8",
- "root", "coderslab");
- Statement stat = conn.createStatement()) {
- stat.executeUpdate(sql);
- } catch (SQLException e) {
- e.printStackTrace();
- }
Add Comment
Please, Sign In to add comment