|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.riverock.dbrevision.utils.DbUtils
public class DbUtils
Constructor Summary | |
---|---|
DbUtils()
|
Method Summary | |
---|---|
static void |
close(Connection conn)
|
static void |
close(ResultSet rs,
Statement st)
|
static void |
close(Statement st)
|
static Boolean |
getBoolean(ResultSet rs,
String f)
String f - name of field |
static Boolean |
getBoolean(ResultSet rs,
String f,
Boolean def)
|
static Integer |
getInteger(ResultSet rs,
String f)
ResultSet rs - ResultSet String f - name of field |
static Integer |
getInteger(ResultSet rs,
String f,
Integer def)
ResultSet rs - ResultSet String f - name of field int def - default value |
static Long |
getLong(ResultSet rs,
String f)
String f - name of field |
static Long |
getLong(ResultSet rs,
String f,
Long def)
|
static Long |
getLongValue(Connection conn,
String sql,
Object[] params,
int[] types)
Get result of query as Long |
static String |
getString(ResultSet rs,
String f)
ResultSet rs - ResultSet String f - name of field |
static String |
getString(ResultSet rs,
String f,
String def)
ResultSet rs - ResultSet String f - name of field String def - default value |
static int |
runSQL(Connection conn,
String query,
Object[] params,
int[] types)
выполнить sql |
static void |
setLong(PreparedStatement ps,
int index,
Long data)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DbUtils()
Method Detail |
---|
public static Long getLongValue(Connection conn, String sql, Object[] params, int[] types) throws SQLException
conn
- db connectionsql
- query stringparams
- query parameterstypes
- parameters types
SQLException
- on errorpublic static int runSQL(Connection conn, String query, Object[] params, int[] types) throws SQLException
conn
- connectionquery
- sqlparams
- parameterstypes
- types of parameters
SQLException
- on errorpublic static void setLong(PreparedStatement ps, int index, Long data) throws SQLException
SQLException
public static Boolean getBoolean(ResultSet rs, String f) throws SQLException
rs
- ResultSetf
- name of field
SQLException
- on errorpublic static Boolean getBoolean(ResultSet rs, String f, Boolean def) throws SQLException
rs
- - ResultSetf
- - name of fielddef
- - default value
SQLException
- on errorpublic static Long getLong(ResultSet rs, String f) throws SQLException
rs
- ResultSetf
- name of field
SQLException
- on errorpublic static Long getLong(ResultSet rs, String f, Long def) throws SQLException
rs
- - ResultSetf
- - name of fielddef
- - default value
SQLException
- on errorpublic static Integer getInteger(ResultSet rs, String f) throws SQLException
SQLException
public static Integer getInteger(ResultSet rs, String f, Integer def) throws SQLException
SQLException
public static String getString(ResultSet rs, String f) throws SQLException
SQLException
public static String getString(ResultSet rs, String f, String def) throws SQLException
SQLException
public static void close(ResultSet rs, Statement st)
public static void close(Statement st)
public static void close(Connection conn)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |