Java Doc for NamedParameterJdbcOperations.java in  » J2EE » spring-framework-2.5 » org » springframework » jdbc » core » namedparam » 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.5 » org.springframework.jdbc.core.namedparam 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations

All known Subclasses:   org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate,
NamedParameterJdbcOperations
public interface NamedParameterJdbcOperations (Code)
Interface specifying a basic set of JDBC operations allowing the use of named parameters rather than the traditional '?' placeholders.

This is an alternative to the classic org.springframework.jdbc.core.JdbcOperations interface, implemented by NamedParameterJdbcTemplate . This interface is not often used directly, but provides a useful option to enhance testability, as it can easily be mocked or stubbed.
author:
   Thomas Risberg
author:
   Juergen Hoeller
since:
   2.0
See Also:   NamedParameterJdbcTemplate
See Also:   org.springframework.jdbc.core.JdbcOperations





Method Summary
 Objectexecute(String sql, SqlParameterSource paramSource, PreparedStatementCallback action)
     Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
 Objectexecute(String sql, Map paramMap, PreparedStatementCallback action)
     Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement.
 JdbcOperationsgetJdbcOperations()
     Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations.
 Objectquery(String sql, SqlParameterSource paramSource, ResultSetExtractor rse)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 Objectquery(String sql, Map paramMap, ResultSetExtractor rse)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
 voidquery(String sql, SqlParameterSource paramSource, RowCallbackHandler rch)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
 voidquery(String sql, Map paramMap, RowCallbackHandler rch)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
 Listquery(String sql, SqlParameterSource paramSource, RowMapper rowMapper)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 Listquery(String sql, Map paramMap, RowMapper rowMapper)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
 intqueryForInt(String sql, SqlParameterSource paramSource)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 intqueryForInt(String sql, Map paramMap)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.
 ListqueryForList(String sql, SqlParameterSource paramSource, Class elementType)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 ListqueryForList(String sql, Map paramMap, Class elementType)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 ListqueryForList(String sql, SqlParameterSource paramSource)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 ListqueryForList(String sql, Map paramMap)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.
 longqueryForLong(String sql, SqlParameterSource paramSource)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 longqueryForLong(String sql, Map paramMap)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.
 MapqueryForMap(String sql, SqlParameterSource paramSource)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.
 MapqueryForMap(String sql, Map paramMap)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map. The queryForMap() methods defined by this interface are appropriate when you don't have a domain model.
 ObjectqueryForObject(String sql, SqlParameterSource paramSource, RowMapper rowMapper)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
 ObjectqueryForObject(String sql, Map paramMap, RowMapper rowMapper)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
 ObjectqueryForObject(String sql, SqlParameterSource paramSource, Class requiredType)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
 ObjectqueryForObject(String sql, Map paramMap, Class requiredType)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.
 SqlRowSetqueryForRowSet(String sql, SqlParameterSource paramSource)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion.

 SqlRowSetqueryForRowSet(String sql, Map paramMap)
     Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion.

 intupdate(String sql, SqlParameterSource paramSource)
     Issue an update via a prepared statement, binding the given arguments.
 intupdate(String sql, Map paramMap)
     Issue an update via a prepared statement, binding the given arguments.
 intupdate(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder)
     Issue an update via a prepared statement, binding the given arguments, returning generated keys.
 intupdate(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)
     Issue an update via a prepared statement, binding the given arguments, returning generated keys.



Method Detail
execute
Object execute(String sql, SqlParameterSource paramSource, PreparedStatementCallback action) throws DataAccessException(Code)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.
Parameters:
  sql - SQL to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  action - callback object that specifies the action a result object returned by the action, or null
throws:
  DataAccessException - if there is any problem




execute
Object execute(String sql, Map paramMap, PreparedStatementCallback action) throws DataAccessException(Code)
Execute a JDBC data access operation, implemented as callback action working on a JDBC PreparedStatement. This allows for implementing arbitrary data access operations on a single Statement, within Spring's managed JDBC environment: that is, participating in Spring-managed transactions and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.

The callback action can return a result object, for example a domain object or a collection of domain objects.
Parameters:
  sql - SQL to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  action - callback object that specifies the action a result object returned by the action, or null
throws:
  DataAccessException - if there is any problem




getJdbcOperations
JdbcOperations getJdbcOperations()(Code)
Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations.



query
Object query(String sql, SqlParameterSource paramSource, ResultSetExtractor rse) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  rse - object that will extract results an arbitrary result object, as returned by the ResultSetExtractor
throws:
  DataAccessException - if the query fails



query
Object query(String sql, Map paramMap, ResultSetExtractor rse) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  rse - object that will extract results an arbitrary result object, as returned by the ResultSetExtractor
throws:
  org.springframework.dao.DataAccessException - if the query fails



query
void query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  rch - object that will extract results, one row at a time
throws:
  DataAccessException - if the query fails



query
void query(String sql, Map paramMap, RowCallbackHandler rch) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet on a per-row basis with a RowCallbackHandler.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  rch - object that will extract results, one row at a time
throws:
  org.springframework.dao.DataAccessException - if the query fails



query
List query(String sql, SqlParameterSource paramSource, RowMapper rowMapper) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  rowMapper - object that will map one object per row the result List, containing mapped objects
throws:
  org.springframework.dao.DataAccessException - if the query fails



query
List query(String sql, Map paramMap, RowMapper rowMapper) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping each row to a Java object via a RowMapper.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  rowMapper - object that will map one object per row the result List, containing mapped objects
throws:
  org.springframework.dao.DataAccessException - if the query fails



queryForInt
int queryForInt(String sql, SqlParameterSource paramSource) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query the int value, or 0 in case of SQL NULL
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not returnexactly one row, or does not return exactly one column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForInt(String)




queryForInt
int queryForInt(String sql, Map paramMap) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.

The query is expected to be a single row/single column query that results in an int value.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type) the int value, or 0 in case of SQL NULL
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not returnexactly one row, or does not return exactly one column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForInt(String)




queryForList
List queryForList(String sql, SqlParameterSource paramSource, Class elementType) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  elementType - the required type of element in the result list(for example, Integer.class) a List of objects that match the specified element type
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForList(StringClass)
See Also:   org.springframework.jdbc.core.SingleColumnRowMapper




queryForList
List queryForList(String sql, Map paramMap, Class elementType) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of result objects, each of them matching the specified element type.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  elementType - the required type of element in the result list(for example, Integer.class) a List of objects that match the specified element type
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForList(StringClass)
See Also:   org.springframework.jdbc.core.SingleColumnRowMapper




queryForList
List queryForList(String sql, SqlParameterSource paramSource) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Thus Each element in the list will be of the form returned by this interface's queryForMap() methods.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query a List that contains a Map per row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForList(String)




queryForList
List queryForList(String sql, Map paramMap) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result list.

The results will be mapped to a List (one entry for each row) of Maps (one entry for each column, using the column name as the key). Each element in the list will be of the form returned by this interface's queryForMap() methods.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type) a List that contains a Map per row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForList(String)




queryForLong
long queryForLong(String sql, SqlParameterSource paramSource) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query the long value, or 0 in case of SQL NULL
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForLong(String)




queryForLong
long queryForLong(String sql, Map paramMap) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in a long value.

The query is expected to be a single row/single column query that results in a long value.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type) the long value, or 0 in case of SQL NULL
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForLong(String)




queryForMap
Map queryForMap(String sql, SqlParameterSource paramSource) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query the result Map (one entry for each column, using the column name as the key)
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForMap(String)
See Also:   org.springframework.jdbc.core.ColumnMapRowMapper




queryForMap
Map queryForMap(String sql, Map paramMap) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result Map. The queryForMap() methods defined by this interface are appropriate when you don't have a domain model. Otherwise, consider using one of the queryForObject() methods.

The query is expected to be a single row query; the result row will be mapped to a Map (one entry for each column, using the column name as the key).
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type) the result Map (one entry for each column, using the column name as the key)
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForMap(String)
See Also:   org.springframework.jdbc.core.ColumnMapRowMapper




queryForObject
Object queryForObject(String sql, SqlParameterSource paramSource, RowMapper rowMapper) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  rowMapper - object that will map one object per row the single mapped object
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails



queryForObject
Object queryForObject(String sql, Map paramMap, RowMapper rowMapper) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, mapping a single result row to a Java object via a RowMapper.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  rowMapper - object that will map one object per row the single mapped object
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails



queryForObject
Object queryForObject(String sql, SqlParameterSource paramSource, Class requiredType) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query
Parameters:
  requiredType - the type that the result object is expected to match the result object of the required type, or null in case of SQL NULL
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForObject(StringClass)




queryForObject
Object queryForObject(String sql, Map paramMap, Class requiredType) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a result object.

The query is expected to be a single row/single column query; the returned result will be directly mapped to the corresponding object type.
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type)
Parameters:
  requiredType - the type that the result object is expected to match the result object of the required type, or null in case of SQL NULL
throws:
  org.springframework.dao.IncorrectResultSizeDataAccessException - if the query does not return exactly one row, or does not return exactlyone column in that row
throws:
  org.springframework.dao.DataAccessException - if the query fails
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForObject(StringClass)




queryForRowSet
SqlRowSet queryForRowSet(String sql, SqlParameterSource paramSource) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).
Parameters:
  sql - SQL query to execute
Parameters:
  paramSource - container of arguments to bind to the query a SqlRowSet representation (possibly a wrapper around ajavax.sql.rowset.CachedRowSet)
throws:
  org.springframework.dao.DataAccessException - if there is any problem executing the query
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForRowSet(String)
See Also:   org.springframework.jdbc.core.SqlRowSetResultSetExtractor
See Also:   javax.sql.rowset.CachedRowSet




queryForRowSet
SqlRowSet queryForRowSet(String sql, Map paramMap) throws DataAccessException(Code)
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, expecting a SqlRowSet.

The results will be mapped to an SqlRowSet which holds the data in a disconnected fashion. This wrapper will translate any SQLExceptions thrown.

Note that that, for the default implementation, JDBC RowSet support needs to be available at runtime: by default, Sun's com.sun.rowset.CachedRowSetImpl class is used, which is part of JDK 1.5+ and also available separately as part of Sun's JDBC RowSet Implementations download (rowset.jar).
Parameters:
  sql - SQL query to execute
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type) a SqlRowSet representation (possibly a wrapper around ajavax.sql.rowset.CachedRowSet)
throws:
  org.springframework.dao.DataAccessException - if there is any problem executing the query
See Also:   org.springframework.jdbc.core.JdbcTemplate.queryForRowSet(String)
See Also:   org.springframework.jdbc.core.SqlRowSetResultSetExtractor
See Also:   javax.sql.rowset.CachedRowSet




update
int update(String sql, SqlParameterSource paramSource) throws DataAccessException(Code)
Issue an update via a prepared statement, binding the given arguments.
Parameters:
  sql - SQL containing named parameters
Parameters:
  paramSource - container of arguments and SQL types to bind to the query the number of rows affected
throws:
  org.springframework.dao.DataAccessException - if there is any problem issuing the update



update
int update(String sql, Map paramMap) throws DataAccessException(Code)
Issue an update via a prepared statement, binding the given arguments.
Parameters:
  sql - SQL containing named parameters
Parameters:
  paramMap - map of parameters to bind to the query(leaving it to the PreparedStatement to guess the corresponding SQL type) the number of rows affected
throws:
  org.springframework.dao.DataAccessException - if there is any problem issuing the update



update
int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder) throws DataAccessException(Code)
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
Parameters:
  sql - SQL containing named parameters
Parameters:
  paramSource - container of arguments and SQL types to bind to the query
Parameters:
  generatedKeyHolder - KeyHolder that will hold the generated keys the number of rows affected
throws:
  org.springframework.dao.DataAccessException - if there is any problem issuing the update
See Also:   MapSqlParameterSource
See Also:   org.springframework.jdbc.support.GeneratedKeyHolder



update
int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames) throws DataAccessException(Code)
Issue an update via a prepared statement, binding the given arguments, returning generated keys.
Parameters:
  sql - SQL containing named parameters
Parameters:
  paramSource - container of arguments and SQL types to bind to the query
Parameters:
  generatedKeyHolder - KeyHolder that will hold the generated keys
Parameters:
  keyColumnNames - names of the columns that will have keys generated for them the number of rows affected
throws:
  org.springframework.dao.DataAccessException - if there is any problem issuing the update
See Also:   MapSqlParameterSource
See Also:   org.springframework.jdbc.support.GeneratedKeyHolder



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