// The oracle driver is getting confused by this statement, claiming we have to declare some in out parameter,
// when we execute this as a prepared statement. Might be a config issue on our side.
public static void simulateAutoIncrement(Connection connection, String tableName, String columnName) throws SQLException {
        String sequenceName = tableName + "_seq";
        String triggerName = tableName + "_id";
        connection.prepareStatement(
                "CREATE sequence " + sequenceName + " start with 1 increment by 1 nocycle"
        ).executeUpdate();
        // The oracle driver is getting confused by this statement, claiming we have to declare some in out parameter,
        // when we execute this as a prepared statement. Might be a config issue on our side.
        connection
                .createStatement()
                .execute(
                        "create or replace trigger " + triggerName +
                        "        before insert on " + tableName +
                        "        for each row " +
                        "        begin " +
                        "                :new." + columnName + " := " + sequenceName + ".nextval; " +
                        "        end;"
                );
    }
"CREATE sequence " + sequenceName + " start with 1 increment by 1 nocycle"
).executeUpdate();
// The oracle driver is getting confused by this statement, claiming we have to declare some in out parameter,
// when we execute this as a prepared statement. Might be a config issue on our side.
connection
.createStatement()
public static void simulateAutoIncrement(Connection connection, String tableName, String columnName) throws SQLException {
String sequenceName = tableName + "_seq";
String triggerName = tableName + "_id";
connection.prepareStatement(
"CREATE sequence " + sequenceName + " start with 1 increment by 1 nocycle"
).executeUpdate();
// The oracle driver is getting confused by this statement, claiming we have to declare some in out parameter,
// when we execute this as a prepared statement. Might be a config issue on our side.
connection
.createStatement()
.execute(
"create or replace trigger " + triggerName +
" before insert on " + tableName +
" for each row " +
" begin " +
" :new." + columnName + " := " + sequenceName + ".nextval; " +
" end;"
);
public static void simulateAutoIncrement(Connection connection, String tableName, String columnName) throws SQLException {
String sequenceName = tableName + "_seq";
String triggerName = tableName + "_id";
connection.prepareStatement(
"CREATE sequence " + sequenceName + " start with 1 increment by 1 nocycle"
).executeUpdate();
// The oracle driver is getting confused by this statement, claiming we have to declare some in out parameter,
// when we execute this as a prepared statement. Might be a config issue on our side.
connection
.createStatement()
.execute(
"create or replace trigger " + triggerName +
" before insert on " + tableName +
" for each row " +
" begin " +
" :new." + columnName + " := " + sequenceName + ".nextval; " +
" end;"
);
}