Java Doc for TorqueSQLExec.java in  » Database-ORM » Torque » org » apache » torque » task » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Torque » org.apache.torque.task 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.torque.task.TorqueSQLExec

TorqueSQLExec
public class TorqueSQLExec extends Task (Code)
This task uses an SQL -> Database map in the form of a properties file to insert each SQL file listed into its designated database.
author:
   Jeff Martin
author:
   Michael McCallum
author:
   Tim Stephenson
author:
   Jason van Zyl
author:
   Martin Poeschl
version:
   $Id: TorqueSQLExec.java 473814 2006-11-11 22:30:30Z tv $

Inner Class :public static class DelimiterType extends EnumeratedAttribute
Inner Class :public static class OnError extends EnumeratedAttribute
Inner Class :public class Transaction



Method Summary
public  voidaddText(String sql)
    
public  PathcreateClasspath()
     Create the classpath for loading the driver.
protected  voidexecSQL(String sql, PrintStream out)
     Exec the sql statement.
public  voidexecute()
    
public  FilegetSqlDbMap()
     Get the sqldbmap properties file.
public  StringgetSrcDir()
     Get the src directory for the sql files listed in the sqldbmap file.
protected  booleanisValidRdbms(Connection conn)
    
protected  voidprintResults(PrintStream out)
     print any results in the statement.
protected  voidrunStatements(Reader reader, PrintStream out)
     Read the statements from the .sql file and execute them.
public  voidsetAutocommit(boolean autocommit)
     Set the autocommit flag for the DB connection.
public  voidsetClasspath(Path classpath)
     Set the classpath for loading the driver.
public  voidsetClasspathRef(Reference r)
     Set the classpath for loading the driver using the classpath reference.
public  voidsetDelimiter(String delimiter)
     Set the statement delimiter.
public  voidsetDelimiterType(DelimiterType delimiterType)
     Set the Delimiter type for this sql task.
public  voidsetDriver(String driver)
     Set the JDBC driver to be used.
public  voidsetEncoding(String encoding)
    
public  voidsetOnerror(OnError action)
    
public  voidsetOutput(File output)
     Set the output file.
public  voidsetPassword(String password)
     Set the password for the DB connection.
public  voidsetPrint(boolean print)
     Set the print flag.
public  voidsetRdbms(String vendor)
    
public  voidsetShowheaders(boolean showheaders)
     Set the showheaders flag.
public  voidsetSqlDbMap(String sqldbmap)
     Set the sqldbmap properties file.
public  voidsetSrcDir(String srcDir)
     Set the src directory for the sql files listed in the sqldbmap file.
public  voidsetUrl(String url)
     Set the DB connection url.
public  voidsetUserid(String userId)
     Set the user name for the DB connection.
public  voidsetVersion(String version)
    



Method Detail
addText
public void addText(String sql)(Code)
Set the sql command to execute
Parameters:
  sql - sql command to execute



createClasspath
public Path createClasspath()(Code)
Create the classpath for loading the driver. the classpath



execSQL
protected void execSQL(String sql, PrintStream out) throws SQLException(Code)
Exec the sql statement.
Parameters:
  sql -
Parameters:
  out -
throws:
  SQLException -



execute
public void execute() throws BuildException(Code)
Load the sql file and then execute it
throws:
  BuildException -



getSqlDbMap
public File getSqlDbMap()(Code)
Get the sqldbmap properties file. filename for the sqldbmap



getSrcDir
public String getSrcDir()(Code)
Get the src directory for the sql files listed in the sqldbmap file. sql source directory



isValidRdbms
protected boolean isValidRdbms(Connection conn)(Code)
Verify if connected to the correct RDBMS
Parameters:
  conn -



printResults
protected void printResults(PrintStream out) throws java.sql.SQLException(Code)
print any results in the statement.
Parameters:
  out -
throws:
  SQLException -



runStatements
protected void runStatements(Reader reader, PrintStream out) throws SQLException, IOException(Code)
Read the statements from the .sql file and execute them. Lines starting with '//', '--' or 'REM ' are ignored.
Parameters:
  reader -
Parameters:
  out -
throws:
  SQLException -
throws:
  IOException -



setAutocommit
public void setAutocommit(boolean autocommit)(Code)
Set the autocommit flag for the DB connection.
Parameters:
  autocommit - the autocommit flag



setClasspath
public void setClasspath(Path classpath)(Code)
Set the classpath for loading the driver.
Parameters:
  classpath - the classpath



setClasspathRef
public void setClasspathRef(Reference r)(Code)
Set the classpath for loading the driver using the classpath reference.
Parameters:
  r - reference to the classpath



setDelimiter
public void setDelimiter(String delimiter)(Code)
Set the statement delimiter.

For example, set this to "go" and delimitertype to "ROW" for Sybase ASE or MS SQL Server.


Parameters:
  delimiter -



setDelimiterType
public void setDelimiterType(DelimiterType delimiterType)(Code)
Set the Delimiter type for this sql task. The delimiter type takes two values - normal and row. Normal means that any occurence of the delimiter terminate the SQL command whereas with row, only a line containing just the delimiter is recognized as the end of the command.
Parameters:
  delimiterType -



setDriver
public void setDriver(String driver)(Code)
Set the JDBC driver to be used.
Parameters:
  driver - driver class name



setEncoding
public void setEncoding(String encoding)(Code)
Set the file encoding to use on the sql files read in
Parameters:
  encoding - the encoding to use on the files



setOnerror
public void setOnerror(OnError action)(Code)
Set the action to perform onerror
Parameters:
  action -



setOutput
public void setOutput(File output)(Code)
Set the output file.
Parameters:
  output -



setPassword
public void setPassword(String password)(Code)
Set the password for the DB connection.
Parameters:
  password - database password



setPrint
public void setPrint(boolean print)(Code)
Set the print flag.
Parameters:
  print -



setRdbms
public void setRdbms(String vendor)(Code)
Set the rdbms required
Parameters:
  vendor -



setShowheaders
public void setShowheaders(boolean showheaders)(Code)
Set the showheaders flag.
Parameters:
  showheaders -



setSqlDbMap
public void setSqlDbMap(String sqldbmap)(Code)
Set the sqldbmap properties file.
Parameters:
  sqldbmap - filename for the sqldbmap



setSrcDir
public void setSrcDir(String srcDir)(Code)
Set the src directory for the sql files listed in the sqldbmap file.
Parameters:
  srcDir - sql source directory



setUrl
public void setUrl(String url)(Code)
Set the DB connection url.
Parameters:
  url - connection url



setUserid
public void setUserid(String userId)(Code)
Set the user name for the DB connection.
Parameters:
  userId - database user



setVersion
public void setVersion(String version)(Code)
Set the version required
Parameters:
  version -



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.