title: could not get next sequence value in DB2 10.5 when testing DAO class with JUnit
body: <p>I have installed new database with sequences in my local and able to see the next sequence values through the command prompt. But when I am trying to test the DAO classes using JUnit I am getting the following errors. 
  The below error states that don't have privilige...but I can able to get the next sequence values using cmnd prompt.</p>
  
  <p>ERROR:</p>
  
  <p>Hibernate: values nextval for SEQUENCE_ID
  12-Dec-2014 19:16:52 org.hibernate.util.JDBCExceptionReporter logExceptions
  WARNING: SQL Error: -551, SQLState: 42501
  12-Dec-2014 19:16:52 org.hibernate.util.JDBCExceptionReporter logExceptions
  SEVERE: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=user;USAGE;SEQUENCE_ID, DRIVER=3.66.46
  12-Dec-2014 19:16:52 org.hibernate.util.JDBCExceptionReporter logExceptions
  WARNING: SQL Error: -727, SQLState: 56098
  12-Dec-2014 19:16:52 org.hibernate.util.JDBCExceptionReporter logExceptions
  SEVERE: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-551;42501;user;USAGE;SEQUENCE_ID, DRIVER=3.66.46
  12-Dec-2014 19:16:52 org.hibernate.util.JDBCExceptionReporter logExceptions
  WARNING: SQL Error: -727, SQLState: 56098
  12-Dec-2014 19:16:52 org.hibernate.util.JDBCExceptionReporter logExceptions
  SEVERE: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-551;42501;user;USAGE;SEQUENCE_ID, DRIVER=3.66.46
  org.hibernate.exception.SQLGrammarException: could not get next sequence value
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.id.SequenceGenerator.generateHolder(SequenceGenerator.java:132)
      at org.hibernate.id.SequenceHiLoGenerator$1.getNextValue(SequenceHiLoGenerator.java:86)
      at org.hibernate.id.enhanced.OptimizerFactory$LegacyHiLoAlgorithmOptimizer.generate(OptimizerFactory.java:410)
      at org.hibernate.id.SequenceHiLoGenerator.generate(SequenceHiLoGenerator.java:83)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
      at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
      at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
      at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy14.createNewService(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at java.lang.reflect.Method.invoke(Method.java:611)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=user;USAGE;SEQUENCE_ID, DRIVER=3.66.46
      at com.ibm.db2.jcc.am.dd.a(dd.java:741)
      at com.ibm.db2.jcc.am.dd.a(dd.java:60)
      at com.ibm.db2.jcc.am.dd.a(dd.java:127)
      at com.ibm.db2.jcc.am.oo.c(oo.java:2763)
      at com.ibm.db2.jcc.am.oo.d(oo.java:2751)
      at com.ibm.db2.jcc.am.oo.a(oo.java:2200)
      at com.ibm.db2.jcc.am.po.a(po.java:7379)
      at com.ibm.db2.jcc.t4.ab.h(ab.java:141)
      at com.ibm.db2.jcc.t4.ab.b(ab.java:41)
      at com.ibm.db2.jcc.t4.o.a(o.java:32)
      at com.ibm.db2.jcc.t4.tb.i(tb.java:145)
      at com.ibm.db2.jcc.am.oo.ib(oo.java:2169)
      at com.ibm.db2.jcc.am.po.tc(po.java:3547)
      at com.ibm.db2.jcc.am.po.b(po.java:4345)
      at com.ibm.db2.jcc.am.po.gc(po.java:739)
      at com.ibm.db2.jcc.am.po.executeQuery(po.java:708)
      at org.hibernate.id.SequenceGenerator.generateHolder(SequenceGenerator.java:112)
      ... 53 more</p>