public class JdbcUtil extends Object
| 构造器和说明 |
|---|
JdbcUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
closeSqlObject(Object... sqlObjs)
|
static PreparedStatement |
prepareStatement(Connection conn,
String sql,
boolean isCallable)
|
static void |
registerOutputParameters(CallableStatement cst,
int startPos,
int[] types)
注册输出参数
|
static void |
setInputParameters(PreparedStatement pst,
int startPos,
Object... params)
设置输入参数
|
static void |
setParameters(PreparedStatement pst,
Object... params)
设置查询参数
|
public static final void closeSqlObject(Object... sqlObjs)
public static final PreparedStatement prepareStatement(Connection conn, String sql, boolean isCallable) throws SQLException
conn - : Connection 对象sql - : SQL 语句isCallable - : 是否生成 CallableStatementPreparedStatement 或 CallableStatementSQLExceptionpublic static final void setParameters(PreparedStatement pst, Object... params) throws SQLException
pst - : PreparedStatementparams - : 查询参数SQLExceptionpublic static final void setInputParameters(PreparedStatement pst, int startPos, Object... params) throws SQLException
pst - : PreparedStatementstartPos - : 起始索引params - : 查询参数SQLExceptionpublic static final void registerOutputParameters(CallableStatement cst, int startPos, int[] types) throws SQLException
cst - : CallableStatementstartPos - : 起始索引types - : 参数类型数组(参考:Types)SQLExceptionCopyright © 2015 JessMA Open Source. All rights reserved.