Thanks for your suggestion...I have checked the database in Oracle SQL Developer and under the Sequences section there definitely is a sequence which exists for my table - the definition of this sequence is as follows:
Code:
CREATE SEQUENCE "Test_UserName"."MY_TABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
Now in my Java database class I am doing the following:
Code:
String seq = Test_UserName.MY_TABLE_SEQ";
jdbcTemplate
.update(
"insert into TEST_TABLE (Id, Year_Month, Year_Day) values (?, ?, ?)",
new Object[] { sequence, "31-Mar-2009", 12});
This is throwing an exception as the first value passed in the following:
Code:
new Object[] { sequence, "31-Mar-2009", 12});
Is a String and therfore the call will fail. Whats the best way of getting the next sequence and passing this in as the first parameter by using:
"myschema.mysequence.nextval"?
Thanks again.