• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 766
  • Last Modified:

HSQLDB date problem

When I try and insert a record into a date column I am getting teh following error...

java.lang.IllegalAccessError: try to access method java.util.Calendar.setTimeInMillis(J)V from class org.hsqldb.HsqlDateTime


Any idea what I might be doing wrong?
Thanks
Bruce
0
bqchristie
Asked:
bqchristie
  • 8
  • 4
  • 3
1 Solution
 
aozarovCommented:
You are using JDK < 1.4 which doesn't support JDBC 3.0.
From the source code:
//#ifdef JDBC3
        // Use method directly
        today.setTimeInMillis(millis);

//#else
/*
        // Have to go indirect
        tempDate.setTime(millis);
        today.setTime(tempDate);
*/

You need to compile it using the buildJDK12.bat file or download the non jdbc 3.0 version.
0
 
aozarovCommented:
To make myself more clear.
The provided sourcecode is extract from HsqlDateTime.
the  buildJDK12.bat comes with hsqldb under the build folder.
create a new hsqldb.jar (which will be placed under the lib folder) and try again using it.
0
 
objectsCommented:
Or download jdk 1.4 and try using that
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
aozarovCommented:
> Or download jdk 1.4 and try using that
I think (hope) that is pretty clear from that "You are using JDK < 1.4"
0
 
bqchristieAuthor Commented:
OK that makes perfect sense.  I have jdk1.3 on my computer for work and 1.4 for play. Question now is...

Given that I want JDK1.3 to be my default, how can I start hsqldb so that it points to the 1.4 version?

(or am I missing something?)

Thanks
Bruce
0
 
aozarovCommented:
if you don't want to upgrade your jvm then you need to run the bat file I mentioned to re-create hsqldb.jar for java < 1.4
then you use that jar the same way you use it currently.
0
 
aozarovCommented:
see my second post for how to rebuild the hsqldb.jar for jvm < 1.4
0
 
aozarovCommented:
Oh, you also have 1.4
then you can set JAVA_HOME to its path
e.g.
Java_home=c:\j2sdk1.4
and then add it to your path
PATH=%java_home%\bin;%PATH%

Note, that the 1.3 based jar can work on both.
0
 
aozarovCommented:
the above settings should work windows (though add SET before).
SET JAVA_HOME=...
SET PATH=%JAVA_HOME%\bin;%PATH%

for unix bash do
export JAVA_HOME=...
export PATH=$JAVA_HOME/bin:$PATH
0
 
objectsCommented:
> Given that I want JDK1.3 to be my default

Default for what exactly?

> how can I start hsqldb so that it points to the 1.4 version?

Specifically specify the path to 1.4 executable

0
 
bqchristieAuthor Commented:
aozarov
--------------------------------------------------
thanks for your help that was the problem


objects
---------------------------------
thanks for the answer but aozarov got there first.

i need a 1.3 version to run applet that doesn't work in 1.4.  i spend 90% of my time using this applet so that is why it needs to be the default.
0
 
aozarovCommented:
NP. :-)
0
 
objectsCommented:
> i need a 1.3 version to run applet that doesn't work in 1.4.

You don't need to (and don't actually want to) set you path to point to %JAVA_HOME% to achieve that.
0
 
bqchristieAuthor Commented:
seems to work fine.  why isn't this any good?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now