Thoughts on this one? This follows the examples given in the replies exactly. 

if (currentIteration %2 == 0){
        insertPreparedStatement.setTimestamp(5,new Timestamp(new 
Date().getTime()));
}
else {
        insertPreparedStatement.setNull(5,Types.TIMESTAMP); <-----problem code
}

java.sql.BatchUpdateException: An attempt was made to get a data value of type 
'TIMESTAMP' from a data value of type 'null'.
        at 
org.apache.derby.impl.jdbc.EmbedStatement.executeBatch(EmbedStatement.java)
        at 
com.goodinassociates.evidencetracking.functionaltests.DatabaseTestHelper.prepareEventTable(DatabaseTestHelper.java:399)
        at 
com.goodinassociates.evidencetracking.functionaltests.DatabaseTestHelper.prepareEvidenceEventTable(DatabaseTestHelper.java:466)
        at 
com.goodinassociates.evidencetracking.evidence.EvidenceTest.testGetEvidence(EvidenceTest.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)


"What I've done, of course, is total garbage." -- R. Willard, Pure Math
430a

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to