|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.webapp.qsql.JdbcUtil
public class JdbcUtil
Utility class for JDBC code.
Datadict table ALL_PROCEDURES contains all SP's in packages. The parameters for SPs can be glanced from ALL_ARGUMENTS; something odd so far is that doing a selection:
select * from sys.all_arguments where owner='DECADE' and package_name='GEBRUI' and object_name='LEES100';returns data that seem to indicate that the SP exists as a 2-parameter version but also an expanded version having all parameter fields.
Field Summary | |
---|---|
static org.slf4j.Logger |
LOG
|
Method Summary | ||
---|---|---|
static boolean |
executeStatement(java.sql.Connection dbc,
java.lang.String sql,
java.lang.Object... args)
|
|
static
|
oracleSpCall(java.sql.Connection con,
java.lang.Class<T> rtype,
java.lang.String sp,
java.lang.Object... args)
Provides interface to call Oracle stored procedures and functions. |
|
static boolean |
oracleSpCallReturningBool(java.sql.Connection con,
java.lang.String sp,
java.lang.Object... args)
Similar as oracleSpCall(Connection, Class, String, Object...) ,
adjusted to handle returning of oracle boolean type properly. |
|
static java.util.List<JdbcAnyRecord> |
queryAny(java.sql.Connection dbc,
java.lang.String select,
java.lang.Object... parameters)
|
|
static java.util.List<JdbcAnyRecord> |
queryAny(java.lang.String tblname,
java.sql.ResultSet rs)
|
|
static JdbcAnyRecord |
queryAnyOne(java.sql.Connection dbc,
java.lang.String select,
java.lang.Object... parameters)
|
|
static JdbcAnyRecord |
queryAnyOne(java.lang.String tblname,
java.sql.ResultSet rs)
|
|
static void |
readParameters(java.sql.PreparedStatement ps,
int startindex,
java.lang.Object[] params)
|
|
static
|
selectOne(java.sql.Connection connection,
java.lang.Class<T> clz,
java.lang.String select,
java.lang.Object... params)
Quick method to select a single value of a given type from the database. |
|
static
|
selectSingleColumnList(java.sql.Connection connection,
java.lang.Class<T> clz,
java.lang.String select,
java.lang.Object... params)
Quick method to select a single value of a given type from the database. |
|
static void |
setDateTruncated(java.sql.PreparedStatement ps,
int index,
java.util.Date value)
Sets a truncated date containing only the date part and a zero time. |
|
static void |
setDouble(java.sql.PreparedStatement ps,
int index,
java.lang.Double value)
|
|
static void |
setFK(java.sql.PreparedStatement ps,
int index,
ILongIdentifyable foreigner)
|
|
static void |
setInteger(java.sql.PreparedStatement ps,
int index,
java.lang.Integer value)
|
|
static void |
setLong(java.sql.PreparedStatement ps,
int index,
java.lang.Long value)
|
|
static void |
setParameters(java.sql.PreparedStatement ps,
int startindex,
java.lang.Object[] params)
|
|
static void |
setString(java.sql.PreparedStatement ps,
int index,
java.lang.String value)
|
|
static void |
setStringTruncated(java.sql.PreparedStatement ps,
int index,
java.lang.String value,
int maxlen)
|
|
static void |
setTimestamp(java.sql.PreparedStatement ps,
int index,
java.util.Date value)
Sets a TIMESTAMP value containing both TIME and DATE values. |
|
static void |
setYN(java.sql.PreparedStatement ps,
int index,
java.lang.Boolean value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.slf4j.Logger LOG
Method Detail |
---|
public static void setLong(java.sql.PreparedStatement ps, int index, java.lang.Long value) throws java.sql.SQLException
java.sql.SQLException
public static void setInteger(java.sql.PreparedStatement ps, int index, java.lang.Integer value) throws java.sql.SQLException
java.sql.SQLException
public static void setDouble(java.sql.PreparedStatement ps, int index, java.lang.Double value) throws java.sql.SQLException
java.sql.SQLException
public static void setTimestamp(java.sql.PreparedStatement ps, int index, java.util.Date value) throws java.sql.SQLException
ps
- index
- value
-
java.sql.SQLException
public static void setDateTruncated(java.sql.PreparedStatement ps, int index, java.util.Date value) throws java.sql.SQLException
ps
- index
- value
-
java.sql.SQLException
public static void setString(java.sql.PreparedStatement ps, int index, java.lang.String value) throws java.sql.SQLException
java.sql.SQLException
public static void setStringTruncated(java.sql.PreparedStatement ps, int index, java.lang.String value, int maxlen) throws java.sql.SQLException
java.sql.SQLException
public static void setYN(java.sql.PreparedStatement ps, int index, java.lang.Boolean value) throws java.sql.SQLException
java.sql.SQLException
public static void setFK(java.sql.PreparedStatement ps, int index, ILongIdentifyable foreigner) throws java.sql.SQLException
java.sql.SQLException
public static <T> T selectOne(java.sql.Connection connection, java.lang.Class<T> clz, java.lang.String select, java.lang.Object... params) throws java.sql.SQLException
connection
- clz
- select
-
java.sql.SQLException
public static <T> java.util.List<T> selectSingleColumnList(java.sql.Connection connection, java.lang.Class<T> clz, java.lang.String select, java.lang.Object... params) throws java.sql.SQLException
connection
- clz
- select
-
java.sql.SQLException
public static void setParameters(java.sql.PreparedStatement ps, int startindex, java.lang.Object[] params) throws java.sql.SQLException
java.sql.SQLException
public static void readParameters(java.sql.PreparedStatement ps, int startindex, java.lang.Object[] params) throws java.sql.SQLException
java.sql.SQLException
public static java.util.List<JdbcAnyRecord> queryAny(java.sql.Connection dbc, java.lang.String select, java.lang.Object... parameters) throws java.sql.SQLException
java.sql.SQLException
public static java.util.List<JdbcAnyRecord> queryAny(java.lang.String tblname, java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public static JdbcAnyRecord queryAnyOne(java.sql.Connection dbc, java.lang.String select, java.lang.Object... parameters) throws java.sql.SQLException
java.sql.SQLException
public static JdbcAnyRecord queryAnyOne(java.lang.String tblname, java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public static boolean executeStatement(java.sql.Connection dbc, java.lang.String sql, java.lang.Object... args) throws java.sql.SQLException
java.sql.SQLException
public static <T> T oracleSpCall(java.sql.Connection con, java.lang.Class<T> rtype, java.lang.String sp, java.lang.Object... args) throws java.sql.SQLException
oracleSpCallReturningBool(Connection, String, Object...)
Support all three type of parameters:JdbcOutParam
JdbcInOutParam
T
- Oracle function return value typecon
- Db connectionrtype
- Oracle function return typesp
- Stored procedure / function nameargs
- Stored procedure / function parameters
java.sql.SQLException
public static boolean oracleSpCallReturningBool(java.sql.Connection con, java.lang.String sp, java.lang.Object... args) throws java.sql.SQLException
oracleSpCall(Connection, Class, String, Object...)
,
adjusted to handle returning of oracle boolean type properly.
con
- sp
- args
- For hanlding IN/OUT/IN OUT params see oracleSpCall(Connection, Class, String, Object...)
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |