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


org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor

All known Subclasses:   org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter,
NativeJdbcExtractor
public interface NativeJdbcExtractor (Code)
Interface for extracting native JDBC objects from wrapped objects coming from connection pools. This is necessary to be able to case to native implementations like OracleConnection or OracleResultSet in application code, for example to create Blobs or access other vendor-specific features.

Note: Setting a custom NativeJdbcExtractor is just necessary if you want to cast to database-specific implementations, like OracleConnection/OracleResultSet. Else, any wrapped JDBC object will be fine.

Note: To be able to support any pool's strategy of native ResultSet wrapping, it is advisable to get both the native Statement and the native ResultSet via this extractor. Some pools just allow to unwrap the Statement, some just to unwrap the ResultSet - the above strategy will cover both. It is typically not necessary to unwrap the Connection to retrieve a native ResultSet.

When working with a simple connection pool that wraps Connections but not Statements, a SimpleNativeJdbcExtractor is often sufficient. However, some pools (like Jakarta's Commons DBCP) wrap all JDBC objects that they return: Therefore, you need to use a specific NativeJdbcExtractor (like CommonsDbcpNativeJdbcExtractor) with them.

JdbcTemplate can properly apply a NativeJdbcExtractor if specified, correctly unwrapping all JDBC objects that it creates. Note that this is just necessary if you want to cast to native implementations in your data access code.

The Oracle-specific implementation of Spring's LobHandler interface needs a NativeJdbcExtractor to be able to work on the native OracleConnection. This is also necessary for other Oracle-specific features that you may want to leverage in your applications, such as InterMedia.
author:
   Juergen Hoeller
since:
   25.08.2003
See Also:   SimpleNativeJdbcExtractor
See Also:   CommonsDbcpNativeJdbcExtractor
See Also:   org.springframework.jdbc.core.JdbcTemplate.setNativeJdbcExtractor
See Also:   org.springframework.jdbc.support.lob.OracleLobHandler.setNativeJdbcExtractor





Method Summary
 CallableStatementgetNativeCallableStatement(CallableStatement cs)
     Retrieve the underlying native JDBC CallableStatement for the given statement.
 ConnectiongetNativeConnection(Connection con)
     Retrieve the underlying native JDBC Connection for the given Connection.
 ConnectiongetNativeConnectionFromStatement(Statement stmt)
     Retrieve the underlying native JDBC Connection for the given Statement. Supposed to return the Statement.getConnection() if not capable of unwrapping.

Having this extra method allows for more efficient unwrapping if data access code already has a Statement.

 PreparedStatementgetNativePreparedStatement(PreparedStatement ps)
     Retrieve the underlying native JDBC PreparedStatement for the given statement.
 ResultSetgetNativeResultSet(ResultSet rs)
     Retrieve the underlying native JDBC ResultSet for the given statement.
 StatementgetNativeStatement(Statement stmt)
     Retrieve the underlying native JDBC Statement for the given Statement.
 booleanisNativeConnectionNecessaryForNativeCallableStatements()
     Return whether it is necessary to work on the native Connection to receive native CallableStatements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its CallableStatement wrappers but supports a way to retrieve the native JDBC Connection.

 booleanisNativeConnectionNecessaryForNativePreparedStatements()
     Return whether it is necessary to work on the native Connection to receive native PreparedStatements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its PreparedStatement wrappers but supports a way to retrieve the native JDBC Connection.

 booleanisNativeConnectionNecessaryForNativeStatements()
     Return whether it is necessary to work on the native Connection to receive native Statements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its Statement wrapper but supports a way to retrieve the native JDBC Connection.




Method Detail
getNativeCallableStatement
CallableStatement getNativeCallableStatement(CallableStatement cs) throws SQLException(Code)
Retrieve the underlying native JDBC CallableStatement for the given statement. Supposed to return the given CallableStatement if not capable of unwrapping.
Parameters:
  cs - the CallableStatement handle, potentially wrapped by a connection pool the underlying native JDBC CallableStatement, if possible;else, the original Connection
throws:
  SQLException - if thrown by JDBC methods



getNativeConnection
Connection getNativeConnection(Connection con) throws SQLException(Code)
Retrieve the underlying native JDBC Connection for the given Connection. Supposed to return the given Connection if not capable of unwrapping.
Parameters:
  con - the Connection handle, potentially wrapped by a connection pool the underlying native JDBC Connection, if possible;else, the original Connection
throws:
  SQLException - if thrown by JDBC methods



getNativeConnectionFromStatement
Connection getNativeConnectionFromStatement(Statement stmt) throws SQLException(Code)
Retrieve the underlying native JDBC Connection for the given Statement. Supposed to return the Statement.getConnection() if not capable of unwrapping.

Having this extra method allows for more efficient unwrapping if data access code already has a Statement. Statement.getConnection() often returns the native JDBC Connection even if the Statement itself is wrapped by a pool.
Parameters:
  stmt - the Statement handle, potentially wrapped by a connection pool the underlying native JDBC Connection, if possible;else, the original Connection
throws:
  SQLException - if thrown by JDBC methods




getNativePreparedStatement
PreparedStatement getNativePreparedStatement(PreparedStatement ps) throws SQLException(Code)
Retrieve the underlying native JDBC PreparedStatement for the given statement. Supposed to return the given PreparedStatement if not capable of unwrapping.
Parameters:
  ps - the PreparedStatement handle, potentially wrapped by a connection pool the underlying native JDBC PreparedStatement, if possible;else, the original Connection
throws:
  SQLException - if thrown by JDBC methods



getNativeResultSet
ResultSet getNativeResultSet(ResultSet rs) throws SQLException(Code)
Retrieve the underlying native JDBC ResultSet for the given statement. Supposed to return the given ResultSet if not capable of unwrapping.
Parameters:
  rs - the ResultSet handle, potentially wrapped by a connection pool the underlying native JDBC ResultSet, if possible;else, the original Connection
throws:
  SQLException - if thrown by JDBC methods



getNativeStatement
Statement getNativeStatement(Statement stmt) throws SQLException(Code)
Retrieve the underlying native JDBC Statement for the given Statement. Supposed to return the given Statement if not capable of unwrapping.
Parameters:
  stmt - the Statement handle, potentially wrapped by a connection pool the underlying native JDBC Statement, if possible;else, the original Connection
throws:
  SQLException - if thrown by JDBC methods



isNativeConnectionNecessaryForNativeCallableStatements
boolean isNativeConnectionNecessaryForNativeCallableStatements()(Code)
Return whether it is necessary to work on the native Connection to receive native CallableStatements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its CallableStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.




isNativeConnectionNecessaryForNativePreparedStatements
boolean isNativeConnectionNecessaryForNativePreparedStatements()(Code)
Return whether it is necessary to work on the native Connection to receive native PreparedStatements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its PreparedStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.




isNativeConnectionNecessaryForNativeStatements
boolean isNativeConnectionNecessaryForNativeStatements()(Code)
Return whether it is necessary to work on the native Connection to receive native Statements.

This should be true if the connection pool does not allow to extract the native JDBC objects from its Statement wrapper but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.




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