java - SQLSyntaxErrorException when i select a sequence from DB (ORACLE 11g) -


i have strange exception when try select sequence number database. if run query: select mysequence.nextval dual directly in db it's work fine , give me next value. when run same query on java have sqlsyntaxerrorexception.

statement = connection.preparestatement(my_seq); resultset = statement.executequery(); my_seq= private static final string my_seq="select mysequence.nextval dual"; 

i try execute query select id anytable try if goes wrong in configuration run , return result.

any idea of exception?

grant select problem. grant select on db.mysequence my_user;, have done grant select commit seem's doesn't go ok. , sqlsyntaxerrorexception because have create synonym sequence, without synonym have db.mysequence. order create sequence , use in java is:

  1. create sequence
  2. create synonym use sequence
  3. make grant select sequence user have in jdbc configuration

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -