Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

com.ibm.db2.jcc.a.nn: THE SQL STATEMENT IS NOT SUPPORTED.

 
s bhushan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DebugPreparedStatement.executeQuery SQLException occurred for sql: values nextval for schemaA.CUSTID_SEQ
com.ibm.db2.jcc.a.nn: THE SQL STATEMENT IS NOT SUPPORTED. SQLCODE=-142, SQLSTATE=42612, DRIVER=3.52.99

I am using sequence to generate unique values but getting above error.

@SequenceGenerator(name="CUSTID_SEQ", sequenceName="CUSTID_SEQ")
public class Customer implements Serializable{
@Id
@Column(name = "custId")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUSTID_SEQ")
private Integer custId.
}
I tried using all possible DB2 dialects.
Please provide solution so that I can use sequence and get next value.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!