public String ejbCreate(String empid, String firstname, String lastname, String circle, String subcircle, String created_date, String updated_date) throws CreateException {
try{
insertRow(empid,firstname,lastname,circle,subcircle,created_date,updated_date);
}catch(SQLException ex){
throw new EJBException("ejbCreate: " + ex.getMessage());
}
this.empid = empid;
this.firstName = firstname;
this.lastName = lastname;
this.Circle = circle;
this.Subcircle=subcircle;
this.Created_Date=created_date;
this.Updated_Date=updated_date;
return empid;
}
private void insertRow(String empid, String firstName,
String lastName, String Circle,String Subcirle,String Created_Date,String Updated_Date) throws SQLException{
makeConnection();
String insertStatement = "insert into Employee values ( ? , ? , ? , ?,?, ?,? )";
PreparedStatement prepStmt = con.prepareStatement(insertStatement);
prepStmt.setString(1, empid);
prepStmt.setString(2, firstName);
prepStmt.setString(3, lastName);
prepStmt.setString(4, Circle);
prepStmt.setString(5, Subcircle);
prepStmt.setString(6,Created_Date);
prepStmt.setString(7,Updated_Date);
prepStmt.executeUpdate();
prepStmt.close();
releaseConnection();
}