How do I execute a sql script in a . bat file in an H2 database

sikyala
sikyala used Ask the Experts™
on
I am trying to create a batch file the logs into an h2 database and executes a sql script. I tried the following:

java org.h2.tools.RunScript -url jdbc:h2:tcp://localhost:1521/test -user test_usr -script C:\tmp\ESS.sql > ESS.log

The sql script truncates a table in the database. It isn't working. What am I doing wrong?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President and Btrieve Guru
Commented:
Is your database accessible from ODBC as well?  You can try SQLExec, a command-line SQL statement executor available here: www.goldstarsoftware.com/sqlexec.asp.

There may be other viable solutions for command-line access to ODBC, too, that would pop up in a Google search.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial