Java Doc for RdbmsOperation.java in  » J2EE » spring-framework-2.0.6 » org » springframework » jdbc » object » 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 » J2EE » spring framework 2.0.6 » org.springframework.jdbc.object 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.jdbc.object.RdbmsOperation

All known Subclasses:   org.springframework.jdbc.object.SqlCall,  org.springframework.jdbc.object.SqlOperation,
RdbmsOperation
abstract public class RdbmsOperation implements InitializingBean(Code)
An "RDBMS operation" is a multi-threaded, reusable object representing a query, update, or stored procedure call. An RDBMS operation is not a command, as a command is not reusable. However, execute methods may take commands as arguments. Subclasses should be JavaBeans, allowing easy configuration.

This class and subclasses throw runtime exceptions, defined in the (and as thrown by the org.springframework.jdbc.core package, which the classes in this package use under the hood to perform raw JDBC operations).

Subclasses should set SQL and add parameters before invoking the RdbmsOperation.compile() method. The order in which parameters are added is significant. The appropriate execute or update method can then be invoked.
author:
   Rod Johnson
author:
   Juergen Hoeller
See Also:   SqlQuery
See Also:   SqlUpdate
See Also:   StoredProcedure
See Also:   org.springframework.jdbc.core.JdbcTemplate



Field Summary
final protected  Loglogger
    


Method Summary
public  voidafterPropertiesSet()
     Ensures compilation if used in a bean factory.
protected  booleanallowsUnusedParameters()
     Return whether this operation accepts additional parameters that are given but not actually used.
protected  voidcheckCompiled()
     Check whether this operation has been compiled already; lazily compile it if not already compiled.
final public  voidcompile()
     Compile this query.
abstract protected  voidcompileInternal()
     Subclasses must implement this template method to perform their own compilation.
public  voiddeclareParameter(SqlParameter param)
     Declare a parameter for this operation.

The order in which this method is called is significant when using positional parameters.

protected  ListgetDeclaredParameters()
     Return a list of the declared SqlParameter objects.
public  String[]getGeneratedKeysColumnNames()
     Return the column names of the auto generated keys.
public  JdbcTemplategetJdbcTemplate()
     Return the JdbcTemplate object used by this object.
public  intgetResultSetType()
     Return whether statements will return a specific type of ResultSet.
public  StringgetSql()
     Subclasses can override this to supply dynamic SQL if they wish, but SQL is normally set by calling the setSql() method or in a subclass constructor.
public  booleanisCompiled()
     Is this operation "compiled"? Compilation, as in JDO, means that the operation is fully configured, and ready to use.
public  booleanisReturnGeneratedKeys()
     Return whether statements should be capable of returning auto-generated keys.
public  booleanisUpdatableResults()
     Return whether statements will return updatable ResultSets.
public  voidsetDataSource(DataSource dataSource)
     Set the JDBC DataSource to obtain connections from.
public  voidsetFetchSize(int fetchSize)
     Set the fetch size for this RDBMS operation.
public  voidsetGeneratedKeysColumnNames(String[] names)
     Set the column names of the auto-generated keys.
public  voidsetJdbcTemplate(JdbcTemplate jdbcTemplate)
     An alternative to the more commonly used setDataSource() when you want to use the same JdbcTemplate in multiple RdbmsOperations.
public  voidsetMaxRows(int maxRows)
     Set the maximum number of rows for this RDBMS operation.
public  voidsetQueryTimeout(int queryTimeout)
     Set the query timeout for statements that this RDBMS operation executes.
public  voidsetResultSetType(int resultSetType)
     Set whether to use statements that return a specific type of ResultSet.
public  voidsetReturnGeneratedKeys(boolean returnGeneratedKeys)
     Set whether prepared statements should be capable of returning auto-generated keys.
public  voidsetSql(String sql)
     Set the SQL executed by this operation.
public  voidsetTypes(int[] types)
     Add anonymous parameters, specifying only their SQL types as defined in the java.sql.Types class.

Parameter ordering is significant.

public  voidsetUpdatableResults(boolean updatableResults)
     Set whether to use statements that are capable of returning updatable ResultSets.
protected  booleansupportsLobParameters()
     Return whether BLOB/CLOB parameters are supported for this kind of operation.
protected  voidvalidateNamedParameters(Map parameters)
     Validate the named parameters passed to an execute method based on declared parameters. Subclasses should invoke this method before every executeQuery() or update() method.
Parameters:
  parameters - parameter Map supplied.
protected  voidvalidateParameters(Object[] parameters)
     Validate the parameters passed to an execute method based on declared parameters.

Field Detail
logger
final protected Log logger(Code)
Logger available to subclasses





Method Detail
afterPropertiesSet
public void afterPropertiesSet()(Code)
Ensures compilation if used in a bean factory.



allowsUnusedParameters
protected boolean allowsUnusedParameters()(Code)
Return whether this operation accepts additional parameters that are given but not actually used. Applies in particular to parameter Maps.

The default is false.
See Also:   StoredProcedure




checkCompiled
protected void checkCompiled()(Code)
Check whether this operation has been compiled already; lazily compile it if not already compiled.

Automatically called by validateParameters.
See Also:   RdbmsOperation.validateParameters




compile
final public void compile() throws InvalidDataAccessApiUsageException(Code)
Compile this query. Ignores subsequent attempts to compile.
throws:
  InvalidDataAccessApiUsageException - if the object hasn'tbeen correctly initialized, for example if no DataSource has been provided



compileInternal
abstract protected void compileInternal() throws InvalidDataAccessApiUsageException(Code)
Subclasses must implement this template method to perform their own compilation. Invoked after this base class's compilation is complete.

Subclasses can assume that SQL and a DataSource have been supplied.
throws:
  InvalidDataAccessApiUsageException - if the subclass hasn't beenproperly configured




declareParameter
public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException(Code)
Declare a parameter for this operation.

The order in which this method is called is significant when using positional parameters. It is not significant when using named parameters with named SqlParameter objects here; it remains significant when using named parameters in combination with unnamed SqlParameter objects here.
Parameters:
  param - the SqlParameter to add. This will specify SQL type and (optionally)the parameter's name. Note that you typically use the SqlParameter classitself here, not any of its subclasses.
throws:
  InvalidDataAccessApiUsageException - if the operation is already compiled,and hence cannot be configured further




getDeclaredParameters
protected List getDeclaredParameters()(Code)
Return a list of the declared SqlParameter objects.



getGeneratedKeysColumnNames
public String[] getGeneratedKeysColumnNames()(Code)
Return the column names of the auto generated keys.



getJdbcTemplate
public JdbcTemplate getJdbcTemplate()(Code)
Return the JdbcTemplate object used by this object.



getResultSetType
public int getResultSetType()(Code)
Return whether statements will return a specific type of ResultSet.



getSql
public String getSql()(Code)
Subclasses can override this to supply dynamic SQL if they wish, but SQL is normally set by calling the setSql() method or in a subclass constructor.



isCompiled
public boolean isCompiled()(Code)
Is this operation "compiled"? Compilation, as in JDO, means that the operation is fully configured, and ready to use. The exact meaning of compilation will vary between subclasses. whether this operation is compiled, and ready to use.



isReturnGeneratedKeys
public boolean isReturnGeneratedKeys()(Code)
Return whether statements should be capable of returning auto-generated keys.



isUpdatableResults
public boolean isUpdatableResults()(Code)
Return whether statements will return updatable ResultSets.



setDataSource
public void setDataSource(DataSource dataSource)(Code)
Set the JDBC DataSource to obtain connections from.
See Also:   org.springframework.jdbc.core.JdbcTemplate.setDataSource



setFetchSize
public void setFetchSize(int fetchSize)(Code)
Set the fetch size for this RDBMS operation. This is important for processing large result sets: Setting this higher than the default value will increase processing speed at the cost of memory consumption; setting this lower can avoid transferring row data that will never be read by the application.

Default is 0, indicating to use the driver's default.
See Also:   org.springframework.jdbc.core.JdbcTemplate.setFetchSize




setGeneratedKeysColumnNames
public void setGeneratedKeysColumnNames(String[] names)(Code)
Set the column names of the auto-generated keys.
See Also:   java.sql.Connection.prepareStatement(StringString[])



setJdbcTemplate
public void setJdbcTemplate(JdbcTemplate jdbcTemplate)(Code)
An alternative to the more commonly used setDataSource() when you want to use the same JdbcTemplate in multiple RdbmsOperations. This is appropriate if the JdbcTemplate has special configuration such as a SQLExceptionTranslator that should apply to multiple RdbmsOperation objects.



setMaxRows
public void setMaxRows(int maxRows)(Code)
Set the maximum number of rows for this RDBMS operation. This is important for processing subsets of large result sets, avoiding to read and hold the entire result set in the database or in the JDBC driver.

Default is 0, indicating to use the driver's default.
See Also:   org.springframework.jdbc.core.JdbcTemplate.setMaxRows




setQueryTimeout
public void setQueryTimeout(int queryTimeout)(Code)
Set the query timeout for statements that this RDBMS operation executes.

Default is 0, indicating to use the JDBC driver's default.

Note: Any timeout specified here will be overridden by the remaining transaction timeout when executing within a transaction that has a timeout specified at the transaction level.




setResultSetType
public void setResultSetType(int resultSetType)(Code)
Set whether to use statements that return a specific type of ResultSet.
Parameters:
  resultSetType - the ResultSet type
See Also:   java.sql.ResultSet.TYPE_FORWARD_ONLY
See Also:   java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE
See Also:   java.sql.ResultSet.TYPE_SCROLL_SENSITIVE
See Also:   java.sql.Connection.prepareStatement(Stringintint)



setReturnGeneratedKeys
public void setReturnGeneratedKeys(boolean returnGeneratedKeys)(Code)
Set whether prepared statements should be capable of returning auto-generated keys.
See Also:   java.sql.Connection.prepareStatement(Stringint)



setSql
public void setSql(String sql)(Code)
Set the SQL executed by this operation.



setTypes
public void setTypes(int[] types) throws InvalidDataAccessApiUsageException(Code)
Add anonymous parameters, specifying only their SQL types as defined in the java.sql.Types class.

Parameter ordering is significant. This method is an alternative to the RdbmsOperation.declareParameter method, which should normally be preferred.
Parameters:
  types - array of SQL types as defined in thejava.sql.Types class
throws:
  InvalidDataAccessApiUsageException - if the operation is already compiled




setUpdatableResults
public void setUpdatableResults(boolean updatableResults)(Code)
Set whether to use statements that are capable of returning updatable ResultSets.
See Also:   java.sql.Connection.prepareStatement(Stringintint)



supportsLobParameters
protected boolean supportsLobParameters()(Code)
Return whether BLOB/CLOB parameters are supported for this kind of operation.

The default is true.




validateNamedParameters
protected void validateNamedParameters(Map parameters) throws InvalidDataAccessApiUsageException(Code)
Validate the named parameters passed to an execute method based on declared parameters. Subclasses should invoke this method before every executeQuery() or update() method.
Parameters:
  parameters - parameter Map supplied. May be null.
throws:
  InvalidDataAccessApiUsageException - if the parameters are invalid



validateParameters
protected void validateParameters(Object[] parameters) throws InvalidDataAccessApiUsageException(Code)
Validate the parameters passed to an execute method based on declared parameters. Subclasses should invoke this method before every executeQuery() or update() method.
Parameters:
  parameters - parameters supplied (may be null)
throws:
  InvalidDataAccessApiUsageException - if the parameters are invalid



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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