Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void insertTable(int idEmployee , String First_Name , String Last_Name , String Password , int Sex , String Mail , int Employee_idEmployee ) throws Exception {
- Connection conn = (Connection) getConnection() ;
- try {
- PreparedStatement insertStatement = (PreparedStatement) conn.prepareStatement("INSERT INTO employee (?,?,?,?,?,?,?) VALUES (?,?,?,?,?,?,?)");
- insertStatement.setInt(1, idEmployee);
- insertStatement.setString(2, First_Name);
- insertStatement.setString(3, Last_Name );
- insertStatement.setString(4, Password);
- insertStatement.setInt(5, Sex);
- insertStatement.setString(6, Mail);
- insertStatement.setInt(7 ,Employee_idEmployee);
- insertStatement.close();
- conn.close() ;
- System.out.println("it's ok");
- } catch (SQLException e) {
- System.out.println(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement