Package org.onemind.commons.java.sql
Class JdbcUtils
- java.lang.Object
-
- org.onemind.commons.java.sql.JdbcUtils
-
public final class JdbcUtils extends java.lang.Object
JDBC utilities- Version:
- $Id: JdbcUtils.java,v 1.3 2004/10/23 15:25:44 thlee Exp $ $Name: $
- Author:
- TiongHiang Lee (thlee@onemindsoft.org)
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map
CLASS_TO_TYPE_MAP
map the java classes to jdbc type int *
-
Constructor Summary
Constructors Modifier Constructor Description private
JdbcUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MetaData
getMetaData(java.sql.ResultSetMetaData meta, java.lang.String name)
return the MetaDatastatic MetaData
getMetaData(java.sql.ResultSet rst, java.lang.String name)
Get the MetaData from the resultsetstatic boolean
isJdbcType(java.lang.Class c)
Return whether a java type is a jdbc typestatic int
toJdbcType(java.lang.Class c)
Return the jdbc type given the java type (based on JDBC spec)
-
-
-
Method Detail
-
getMetaData
public static MetaData getMetaData(java.sql.ResultSet rst, java.lang.String name) throws java.sql.SQLException
Get the MetaData from the resultset- Parameters:
rst
- the result setname
- the name of metadata to create- Returns:
- the metadata
- Throws:
java.sql.SQLException
- if there's database problem
-
getMetaData
public static MetaData getMetaData(java.sql.ResultSetMetaData meta, java.lang.String name) throws java.sql.SQLException
return the MetaData- Parameters:
meta
- the resultset metadataname
- the name- Returns:
- the meta data
- Throws:
java.sql.SQLException
- if there's database problem
-
toJdbcType
public static int toJdbcType(java.lang.Class c)
Return the jdbc type given the java type (based on JDBC spec)- Parameters:
c
- the java class- Returns:
- the jdbc type
-
isJdbcType
public static boolean isJdbcType(java.lang.Class c)
Return whether a java type is a jdbc type- Parameters:
c
- the class- Returns:
- true if it's jdbc type
-
-