Package nxt.db
Class DbUtils
java.lang.Object
nxt.db.DbUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(AutoCloseable... closeables) static <T> T[]static <T> T[]static StringlimitsClause(int from, int to) static voidrollback(Connection con) static <T> voidsetArray(PreparedStatement pstmt, int index, T[] array) static <T> voidsetArrayEmptyToNull(PreparedStatement pstmt, int index, T[] array) static voidsetBytes(PreparedStatement pstmt, int index, byte[] bytes) static voidsetIntZeroToNull(PreparedStatement pstmt, int index, int n) static intsetLimits(int index, PreparedStatement pstmt, int from, int to) static voidsetLong(PreparedStatement pstmt, int index, Long l) static voidsetLongZeroToNull(PreparedStatement pstmt, int index, long l) static voidsetShortZeroToNull(PreparedStatement pstmt, int index, short s) static voidsetString(PreparedStatement pstmt, int index, String s)
-
Method Details
-
close
-
rollback
-
setBytes
- Throws:
SQLException
-
setString
- Throws:
SQLException
-
setLong
- Throws:
SQLException
-
setShortZeroToNull
public static void setShortZeroToNull(PreparedStatement pstmt, int index, short s) throws SQLException - Throws:
SQLException
-
setIntZeroToNull
- Throws:
SQLException
-
setLongZeroToNull
public static void setLongZeroToNull(PreparedStatement pstmt, int index, long l) throws SQLException - Throws:
SQLException
-
getArray
public static <T> T[] getArray(ResultSet rs, String columnName, Class<? extends T[]> cls) throws SQLException - Throws:
SQLException
-
getArray
public static <T> T[] getArray(ResultSet rs, String columnName, Class<? extends T[]> cls, T[] ifNull) throws SQLException - Throws:
SQLException
-
setArray
- Throws:
SQLException
-
setArrayEmptyToNull
public static <T> void setArrayEmptyToNull(PreparedStatement pstmt, int index, T[] array) throws SQLException - Throws:
SQLException
-
limitsClause
-
setLimits
public static int setLimits(int index, PreparedStatement pstmt, int from, int to) throws SQLException - Throws:
SQLException
-