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


org.springframework.jdbc.support.lob.LobCreator

LobCreator
public interface LobCreator (Code)
Interface that abstracts potentially database-specific creation of large binary fields and large text fields. Does not work with java.sql.Blob and java.sql.Clob instances in the API, as some JDBC drivers do not support these types as such.

A LobCreator represents a session for creating BLOBs: It is not thread-safe and needs to be instantiated for each statement execution or for each transaction. Each LobCreator needs to be closed after completion.

For convenient working with a PreparedStatement and a LobCreator, consider JdbcTemplate with a AbstractLobCreatingPreparedStatementCallback implementation. See the latter's javadoc for details.
author:
   Juergen Hoeller
since:
   04.12.2003
See Also:   LobCreator.close
See Also:   LobHandler.getLobCreator
See Also:   org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback
See Also:   DefaultLobHandler.DefaultLobCreator
See Also:   OracleLobHandler.OracleLobCreator
See Also:   java.sql.PreparedStatement.setBlob
See Also:   java.sql.PreparedStatement.setClob
See Also:   java.sql.PreparedStatement.setBytes
See Also:   java.sql.PreparedStatement.setBinaryStream
See Also:   java.sql.PreparedStatement.setString
See Also:   java.sql.PreparedStatement.setAsciiStream
See Also:   java.sql.PreparedStatement.setCharacterStream





Method Summary
 voidclose()
     Close this LobCreator session and free its temporarily created BLOBs and CLOBs.
 voidsetBlobAsBinaryStream(PreparedStatement ps, int paramIndex, InputStream contentStream, int contentLength)
     Set the given content as binary stream on the given statement, using the given parameter index.
 voidsetBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content)
     Set the given content as bytes on the given statement, using the given parameter index.
 voidsetClobAsAsciiStream(PreparedStatement ps, int paramIndex, InputStream asciiStream, int contentLength)
     Set the given content as ASCII stream on the given statement, using the given parameter index.
 voidsetClobAsCharacterStream(PreparedStatement ps, int paramIndex, Reader characterStream, int contentLength)
     Set the given content as character stream on the given statement, using the given parameter index.
 voidsetClobAsString(PreparedStatement ps, int paramIndex, String content)
     Set the given content as String on the given statement, using the given parameter index.



Method Detail
close
void close()(Code)
Close this LobCreator session and free its temporarily created BLOBs and CLOBs. Will not need to do anything if using PreparedStatement's standard methods, but might be necessary to free database resources if using proprietary means.

NOTE: Needs to be invoked after the involved PreparedStatements have been executed or the affected O/R mapping sessions have been flushed. Else, the database resources for the temporary BLOBs might stay allocated.




setBlobAsBinaryStream
void setBlobAsBinaryStream(PreparedStatement ps, int paramIndex, InputStream contentStream, int contentLength) throws SQLException(Code)
Set the given content as binary stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBinaryStream or create a Blob instance for it, depending on the database and driver.
Parameters:
  ps - the PreparedStatement to the set the content on
Parameters:
  paramIndex - the parameter index to use
Parameters:
  contentStream - the content as binary stream, or null for SQL NULL
throws:
  SQLException - if thrown by JDBC methods
See Also:   java.sql.PreparedStatement.setBinaryStream



setBlobAsBytes
void setBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content) throws SQLException(Code)
Set the given content as bytes on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setBytes or create a Blob instance for it, depending on the database and driver.
Parameters:
  ps - the PreparedStatement to the set the content on
Parameters:
  paramIndex - the parameter index to use
Parameters:
  content - the content as byte array, or null for SQL NULL
throws:
  SQLException - if thrown by JDBC methods
See Also:   java.sql.PreparedStatement.setBytes



setClobAsAsciiStream
void setClobAsAsciiStream(PreparedStatement ps, int paramIndex, InputStream asciiStream, int contentLength) throws SQLException(Code)
Set the given content as ASCII stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setAsciiStream or create a Clob instance for it, depending on the database and driver.
Parameters:
  ps - the PreparedStatement to the set the content on
Parameters:
  paramIndex - the parameter index to use
Parameters:
  asciiStream - the content as ASCII stream, or null for SQL NULL
throws:
  SQLException - if thrown by JDBC methods
See Also:   java.sql.PreparedStatement.setAsciiStream



setClobAsCharacterStream
void setClobAsCharacterStream(PreparedStatement ps, int paramIndex, Reader characterStream, int contentLength) throws SQLException(Code)
Set the given content as character stream on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setCharacterStream or create a Clob instance for it, depending on the database and driver.
Parameters:
  ps - the PreparedStatement to the set the content on
Parameters:
  paramIndex - the parameter index to use
Parameters:
  characterStream - the content as character stream, or null for SQL NULL
throws:
  SQLException - if thrown by JDBC methods
See Also:   java.sql.PreparedStatement.setCharacterStream



setClobAsString
void setClobAsString(PreparedStatement ps, int paramIndex, String content) throws SQLException(Code)
Set the given content as String on the given statement, using the given parameter index. Might simply invoke PreparedStatement.setString or create a Clob instance for it, depending on the database and driver.
Parameters:
  ps - the PreparedStatement to the set the content on
Parameters:
  paramIndex - the parameter index to use
Parameters:
  content - the content as String, or null for SQL NULL
throws:
  SQLException - if thrown by JDBC methods
See Also:   java.sql.PreparedStatement.setBytes



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