protected void doAddUser(User user) throws UsersRepositoryException {
  Connection conn=null;
  PreparedStatement addUserStatement=null;
  try {
    conn=openConnection();
    addUserStatement=conn.prepareStatement(m_insertUserSql);
    setUserForInsertStatement(user,addUserStatement);
    addUserStatement.execute();
  }
 catch (  SQLException sqlExc) {
    sqlExc.printStackTrace();
    throw new UsersRepositoryException("Error accessing database",sqlExc);
  }
 finally {
    theJDBCUtil.closeJDBCStatement(addUserStatement);
    theJDBCUtil.closeJDBCConnection(conn);
  }
}

protected void doAddUser ( User user ) throws UsersRepositoryException { Connection conn = null ; PreparedStatement addUserStatement = null ; try { conn = openConnection ( ) ; addUserStatement = conn . prepareStatement ( m_insertUserSql ) ; setUserForInsertStatement ( user , addUserStatement ) ; addUserStatement . execute ( ) ; } catch ( SQLException sqlExc ) { sqlExc . printStackTrace ( ) ; throw new UsersRepositoryException ( "Error accessing database" , sqlExc ) ; } finally { theJDBCUtil . closeJDBCStatement ( addUserStatement ) ; theJDBCUtil . closeJDBCConnection ( conn ) ; } }
adds a user to the underlying repository . the user name must not clash with an existing user .
