|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.JdbcUtil
Various JDBC utilities.
Field Summary | |
static java.lang.String |
ARG_ARG1
|
static java.lang.String |
ARG_ARG2
|
static java.lang.String |
ARG_ARG3
|
static java.lang.String |
ARG_DATABASE
|
static java.lang.String |
ARG_DRIVER_CLASS
|
static java.lang.String |
ARG_DRIVER_PREFIX
|
static java.lang.String |
ARG_HOST
|
static java.lang.String |
ARG_PARAMS
|
static java.lang.String |
ARG_PASSWORD
|
static java.lang.String |
ARG_PORT
|
static java.lang.String |
ARG_SQL
|
static java.lang.String |
ARG_TYPE
|
static java.lang.String |
ARG_URL
|
static java.lang.String |
ARG_USER
|
static java.lang.String |
code_id
|
static java.lang.String |
ORACLE_DRIVER
|
static java.lang.String |
ORACLE_PREFIX
|
static java.lang.String |
ORACLE_URL
|
static java.lang.String |
TYPE_ORACLE
|
Constructor Summary | |
JdbcUtil()
|
Method Summary | |
static void |
closeConnection(java.sql.Connection con)
Close a connection quietly. |
static void |
closeResult(java.sql.ResultSet res)
Close a result, quietly. |
static void |
closeStatement(java.sql.PreparedStatement stmt)
Close a statement quietly. |
static void |
dumpArguments(java.lang.String method,
java.util.Map map)
|
static java.lang.String |
formatUrl(java.lang.String template,
java.lang.String host,
java.lang.String port,
java.lang.String database)
Given a URL template and arguments, format a template. |
static java.sql.Connection |
getConnection(java.util.Map args)
Establish a connection. |
static javax.sql.DataSource |
getDataSourceObject(java.lang.String factoryClass,
java.lang.String path)
Retrieves a JDBC 2.0 DataSource using JNDI. |
static javax.sql.DataSource |
getDataSourceObject(java.lang.String factoryClass,
java.lang.String path,
java.util.Properties props)
Retrieves a JDBC 2.0 DataSource using JNDI. |
static javax.sql.DataSource |
getDataSourceObject(java.lang.String factoryClass,
java.lang.String path,
java.lang.String providerUrl)
Retrieves a JDBC 2.0 DataSource using JNDI. |
static java.sql.Clob |
parameterizedQueryClob(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return the value of the first column in the first result row as a Clob. |
static java.lang.String |
parameterizedQueryClobString(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return the value of the first (Clob) column in the first result row as a String. |
static java.util.Date |
parameterizedQueryDate(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return the value of the first column in the first result row as a Date. |
static int |
parameterizedQueryInt(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return the value of the first column in the first result row as an int. |
static java.util.List |
parameterizedQueryList(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return a List of the first columns in each row. |
static java.util.List |
parameterizedQueryRecords(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return a List of Maps containing the data for each matching row. |
static java.lang.String |
parameterizedQueryString(java.sql.Connection c,
java.lang.String q,
java.util.List params)
Run a query and return the value of the first column in the first result row as a String. |
static void |
parameterizedSql(java.sql.Connection c,
java.lang.String stmt,
java.util.List params)
Run specified SQL without obtaining a result. |
static int |
parameterizedUpdate(java.sql.Connection c,
java.lang.String stmt,
java.util.List params)
Run specified DML, returning number of affected rows. |
static java.sql.Clob |
queryClob(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return the value of the first column in the first result row as a Clob. |
static java.sql.Clob |
queryClob(java.util.Map args)
Run a query and return the value of the first column in the first result row as a Clob. |
static java.lang.String |
queryClobString(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return the value of the first (Clob) column in the first result row as a String. |
static java.lang.String |
queryClobString(java.util.Map args)
Run a query and return the value of the first (Clob) column in the first result row as a String. |
static java.util.Date |
queryDate(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return the value of the first column in the first result row as a Date. |
static java.util.Date |
queryDate(java.util.Map args)
Run a query and return the value of the first column in the first result row as a Date. |
static int |
queryInt(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return the value of the first column in the first result row as an int. |
static int |
queryInt(java.util.Map args)
Run a query and return the value of the first column in the first result row as an int. |
static java.util.List |
queryList(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return a List of the first columns in each row. |
static java.util.List |
queryList(java.util.Map args)
Run a query and return a List of the first columns in each row. |
static java.util.List |
queryRecords(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return a List of Maps containing the data for each matching row. |
static java.util.List |
queryRecords(java.util.Map args)
Run a query and return a List of Maps containing the data for each matching row. |
static java.lang.String |
queryString(java.sql.Connection c,
java.lang.String q,
java.lang.String arg)
Run a query and return the value of the first column in the first result row as a String. |
static java.lang.String |
queryString(java.util.Map args)
Run a query and return the value of the first column in the first result row as a String. |
static void |
sql(java.sql.Connection c,
java.lang.String stmt,
java.lang.String arg)
Run specified SQL without obtaining a result. |
static void |
sql(java.util.Map args)
Run specified SQL without obtaining a result. |
static void |
sqlStream(java.sql.Connection c,
java.lang.String stmt,
java.io.InputStream arg,
int len)
|
static int |
update(java.sql.Connection c,
java.lang.String stmt,
java.lang.String arg)
Run specified DML, returning number of affected rows. |
static int |
update(java.util.Map args)
Run specified DML, returning number of affected rows. |
static int |
update(java.sql.PreparedStatement s)
|
static int |
updateLong(java.sql.Connection c,
java.lang.String stmt,
java.lang.String arg)
Some drivers have a limit on the size of the string that can be passed to setString(), the older Oracle driver we use has a limit of 2000. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String ARG_TYPE
public static final java.lang.String ARG_DRIVER_CLASS
public static final java.lang.String ARG_DRIVER_PREFIX
public static final java.lang.String ARG_URL
public static final java.lang.String ARG_HOST
public static final java.lang.String ARG_PORT
public static final java.lang.String ARG_DATABASE
public static final java.lang.String ARG_USER
public static final java.lang.String ARG_PASSWORD
public static final java.lang.String ARG_SQL
public static final java.lang.String ARG_ARG1
public static final java.lang.String ARG_ARG2
public static final java.lang.String ARG_ARG3
public static final java.lang.String ARG_PARAMS
public static final java.lang.String TYPE_ORACLE
public static final java.lang.String ORACLE_DRIVER
public static final java.lang.String ORACLE_PREFIX
public static final java.lang.String ORACLE_URL
Constructor Detail |
public JdbcUtil()
Method Detail |
public static void sql(java.sql.Connection c, java.lang.String stmt, java.lang.String arg) throws WavesetException
WavesetException
public static void parameterizedSql(java.sql.Connection c, java.lang.String stmt, java.util.List params) throws WavesetException
WavesetException
public static int update(java.sql.Connection c, java.lang.String stmt, java.lang.String arg) throws WavesetException
WavesetException
public static int parameterizedUpdate(java.sql.Connection c, java.lang.String stmt, java.util.List params) throws WavesetException
WavesetException
public static int updateLong(java.sql.Connection c, java.lang.String stmt, java.lang.String arg) throws WavesetException
WavesetException
public static int update(java.sql.PreparedStatement s) throws WavesetException
WavesetException
public static void sqlStream(java.sql.Connection c, java.lang.String stmt, java.io.InputStream arg, int len) throws WavesetException
WavesetException
public static int queryInt(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws WavesetException
WavesetException
public static int parameterizedQueryInt(java.sql.Connection c, java.lang.String q, java.util.List params) throws WavesetException
WavesetException
public static java.util.Date queryDate(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws java.sql.SQLException
java.sql.SQLException
public static java.util.Date parameterizedQueryDate(java.sql.Connection c, java.lang.String q, java.util.List params) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String queryString(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String parameterizedQueryString(java.sql.Connection c, java.lang.String q, java.util.List params) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Clob queryClob(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Clob parameterizedQueryClob(java.sql.Connection c, java.lang.String q, java.util.List params) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String queryClobString(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String parameterizedQueryClobString(java.sql.Connection c, java.lang.String q, java.util.List params) throws java.sql.SQLException
java.sql.SQLException
public static java.util.List queryList(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws java.sql.SQLException
java.sql.SQLException
public static java.util.List parameterizedQueryList(java.sql.Connection c, java.lang.String q, java.util.List params) throws java.sql.SQLException
java.sql.SQLException
public static java.util.List queryRecords(java.sql.Connection c, java.lang.String q, java.lang.String arg) throws java.sql.SQLException
java.sql.SQLException
public static java.util.List parameterizedQueryRecords(java.sql.Connection c, java.lang.String q, java.util.List params) throws java.sql.SQLException
java.sql.SQLException
public static javax.sql.DataSource getDataSourceObject(java.lang.String factoryClass, java.lang.String path) throws ConfigurationError
ConfigurationError
public static javax.sql.DataSource getDataSourceObject(java.lang.String factoryClass, java.lang.String path, java.lang.String providerUrl) throws ConfigurationError
ConfigurationError
public static javax.sql.DataSource getDataSourceObject(java.lang.String factoryClass, java.lang.String path, java.util.Properties props) throws ConfigurationError
ConfigurationError
public static java.lang.String formatUrl(java.lang.String template, java.lang.String host, java.lang.String port, java.lang.String database)
public static java.sql.Connection getConnection(java.util.Map args) throws WavesetException
WavesetException
public static void closeConnection(java.sql.Connection con)
public static int queryInt(java.util.Map args) throws WavesetException
WavesetException
public static java.util.Date queryDate(java.util.Map args) throws WavesetException
WavesetException
public static java.lang.String queryString(java.util.Map args) throws WavesetException
WavesetException
public static java.sql.Clob queryClob(java.util.Map args) throws WavesetException
WavesetException
public static java.lang.String queryClobString(java.util.Map args) throws WavesetException
WavesetException
public static java.util.List queryList(java.util.Map args) throws WavesetException
WavesetException
public static java.util.List queryRecords(java.util.Map args) throws WavesetException
WavesetException
public static void sql(java.util.Map args) throws WavesetException
WavesetException
public static int update(java.util.Map args) throws WavesetException
WavesetException
public static void dumpArguments(java.lang.String method, java.util.Map map)
public static void closeStatement(java.sql.PreparedStatement stmt)
public static void closeResult(java.sql.ResultSet res)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |