Java Doc for JDBCUtil.java in  » EJB-Server-JBoss-4.2.1 » server » org » jboss » ejb » plugins » cmp » jdbc » 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 » EJB Server JBoss 4.2.1 » server » org.jboss.ejb.plugins.cmp.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil

JDBCUtil
final public class JDBCUtil (Code)
JDBCUtil takes care of some of the more anoying JDBC tasks. It hanles safe closing of jdbc resources, setting statement parameters and loading query results.
author:
   Dain Sundstrom
author:
   Alex Loubyansky
author:
   Steve Coy
version:
   $Revision: 57209 $




Method Summary
public static  ObjectcoerceToSQLType(int jdbcType, Object value)
     Coerces the input value into the correct type for the specified jdbcType.
public static  byte[]convertObjectToByteArray(Object value)
     Coverts the value into a byte array.
public static  ObjectconvertToObject(byte[] input)
     Coverts the input into an object.
public static  ObjectconvertToObject(InputStream input)
     Coverts the input into an object.
public static  byte[]getByteArray(InputStream input)
     Read the entire input stream provided and return its content as a byte array. The method closes the passed in input stream!
Parameters:
  input - the InputStream from which a result isbeing retrieved.
public static  StringgetJDBCTypeName(int jdbcType)
     Gets the JDBC type name corresponding to the given type code. Only used in debug log messages.
Parameters:
  jdbcType - the integer JDBC type code.
public static  StringgetLongString(ResultSet rs, int index)
     Get the indicated result set parameter as a character stream and return it's entire content as a String.
Parameters:
  rs - the ResultSet from which a result isbeing retrieved.
Parameters:
  index - index of the result column.
public static  ObjectgetParameter(Logger log, CallableStatement cs, int index, int jdbcType, Class destination)
     Used for all retrieval of parameters from CallableStatements.
public static  JDBCParameterSettergetParameterSetter(int jdbcType, Class javaType)
    
public static  JDBCResultSetReadergetResultReaderByType(Class destination)
    
public static  JDBCResultSetReadergetResultSetReader(int jdbcType, Class destination)
    
public static  voidsafeClose(Connection con)
    
public static  voidsafeClose(ResultSet rs)
    
public static  voidsafeClose(Statement statement)
    
public static  voidsafeClose(InputStream in)
    
public static  voidsafeClose(OutputStream out)
    
public static  voidsafeClose(Reader reader)
    



Method Detail
coerceToSQLType
public static Object coerceToSQLType(int jdbcType, Object value)(Code)
Coerces the input value into the correct type for the specified jdbcType.
Parameters:
  jdbcType - the jdbc type to which the value will be assigned
Parameters:
  value - the value to coerce the corrected object



convertObjectToByteArray
public static byte[] convertObjectToByteArray(Object value) throws SQLException(Code)
Coverts the value into a byte array.
Parameters:
  value - the value to convert into a byte array the byte representation of the value
throws:
  SQLException - if a problem occures in the conversion



convertToObject
public static Object convertToObject(byte[] input) throws SQLException(Code)
Coverts the input into an object.
Parameters:
  input - the bytes to convert the object repsentation of the input stream
throws:
  SQLException - if a problem occures in the conversion



convertToObject
public static Object convertToObject(InputStream input) throws SQLException(Code)
Coverts the input into an object.
Parameters:
  input - the bytes to convert the object repsentation of the input stream
throws:
  SQLException - if a problem occures in the conversion



getByteArray
public static byte[] getByteArray(InputStream input) throws SQLException(Code)
Read the entire input stream provided and return its content as a byte array. The method closes the passed in input stream!
Parameters:
  input - the InputStream from which a result isbeing retrieved. a byte array containing the content of the input stream



getJDBCTypeName
public static String getJDBCTypeName(int jdbcType)(Code)
Gets the JDBC type name corresponding to the given type code. Only used in debug log messages.
Parameters:
  jdbcType - the integer JDBC type code. the JDBC type name.
See Also:   Types



getLongString
public static String getLongString(ResultSet rs, int index) throws SQLException(Code)
Get the indicated result set parameter as a character stream and return it's entire content as a String.
Parameters:
  rs - the ResultSet from which a result isbeing retrieved.
Parameters:
  index - index of the result column. a String containing the content of the result column



getParameter
public static Object getParameter(Logger log, CallableStatement cs, int index, int jdbcType, Class destination) throws SQLException(Code)
Used for all retrieval of parameters from CallableStatements. Implements tracing, and allows some tweaking of returned types.
Parameters:
  log - where to log to
Parameters:
  cs - the CallableStatement from which an out parameter is being retrieved
Parameters:
  index - index of the result column.
Parameters:
  jdbcType - a java.sql.Types constant used to determine themost appropriate way to extract the data from rs.
Parameters:
  destination - The class of the variable this is going into the value



getParameterSetter
public static JDBCParameterSetter getParameterSetter(int jdbcType, Class javaType)(Code)



getResultReaderByType
public static JDBCResultSetReader getResultReaderByType(Class destination)(Code)



getResultSetReader
public static JDBCResultSetReader getResultSetReader(int jdbcType, Class destination)(Code)



safeClose
public static void safeClose(Connection con)(Code)



safeClose
public static void safeClose(ResultSet rs)(Code)



safeClose
public static void safeClose(Statement statement)(Code)



safeClose
public static void safeClose(InputStream in)(Code)



safeClose
public static void safeClose(OutputStream out)(Code)



safeClose
public static void safeClose(Reader reader)(Code)



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.