boolean tableUtilisateurExist = oracleIsTableExists("AUTH_UTILISATEUR",connection);
if (! tableUtilisateurExist) {
JdbcUtils.executeUpdate(connection, "CREATE TABLE AUTH_UTILISATEUR (UTI_ID int not null, UTI_LOGIN varchar(50) not null, UTI_PASSWORD varchar(50), UTI_PRENOM varchar(50), UTI_NOM varchar(50), UTI_ACTIF int not null, UTI_ALL_FONC int not null, UTI_ALL_DOC int not null, UTI_ALL_COL int not null, constraint pk_AUTH_UTILISATEUR primary key (UTI_ID))");
+ JdbcUtils.executeUpdate(connection, "CREATE SEQUENCE SQ_AUTH_UTILISATEURS START WITH 1 INCREMENT BY 1 NOMAXVALUE");
}
if(!oracleIsTableExists("AUTH_UTI_PRF",connection))
JdbcUtils.executeUpdate(connection, "CREATE TABLE AUTH_UTI_PRF( UTI_ID int not null, PRF_CODE varchar(20) not null, constraint pk_AUTH_UTI_PRF primary key (UTI_ID, PRF_CODE))");
static public void createUser(Connection connection, long id, String login, String password, String prenom, String nom, boolean allowedToAllFonctionnalites, boolean allowedToAllDocuments, boolean allowedToAllCollectivites, String codesProfil[]) throws SQLException {
JdbcUtils.executeUpdate(connection,
- "INSERT INTO AUTH_UTILISATEUR (UTI_ID, UTI_LOGIN, UTI_PASSWORD, UTI_PRENOM, UTI_NOM, UTI_ALL_FONC, UTI_ALL_DOC, UTI_ALL_COL, UTI_ACTIF) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
- new SimplePStmtBinderBuilder().add(id).add(login).add(password).add(prenom).add(nom).add(allowedToAllFonctionnalites).add(allowedToAllDocuments).add(allowedToAllCollectivites).add(1).toPStmtBinder());
+ "INSERT INTO AUTH_UTILISATEUR (UTI_ID, UTI_LOGIN, UTI_PASSWORD, UTI_PRENOM, UTI_NOM, UTI_ALL_FONC, UTI_ALL_DOC, UTI_ALL_COL, UTI_ACTIF) VALUES (SQ_AUTH_UTILISATEURS, ?, ?, ?, ?, ?, ?, ?, ?)",
+ new SimplePStmtBinderBuilder().add(login).add(password).add(prenom).add(nom).add(allowedToAllFonctionnalites).add(allowedToAllDocuments).add(allowedToAllCollectivites).add(1).toPStmtBinder());
if (codesProfil != null) {
for (String codeProfil : codesProfil) {
JdbcUtils.executeUpdate(connection,