org.onemind.commons.java.sql
public final class JdbcUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Map |
CLASS_TO_TYPE_MAP
map the java classes to jdbc type int *
|
Modifier | Constructor and Description |
---|---|
private |
JdbcUtils() |
Modifier and Type | Method and Description |
---|---|
static MetaData |
getMetaData(java.sql.ResultSetMetaData meta,
java.lang.String name)
return the MetaData
|
static MetaData |
getMetaData(java.sql.ResultSet rst,
java.lang.String name)
Get the MetaData from the resultset
|
static boolean |
isJdbcType(java.lang.Class c)
Return whether a java type is a jdbc type
|
static int |
toJdbcType(java.lang.Class c)
Return the jdbc type given the java type (based on JDBC spec)
|
public static final java.util.Map CLASS_TO_TYPE_MAP
public static MetaData getMetaData(java.sql.ResultSet rst, java.lang.String name) throws java.sql.SQLException
rst
- the result setname
- the name of metadata to createjava.sql.SQLException
- if there's database problempublic static MetaData getMetaData(java.sql.ResultSetMetaData meta, java.lang.String name) throws java.sql.SQLException
meta
- the resultset metadataname
- the namejava.sql.SQLException
- if there's database problempublic static int toJdbcType(java.lang.Class c)
c
- the java classpublic static boolean isJdbcType(java.lang.Class c)
c
- the class