Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- import java.sql.Statement;
- public class MainApp{
- public static void main(String[] args) throws SQLException {
- try(Connection connection = createConnection();
- Statement statment = connection.createStatement();){
- statment.executeUpdate("");
- }catch (Exception e) {
- e.printStackTrace();
- }
- }
- private static Connection createConnection() throws SQLException{
- return DriverManager.getConnection("jdbc:mysql://localhost:3306/coderslab",
- "root", "coderslab");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement