What is Torque?

Torque is a persistence layer. Torque generates all the database resources required by your application and includes a runtime environment to run the generated classes.

Torque was developed as part of the Turbine Framework. It is now decoupled and can be used by itself. Starting with version 2.2 Turbine will use the decoupled Torque.

Torque's generation tasks

Torque uses a single XML database schema to generate the SQL for your target database and Torque's Peer-based object relation model representing your XML database schema. Additionally, an HTML document describing the database can be generated if you wish to make a browseable version of the database schema.

Torque offers an Ant build file (build-torque.xml) which could be added to your project . It defines the following targets:

  • sql
    generates SQL source from an XML schema describing a database structure
  • doc
    generates html or xml documentation for xml schemas
  • create-db
    generates simple scripts for creating databases on various platforms.
  • datadtd
    generates data DTD from an XML schema describing a database structure
  • datadump
    dumping data from db into XML
  • datasql
    generates SQL source from an XML data file
  • jdbc
    generates an XML schema of an existing database from JDBC metadata
  • om
    generates output by using Velocity
  • insert-sql
    inserts a SQL file into its designated database
  • sql2xml
    generates an xml schema from an sql schema
  • id-table-init-sql
    generates the initialization sql for the id table

Torque's runtime environment

Torque's runtime environment includes everything you need to use the generated OM/Peer classes. It includes a jdbc connection pool.

Supported RDBMS

RDBMS driver status tester
Axion org.axiondb.jdbc.AxionDriver alpha Martin Poeschl
Cloudscape COM.cloudscape.core.JDBCDriver untested
DB2 COM.ibm.db2.jdbc.{app|net}.DB2Driver untested
DB2/AS400 com.ibm.as400.access.AS400JDBCDriver possible case-insensitivity issues Scott Weaver
Hypersonic org.hsql.jdbcDriver untested
Informix ??? untested
InstantDB org.enhydra.instantdb.jdbc.idbDriver untested
Interbase interbase.interclient.Driver untested
MS SQL com.microsoft.jdbc.sqlserver.SQLServerDriver untested
Mysql org.gjt.mm.mysql.Driver no known problems Martin Poeschl
Oracle oracle.jdbc.driver.OracleDriver no known problems Martin Poeschl
Postgres org.postgresql.Driver no known problems Martin Poeschl
SapDB com.sap.dbtech.jdbc.DriverSapDB untested
Sybase com.sybase.jdbc2.jdbc.SybDriver JDBCToXMLSchema task will not generate the schema properly. All other tests pass. Jeffrey D. Brekke
Weblogic weblogic.jdbc.pool.Driver untested

If your RDBMS is not listed here, please read the document about writing DB Adapters

If there is no tester for your RDBMS and you want to help, please read the developer-guide, run the tests and send your results (and bugfixes ;) to the turbine-dev list.