Advertisement
Guest User

Untitled

a guest
May 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4. import java.sql.Statement;
  5.  
  6.  
  7. public class MainApp{
  8.  
  9. public static void main(String[] args) throws SQLException {
  10. try(Connection connection = createConnection();
  11. Statement statment = connection.createStatement();){
  12. statment.executeUpdate("");
  13. }catch (Exception e) {
  14. e.printStackTrace();
  15. }
  16. }
  17.  
  18. private static Connection createConnection() throws SQLException{
  19. return DriverManager.getConnection("jdbc:mysql://localhost:3306/coderslab",
  20. "root", "coderslab");
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement