db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Vallet" <sval...@t-systems.fr>
Subject RE: runtime SQL script execution using torque
Date Tue, 29 Jul 2003 14:24:25 GMT

> If you're using JSPs, the JSTL <sql:query> seems to be the easiest way.

I don't know about this, but it seems indeed simpler.

However, if you want to use Torque for insertion, something like the
following will work (I'm not sure you still need to define the
"torque.database.*" properties, but I did)

TorqueSQLExec execSQLTask = new TorqueSQLExec();
execSQLTask.setProject(new Project());

execSQLTask.setAutocommit(false); // or true :)
execSQLTask.setDriver(conf.getString(MK[1])); // driver
execSQLTask.setUrl(conf.getString(MK[2])); // url
execSQLTask.setUserid(conf.getString(MK[3]));
execSQLTask.setPassword(conf.getString(MK[4]));

execSQLTask.setSrcDir(sqlDir.getAbsolutePath()); // directory with SQL
scripts
// you will need to generate the sqldb.map before executing
execSQLTask.setSqlDbMap(sqlDbMap.getAbsolutePath());

try { execSQLTask.execute(); }
catch (org.apache.tools.ant.BuildException be) { ... }

HTH,
Simon
--
Simon Vallet
T-Systems e-technologies
svallet@t-systems.fr


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message