public final class DbUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
close(java.lang.AutoCloseable... closeables) |
static <T> T[] |
getArray(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.Class<? extends T[]> cls) |
static <T> T[] |
getArray(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.Class<? extends T[]> cls,
T[] ifNull) |
static java.lang.String |
limitsClause(int from,
int to) |
static void |
rollback(java.sql.Connection con) |
static <T> void |
setArray(java.sql.PreparedStatement pstmt,
int index,
T[] array) |
static <T> void |
setArrayEmptyToNull(java.sql.PreparedStatement pstmt,
int index,
T[] array) |
static void |
setBytes(java.sql.PreparedStatement pstmt,
int index,
byte[] bytes) |
static void |
setIntZeroToNull(java.sql.PreparedStatement pstmt,
int index,
int n) |
static int |
setLimits(int index,
java.sql.PreparedStatement pstmt,
int from,
int to) |
static void |
setLong(java.sql.PreparedStatement pstmt,
int index,
java.lang.Long l) |
static void |
setLongZeroToNull(java.sql.PreparedStatement pstmt,
int index,
long l) |
static void |
setShortZeroToNull(java.sql.PreparedStatement pstmt,
int index,
short s) |
static void |
setString(java.sql.PreparedStatement pstmt,
int index,
java.lang.String s) |
public static void close(java.lang.AutoCloseable... closeables)
public static void rollback(java.sql.Connection con)
public static void setBytes(java.sql.PreparedStatement pstmt, int index, byte[] bytes) throws java.sql.SQLException
java.sql.SQLException
public static void setString(java.sql.PreparedStatement pstmt, int index, java.lang.String s) throws java.sql.SQLException
java.sql.SQLException
public static void setLong(java.sql.PreparedStatement pstmt, int index, java.lang.Long l) throws java.sql.SQLException
java.sql.SQLException
public static void setShortZeroToNull(java.sql.PreparedStatement pstmt, int index, short s) throws java.sql.SQLException
java.sql.SQLException
public static void setIntZeroToNull(java.sql.PreparedStatement pstmt, int index, int n) throws java.sql.SQLException
java.sql.SQLException
public static void setLongZeroToNull(java.sql.PreparedStatement pstmt, int index, long l) throws java.sql.SQLException
java.sql.SQLException
public static <T> T[] getArray(java.sql.ResultSet rs, java.lang.String columnName, java.lang.Class<? extends T[]> cls) throws java.sql.SQLException
java.sql.SQLException
public static <T> T[] getArray(java.sql.ResultSet rs, java.lang.String columnName, java.lang.Class<? extends T[]> cls, T[] ifNull) throws java.sql.SQLException
java.sql.SQLException
public static <T> void setArray(java.sql.PreparedStatement pstmt, int index, T[] array) throws java.sql.SQLException
java.sql.SQLException
public static <T> void setArrayEmptyToNull(java.sql.PreparedStatement pstmt, int index, T[] array) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String limitsClause(int from, int to)
public static int setLimits(int index, java.sql.PreparedStatement pstmt, int from, int to) throws java.sql.SQLException
java.sql.SQLException