It would be like this for any java program you call from a bash script. I'm not sure if you can maybe start a postgres server in H2 and use a postrgres command line tool?

Only other alternative would be to write a little java daemon you could leave running which you could send commands to from a bash script and get a response from. Probably using pipes could be quite simple, the java program just reads commands from the pipe (SQL) and outputs the resultset. Then your bash script can just write to the pipe and read a response from it. I'm sure there are much better ways, I haven't done a lot with bash scripts.



On 15/04/2013 3:16 AM, Cecil Westerhof wrote:
2013/4/14 Cecil Westerhof <[email protected] <mailto:[email protected]>>

    2013/4/14 Noel Grandin <[email protected]
    <mailto:[email protected]>>

        The Shell or the RunScript tool should do the job.

        http://h2database.com/html/tutorial.html#command_line_tools


    I'll look into it. But in this way I start a jvm. That is quite
    expensive I think. There is not a better way?


I just tested it with a simple query:
    SELECT quote FROM quotes LIMIT 10

The query itself took 49 ms. The total took .7 seconds. So the overhead is a factor 14. That is a lot. But for the moment it is good enough for me. I will not do that many queries I think.

If I need to do more, I properly should recode the bash script to a scala script. Looking at the above figure, that does not need to be very expensive.

--
Cecil Westerhof --
You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to