org.apache.torque.task
Class TorqueDataDumpTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.velocity.texen.ant.TexenTask
              extended byorg.apache.torque.task.TorqueDataModelTask
                  extended byorg.apache.torque.task.TorqueDataDumpTask

public class TorqueDataDumpTask
extends TorqueDataModelTask

An extended Texen task used for dumping data from db into XML

Version:
$Id: TorqueDataDumpTask.java,v 1.3 2003/07/25 16:47:42 henning Exp $
Author:
Fedor Karpelevitch, Jason van Zyl, Daniel Rall

Nested Class Summary
 class TorqueDataDumpTask.TableTool
          A nasty do-it-all tool class.
 
Field Summary
private  java.sql.Connection conn
          The database connection used to retrieve the data to dump.
private  java.lang.String databaseDriver
          Database driver used for JDBC connection.
private  java.lang.String databaseName
          Database name.
private  java.lang.String databasePassword
          Database password used for JDBC connection.
private  java.lang.String databaseUrl
          Database URL used for JDBC connection.
private  java.lang.String databaseUser
          Database user used for JDBC connection.
private  java.sql.Statement stmt
          The statement used to acquire the data to dump.
 
Fields inherited from class org.apache.torque.task.TorqueDataModelTask
context, databaseNames, dataModelDbMap, dataModels, filesets, sqldbmap, xmlFile
 
Fields inherited from class org.apache.velocity.texen.ant.TexenTask
contextProperties, controlTemplate, inputEncoding, outputDirectory, outputEncoding, outputFile, templatePath, useClasspath
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
TorqueDataDumpTask()
           
 
Method Summary
protected  void cleanup()
          Closes the db-connection, overriding the cleanup() hook method in TexenTask.
 java.lang.String getDatabaseDriver()
          Get the database driver name
 java.lang.String getDatabaseName()
          Get the database name to dump
 java.lang.String getDatabasePassword()
          Get the database password
 java.lang.String getDatabaseUrl()
          Get the database url
 java.lang.String getDatabaseUser()
          Get the database user
 org.apache.velocity.context.Context initControlContext()
          Initializes initial context
 void setDatabaseDriver(java.lang.String v)
          Set the database driver name
 void setDatabaseName(java.lang.String v)
          Set the database name
 void setDatabasePassword(java.lang.String v)
          Set the database password
 void setDatabaseUrl(java.lang.String v)
          Set the database url
 void setDatabaseUser(java.lang.String v)
          Set the database user
 
Methods inherited from class org.apache.torque.task.TorqueDataModelTask
addFileset, getBasePathToDbProps, getDataModelDbMap, getDataModels, getSqlDbMap, getTargetDatabase, getTargetPackage, getXmlFile, setBasePathToDbProps, setContextProperties, setSqlDbMap, setTargetDatabase, setTargetPackage, setXmlFile
 
Methods inherited from class org.apache.velocity.texen.ant.TexenTask
execute, getContextProperties, getControlTemplate, getOutputDirectory, getOutputFile, getTemplatePath, populateInitialContext, setControlTemplate, setInputEncoding, setOutputDirectory, setOutputEncoding, setOutputFile, setTemplatePath, setUseClasspath
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseName

private java.lang.String databaseName
Database name.


databaseUrl

private java.lang.String databaseUrl
Database URL used for JDBC connection.


databaseDriver

private java.lang.String databaseDriver
Database driver used for JDBC connection.


databaseUser

private java.lang.String databaseUser
Database user used for JDBC connection.


databasePassword

private java.lang.String databasePassword
Database password used for JDBC connection.


conn

private java.sql.Connection conn
The database connection used to retrieve the data to dump.


stmt

private java.sql.Statement stmt
The statement used to acquire the data to dump.

Constructor Detail

TorqueDataDumpTask

public TorqueDataDumpTask()
Method Detail

getDatabaseName

public java.lang.String getDatabaseName()
Get the database name to dump

Returns:
The DatabaseName value

setDatabaseName

public void setDatabaseName(java.lang.String v)
Set the database name

Parameters:
v - The new DatabaseName value

getDatabaseUrl

public java.lang.String getDatabaseUrl()
Get the database url

Returns:
The DatabaseUrl value

setDatabaseUrl

public void setDatabaseUrl(java.lang.String v)
Set the database url

Parameters:
v - The new DatabaseUrl value

getDatabaseDriver

public java.lang.String getDatabaseDriver()
Get the database driver name

Returns:
String database driver name

setDatabaseDriver

public void setDatabaseDriver(java.lang.String v)
Set the database driver name

Parameters:
v - The new DatabaseDriver value

getDatabaseUser

public java.lang.String getDatabaseUser()
Get the database user

Returns:
String database user

setDatabaseUser

public void setDatabaseUser(java.lang.String v)
Set the database user

Parameters:
v - The new DatabaseUser value

getDatabasePassword

public java.lang.String getDatabasePassword()
Get the database password

Returns:
String database password

setDatabasePassword

public void setDatabasePassword(java.lang.String v)
Set the database password

Parameters:
v - The new DatabasePassword value

initControlContext

public org.apache.velocity.context.Context initControlContext()
                                                       throws java.lang.Exception
Initializes initial context

Overrides:
initControlContext in class TorqueDataModelTask
Returns:
the context
Throws:
java.lang.Exception - generic exception

cleanup

protected void cleanup()
                throws java.lang.Exception
Closes the db-connection, overriding the cleanup() hook method in TexenTask.

Throws:
java.lang.Exception - Database problem while closing resource.


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.