Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Employee(String firstName, String lastName,
- String userID, String userPassword, String role)
- {
- try{
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/hotelmanagementsystem", "some_user","");
- PreparedStatement statement = con.prepareStatement("Insert into employee(Firstname, Lastname, UserID, UserPassword, Role)values(?, ?, ?, ?, ?");
- statement.setString(1, firstName);
- statement.setString(2, lastName);
- statement.setString(3, userID);
- statement.setString(4, userPassword);
- statement.setString(5, role);
- statement.executeUpdate();
- con.close();
- }
- catch( Exception e ) {
- e.printStackTrace();
- return;
- }
- }
- PreparedStatement statement = con.prepareStatement("Insert into employee(Firstname, Lastname, UserID, UserPassword, Role)values(?, ?, ?, ?, ?");
- PreparedStatement statement = con.prepareStatement("Insert into employee(Firstname, Lastname, UserID, UserPassword, Role)values(?, ?, ?, ?, ?)");
- PreparedStatement statement = con.prepareStatement("Insert into employee(Firstname, Lastname, UserID, UserPassword, Role)values(?, ?, ?, ?, ?");
- PreparedStatement statement = con.prepareStatement("Insert into employee(Firstname, Lastname, UserID, UserPassword, Role)values(?, ?, ?, ?, ?)");
- PreparedStatement statement = con.prepareStatement("Insert into employee(Firstname, Lastname, UserID, UserPassword, Role)values(?, ?, ?, ?, ?)");
Add Comment
Please, Sign In to add comment