I have a database column named Record ID . This is a primary key and its value is generated using an oracle sequence which has the below properties Sequence Details Min Value : 1 max Value : 9999999999999999999999999999 increment by : 10
In my Java application , I insert records into the table after applying some business logic . The value for the field Record ID , is got from a sequence generator
Before inserting a record , in Java code I first set its ID in a Java Long Variable with below code ( got from a sequence generator )
public static final String recordSequenceSQL= "SELECT RECORD_ID_SEQ.NEXTVAL FROM DUAL"
Long recordID = jdbcTemplate.queryForObject(SELECT_EVENT_LOG_SEQUENCE_SQL, Long.class);
recordDao.save(recordID , record_name ,age);
The recordID value shows as -8742538778 ( after I receive this value from sequence generator) , which has a minus sign in front of it .
I need to make sure that there is no negative values received . I'm not sure of the root cause and also need a solution to the same