Guest User

Untitled

a guest
Jul 7th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. package DB;
  2.  
  3. import java.sql.*;
  4. import java.util.TimeZone;
  5.  
  6. public class DataBase {
  7.      Connection connection;
  8.      Statement statement;
  9.      ResultSet result;
  10.  
  11.  
  12.     public DataBase() throws SQLException {
  13.         Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/rentalcar?autoReconnect=true&serverTimezone=" + TimeZone.getDefault().getID(), "root", "9234355q");
  14.         Statement statement = connection.createStatement();
  15.     }
  16.  
  17.     public void insertNewCustomer(int ID, String namee, String surname, String street, int houseNumber, String city, long peselNumber, String rentDate) throws SQLException {
  18.         String sql = "insert into employees" + "(namee, surname, street,houseNumber,city,peselNumber,rentDate)" + "values(namee,surname,street,houseNumber,city,pseselNumber,rentDate)";
  19.         statement.executeUpdate(sql);
  20.     }
  21. }
Add Comment
Please, Sign In to add comment