Hello!
When I insert data into table (include identity column),then save data, then get identity column value,throw exception,error below(in fact,com.sybase.jdbc4.jdbc.SybStatement have not function :getGeneratedKeys()):
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: JZ0NK: Generated keys are not available because either the Statement.NO_GENERATED_KEYS was used or no keys were automatically generated.
at com.sybase.jdbc4.jdbc.ErrorMessage.raiseError(Unknown Source)
at com.sybase.jdbc4.jdbc.SybStatement.getGeneratedKeys(Unknown Source)
at com.alibaba.druid.filter.FilterChainImpl.statement_getGeneratedKeys(FilterChainImpl.java:2621)
at com.alibaba.druid.filter.FilterAdapter.statement_getGeneratedKeys(FilterAdapter.java:2524)
at com.alibaba.druid.filter.FilterEventAdapter.statement_getGeneratedKeys(FilterEventAdapter.java:415)
at com.alibaba.druid.filter.FilterChainImpl.statement_getGeneratedKeys(FilterChainImpl.java:2618)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.getGeneratedKeys(StatementProxyImpl.java:299)
at com.alibaba.druid.pool.DruidPooledStatement.getGeneratedKeys(DruidPooledStatement.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:85)
at com.sun.proxy.$Proxy29.getGeneratedKeys(Unknown Source)
at org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.processBatch(Jdbc3KeyGenerator.java:51)
at org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.processAfter(Jdbc3KeyGenerator.java:45)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
at com.sun.proxy.$Proxy27.update(Unknown Source)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:48)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:71)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
... 68 more
Hello!
When I insert data into table (include identity column),then save data, then get identity column value,throw exception,error below(in fact,com.sybase.jdbc4.jdbc.SybStatement have not function :getGeneratedKeys()): at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: JZ0NK: Generated keys are not available because either the Statement.NO_GENERATED_KEYS was used or no keys were automatically generated. at com.sybase.jdbc4.jdbc.ErrorMessage.raiseError(Unknown Source) at com.sybase.jdbc4.jdbc.SybStatement.getGeneratedKeys(Unknown Source) at com.alibaba.druid.filter.FilterChainImpl.statement_getGeneratedKeys(FilterChainImpl.java:2621) at com.alibaba.druid.filter.FilterAdapter.statement_getGeneratedKeys(FilterAdapter.java:2524) at com.alibaba.druid.filter.FilterEventAdapter.statement_getGeneratedKeys(FilterEventAdapter.java:415) at com.alibaba.druid.filter.FilterChainImpl.statement_getGeneratedKeys(FilterChainImpl.java:2618) at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.getGeneratedKeys(StatementProxyImpl.java:299)