sqlStmt = new StringBuffer(" ALTER SEQUENCE " );
sqlStmt.append( ServerContext.getSchemaName() );
sqlStmt.append("SEQ_EDCD_TRACE_NUM");
sqlStmt.append( " INCREMENT BY " );
sqlStmt.append( " ? " );
pstmt.setLong(1, incval);
pstmt.execute();
You can't use bind variables with DDL, such as ALTER SEQUENCE
. You'll have to concatenate incval
onto the string.
There shouldn't be any risk of SQL injection if incval
is an int
or a long
.