I'm installed H2 on a Windows PC.
I would start H2 from ant so that it can be automatically started/
stopped during a test suite execution.
How can I do this with ant?
Have I to call .bat in ./service directory or what?
I can't find any H2-ant-tasks library.
Thanks
--
Giorgio
I'm sure it's possible to start/stop H2 within an Ant script. And I'm
sure it would be quite easy. However, there are easier ways. For
testing, usually I would try to use the embedded mode because it is
faster than the server mode. Sometimes you could even use the
in-memory mode. If you want to be able to access the database while
the test runs you could use the auto-server mode:
http://www.h2database.com/html/features.html#auto_mixed_mode
Regards,
Thomas
I have exactly intention to use in-memory mode.
This auto mixed mode is very very interesting!
I'm substituing Oracle XE with H2 in-memory in our project, to
enhance the speed of suite execution.
Most of problems I'm facing to are in SQL grammar.
We have a lot of Oracle TO_DATE() for test data and actually I'm
looking for a free SQL translator Oracle-to-H2.
Someone in the list had ever used such a translator?
Thanks
--
Giorgio Vespucci
giorgio [dot] vespucci [at] gmail [dot] com
Skype, Twitter, Slideshare: gvespucci
Linux User #471792
http://xpermanwalking.blogspot.com
I tried with service down, but H2 says org.h2.jdbc.JdbcSQLException:
Connection is broken: "session closed" [90067-128]
mumble, mumble...
> We have a lot of Oracle TO_DATE()
You could create a Java function. Example (not optimized):
create alias TO_DATE as $$
java.util.Date toDate(String s) throws Exception {
return new java.text.SimpleDateFormat("yyyy.MM.dd").parse(s);
}
$$;
call TO_DATE('1990.02.03');
See also http://www.h2database.com/html/grammar.html#create_alias
> I did'n undesrtand is H2 windows service must be runnig or not
It doesn't.
> "session closed" [90067-128]
What is your database URL, and what is the exact exception message and
stack trace?
Regards,
Thomas