Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DB;
- import java.sql.*;
- import java.util.TimeZone;
- public class DataBase {
- Connection connection;
- Statement statement;
- ResultSet result;
- public DataBase() throws SQLException {
- Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/rentalcar?autoReconnect=true&serverTimezone=" + TimeZone.getDefault().getID(), "root", "9234355q");
- Statement statement = connection.createStatement();
- }
- public void insertNewCustomer(int ID, String namee, String surname, String street, int houseNumber, String city, long peselNumber, String rentDate) throws SQLException {
- String sql = "insert into employees" + "(namee, surname, street,houseNumber,city,peselNumber,rentDate)" + "values(namee,surname,street,houseNumber,city,pseselNumber,rentDate)";
- statement.executeUpdate(sql);
- }
- }
Add Comment
Please, Sign In to add comment