Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- private static String username = "root";
- private static String password = "password";
- private static String connectionString = "jdbc:mysql://localhos:3306/";
- private static Connection connection;
- private static Statement command;
- try
- {
- connection = DriverManager.getConnection(connectionString, username, password);
- command = connection.createStatement();
- command.execute("INSERT INTO details VALUES ('Shan','FERG')");
- }
- catch(SQLException sqle)
- {
- sqle.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement