Hi Lukas Unfortunately I have the exact same problem when using the other jdbc driver.
> I will add integration tests to the test suite using your driver: > https://github.com/jOOQ/jOOQ/issues/2424 Cool :-) Thanks & Cheers, Michele Am Dienstag, 30. April 2013 11:41:45 UTC+2 schrieb Lukas Eder: > > Hi Michele, > > 2013/4/30 <[email protected] <javascript:>> > >> > What JDBC driver are you using? >> <dependency> >> <groupId>org.xerial</groupId> >> <artifactId>sqlite-jdbc</artifactId> >> <version>3.7.2</version> >> </dependency> >> > > jOOQ is integration tested with this driver: > > https://code.google.com/p/sqlitebot/downloads/detail?name=sqlitejdbc-v056.jar > > Could you verify if the problem persists, or if this might be a xerial > driver issue? > > I will add integration tests to the test suite using your driver: > https://github.com/jOOQ/jOOQ/issues/2424 > > Cheers > Lukas > > >> > What log4j TRACE output do you get when running that query? >> 2013-04-30 11:31:52,261 | main | INFO | >> DriverManagerDataSource | Loaded JDBC driver: org.sqlite.JDBC >> 2013-04-30 11:31:52,780 | main | TRACE | StopWatch >> | Initialising : Total: 0.713ms >> 2013-04-30 11:31:52,920 | main | TRACE | StopWatch >> | Rendering query : Total: 141.044ms, +140.331ms >> 2013-04-30 11:31:52,924 | main | TRACE | StopWatch >> | Query rendered : Total: 145.302ms, +4.257ms >> 2013-04-30 11:31:52,924 | main | DEBUG | LoggerListener >> | Executing query : insert into Project (Name, Code, >> Company) values (?, ?, ?) >> 2013-04-30 11:31:52,924 | main | DEBUG | LoggerListener >> | -> with bind values : insert into Project (Name, Code, >> Company) values ('billyboytest', 'code1234', 'nca') >> 2013-04-30 11:31:52,924 | main | TRACE | StopWatch >> | Preparing statement : Total: 145.719ms, +0.417ms >> 2013-04-30 11:31:52,928 | main | TRACE | StopWatch >> | Statement prepared : Total: 149.406ms, +3.686ms >> 2013-04-30 11:31:52,928 | main | TRACE | StopWatch >> | Binding variables : Total: 149.526ms, +0.119ms >> 2013-04-30 11:31:52,929 | main | TRACE | DefaultBindContext >> | Binding variable 1 : billyboytest (class java.lang.String) >> 2013-04-30 11:31:52,930 | main | TRACE | DefaultBindContext >> | Binding variable 2 : code1234 (class java.lang.String) >> 2013-04-30 11:31:52,930 | main | TRACE | DefaultBindContext >> | Binding variable 3 : nca (class java.lang.String) >> 2013-04-30 11:31:52,930 | main | TRACE | StopWatch >> | Variables bound : Total: 151.321ms, +1.795ms >> 2013-04-30 11:31:52,930 | main | TRACE | StopWatch >> | Executing query : Total: 151.419ms, +0.097ms >> 2013-04-30 11:31:52,934 | main | DEBUG | StopWatch >> | Query executed : Total: 155.23ms, +3.81ms >> 2013-04-30 11:31:52,950 | main | TRACE | StopWatch >> | Initialising : Total: 0.005ms >> 2013-04-30 11:31:52,950 | main | TRACE | StopWatch >> | Rendering query : Total: 0.124ms, +0.119ms >> 2013-04-30 11:31:52,952 | main | TRACE | StopWatch >> | Query rendered : Total: 2.488ms, +2.363ms >> 2013-04-30 11:31:52,953 | main | DEBUG | LoggerListener >> | Executing query : select last_insert_rowid() >> 2013-04-30 11:31:52,953 | main | TRACE | StopWatch >> | Preparing statement : Total: 2.673ms, +0.184ms >> 2013-04-30 11:31:52,953 | main | TRACE | StopWatch >> | Statement prepared : Total: 2.873ms, +0.2ms >> 2013-04-30 11:31:52,953 | main | TRACE | StopWatch >> | Binding variables : Total: 2.939ms, +0.066ms >> 2013-04-30 11:31:52,953 | main | TRACE | StopWatch >> | Variables bound : Total: 3.081ms, +0.141ms >> 2013-04-30 11:31:52,953 | main | TRACE | StopWatch >> | Executing query : Total: 3.156ms, +0.074ms >> 2013-04-30 11:31:52,953 | main | DEBUG | StopWatch >> | Query executed : Total: 3.332ms, +0.176ms >> 2013-04-30 11:31:52,957 | main | TRACE | StopWatch >> | Fetching results : Total: 7.078ms, +3.745ms >> 2013-04-30 11:31:52,959 | main | TRACE | StopWatch >> | Fetching result : Total: 9.114ms, +2.036ms >> 2013-04-30 11:31:52,960 | main | TRACE | StopWatch >> | Fetching record : Total: 10.028ms, +0.914ms >> 2013-04-30 11:31:52,961 | main | TRACE | StopWatch >> | Record fetched : Total: 10.876ms, +0.847ms >> 2013-04-30 11:31:52,962 | main | TRACE | LoggerListener >> | Record fetched : +-------------------+ >> 2013-04-30 11:31:52,962 | main | TRACE | LoggerListener >> | : |last_insert_rowid()| >> 2013-04-30 11:31:52,962 | main | TRACE | LoggerListener >> | : +-------------------+ >> 2013-04-30 11:31:52,962 | main | TRACE | LoggerListener >> | : | 1235| >> 2013-04-30 11:31:52,962 | main | TRACE | LoggerListener >> | : +-------------------+ >> 2013-04-30 11:31:52,962 | main | TRACE | StopWatch >> | Result fetched : Total: 12.351ms, +1.475ms >> 2013-04-30 11:31:52,963 | main | DEBUG | LoggerListener >> | Fetched result : +-------------------+ >> 2013-04-30 11:31:52,963 | main | DEBUG | LoggerListener >> | : |last_insert_rowid()| >> 2013-04-30 11:31:52,963 | main | DEBUG | LoggerListener >> | : +-------------------+ >> 2013-04-30 11:31:52,963 | main | DEBUG | LoggerListener >> | : | 1235| >> 2013-04-30 11:31:52,963 | main | DEBUG | LoggerListener >> | : +-------------------+ >> 2013-04-30 11:31:52,964 | main | TRACE | StopWatch >> | Results fetched : Total: 13.619ms, +1.267ms >> 2013-04-30 11:31:52,966 | main | DEBUG | StopWatch >> | Finishing : Total: 15.957ms, +2.338ms >> 2013-04-30 11:31:52,969 | main | TRACE | StopWatch >> | Initialising : Total: 0.01ms >> 2013-04-30 11:31:52,969 | main | TRACE | StopWatch >> | Rendering query : Total: 0.177ms, +0.166ms >> 2013-04-30 11:31:52,969 | main | TRACE | StopWatch >> | Query rendered : Total: 0.52ms, +0.343ms >> 2013-04-30 11:31:52,969 | main | DEBUG | LoggerListener >> | Executing query : select Project.ID from Project where >> _rowid_ = ? >> 2013-04-30 11:31:52,970 | main | DEBUG | LoggerListener >> | -> with bind values : select Project.ID from Project where >> _rowid_ = 1235 >> 2013-04-30 11:31:52,970 | main | TRACE | StopWatch >> | Preparing statement : Total: 1.423ms, +0.902ms >> 2013-04-30 11:31:52,970 | main | DEBUG | StopWatch >> | Finishing : Total: 1.591ms, +0.168ms >> 2013-04-30 11:31:52,971 | main | DEBUG | StopWatch >> | Finishing : Total: 192.164ms, +36.934ms >> 2013-04-30 11:31:52,979 | Thread-0 | INFO | >> GenericApplicationContext | Closing >> org.springframework.context.support.GenericApplicationContext@2e8923f5: >> startup date [Tue Apr 30 11:31:51 CEST 2013]; root of context hierarchy >> >> >> >> Am Dienstag, 30. April 2013 11:03:11 UTC+2 schrieb Lukas Eder: >>> >>> Hi Michele, >>> >>> >>> 2013/4/30 <[email protected]> >>> >>> Hi all >>>> >>>> I have problems inserting a record into a SQLite database. This works: >>>> >>>> create().insertInto(PROJECT) >>>> .set(PROJECT.CODE, obj.getCode()) >>>> .set(PROJECT.COMPANY, obj.getCompany()) >>>> .set(PROJECT.NAME, obj.getName()) >>>> .execute(); >>>> >>>> However, If I do something like the following, I get a null pointer >>>> exception (I get the same exception also for other queries...): >>>> >>>> ProjectRecord record = create().newRecord(PROJECT); >>>> record.setCode(obj.getCode()); >>>> record.setCompany(obj.**getCompany()); >>>> record.setName(obj.getName()); >>>> record.insert(); >>>> >>>> java.lang.NullPointerException >>>> at org.sqlite.PrepStmt.<init>(**PrepStmt.java:42) >>>> at org.sqlite.Conn.**prepareStatement(Conn.java:**404) >>>> at org.sqlite.Conn.**prepareStatement(Conn.java:**399) >>>> at org.sqlite.Conn.**prepareStatement(Conn.java:**383) >>>> at org.jooq.impl.**ProviderEnabledConnection.**prepareStatement(** >>>> ProviderEnabledConnection.**java:103) >>>> at org.jooq.impl.**SettingsEnabledConnection.**prepareStatement(** >>>> SettingsEnabledConnection.**java:71) >>>> at org.jooq.impl.**ProviderEnabledConnection.**prepareStatement(** >>>> ProviderEnabledConnection.**java:103) >>>> at org.jooq.impl.**SettingsEnabledConnection.**prepareStatement(** >>>> SettingsEnabledConnection.**java:71) >>>> at org.jooq.impl.**AbstractResultQuery.prepare(** >>>> AbstractResultQuery.java:184) >>>> at org.jooq.impl.AbstractQuery.**execute(AbstractQuery.java:**265) >>>> at org.jooq.impl.**AbstractResultQuery.fetch(** >>>> AbstractResultQuery.java:309) >>>> at org.jooq.impl.**AbstractResultQuery.fetchInto(** >>>> AbstractResultQuery.java:596) >>>> at org.jooq.impl.SelectImpl.**fetchInto(SelectImpl.java:**1203) >>>> at org.jooq.impl.**AbstractStoreQuery.execute(** >>>> AbstractStoreQuery.java:260) >>>> at org.jooq.impl.AbstractQuery.**execute(AbstractQuery.java:**283) >>>> at org.jooq.impl.**UpdatableRecordImpl.**storeInsert(** >>>> UpdatableRecordImpl.java:176) >>>> at org.jooq.impl.**UpdatableRecordImpl.store(** >>>> UpdatableRecordImpl.java:139) >>>> at ch.test.service.model.**ProjectDAOImpl.persist(** >>>> ProjectDAOImpl.java:46) >>>> at ch.test.service.model.**ProjectDAOImpl.persist(** >>>> ProjectDAOImpl.java:1) >>>> at ch.test.service.model.**ProjectDAOImplTest.** >>>> shouldPersistNewMealItem(**ProjectDAOImplTest.java:43) >>>> 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:601) >>>> at org.junit.runners.model.**FrameworkMethod$1.**runReflectiveCall(** >>>> FrameworkMethod.java:47) >>>> at org.junit.internal.runners.**model.ReflectiveCallable.run(** >>>> ReflectiveCallable.java:12) >>>> at org.junit.runners.model.**FrameworkMethod.**invokeExplosively(** >>>> FrameworkMethod.java:44) >>>> at org.junit.internal.runners.**statements.InvokeMethod.** >>>> evaluate(InvokeMethod.java:17) >>>> at org.springframework.test.**context.junit4.statements.** >>>> RunBeforeTestMethodCallbacks.**evaluate(**RunBeforeTestMethodCallbacks. >>>> **java:74) >>>> at org.springframework.test.**context.junit4.statements.** >>>> RunAfterTestMethodCallbacks.**evaluate(**RunAfterTestMethodCallbacks.** >>>> java:83) >>>> at org.springframework.test.**context.junit4.statements.** >>>> SpringRepeat.evaluate(**SpringRepeat.java:72) >>>> at org.springframework.test.**context.junit4.** >>>> SpringJUnit4ClassRunner.**runChild(**SpringJUnit4ClassRunner.java:** >>>> 231) >>>> at org.springframework.test.**context.junit4.**SpringJUnit4ClassRunner. >>>> **runChild(**SpringJUnit4ClassRunner.java:**88) >>>> at org.junit.runners.**ParentRunner$3.run(**ParentRunner.java:238) >>>> at org.junit.runners.**ParentRunner$1.schedule(**ParentRunner.java:63) >>>> at org.junit.runners.**ParentRunner.runChildren(** >>>> ParentRunner.java:236) >>>> at org.junit.runners.**ParentRunner.access$000(**ParentRunner.java:53) >>>> at org.junit.runners.**ParentRunner$2.evaluate(** >>>> ParentRunner.java:229) >>>> at org.springframework.test.**context.junit4.statements.** >>>> RunBeforeTestClassCallbacks.**evaluate(**RunBeforeTestClassCallbacks.** >>>> java:61) >>>> at org.springframework.test.**context.junit4.statements.** >>>> RunAfterTestClassCallbacks.**evaluate(**RunAfterTestClassCallbacks.** >>>> java:71) >>>> at org.junit.runners.**ParentRunner.run(ParentRunner.**java:309) >>>> at org.springframework.test.**context.junit4.** >>>> SpringJUnit4ClassRunner.run(**SpringJUnit4ClassRunner.java:**174) >>>> at org.eclipse.jdt.internal.**junit4.runner.**JUnit4TestReference.run(* >>>> *JUnit4TestReference.java:50) >>>> 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) >>>> >>>> Any ideas what the problem could be? Thanks a lot for any help! >>>> Regards, Michele >>>> >>> >>> That looks quite surprising. >>> >>> - What JDBC driver are you using? >>> - What log4j TRACE output do you get when running that query? Info about >>> logging can be found here [1]. A sample log4j.xml file is here [2] >>> >>> Cheers >>> Lukas >>> >>> [1]: >>> http://blog.jooq.org/**2011/10/20/debug-logging-sql-**with-jooq<http://blog.jooq.org/2011/10/20/debug-logging-sql-with-jooq> >>> [2]: https://github.com/jOOQ/**jOOQ/blob/master/jOOQ-test/** >>> src/log4j.xml<https://github.com/jOOQ/jOOQ/blob/master/jOOQ-test/src/log4j.xml> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "jOOQ User Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
