|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.util.jdbc.JDBCUtil
public class JDBCUtil
Take care of some JDBC related stuff. Mostly closing resources
| Constructor Summary | |
|---|---|
JDBCUtil()
|
|
| Method Summary | |
|---|---|
static void |
bindNTimes(PreparedStatement ps,
int[] values,
int startingBinding)
Bind the passed values to the parameters of the PreparedStatement, starting at position startBinding |
static String |
convertSQLExceptionToString(SQLException e)
|
static String |
generateInBinds(int count)
Generate count '? separated by comma |
static String |
getNextValSql(Connection conn,
String tableName)
Generate the correct SQL statement to obtain the next value from a sequence/table generator for the passed table. |
static void |
safeClose(Connection con)
|
static void |
safeClose(Connection conn,
Statement stm,
ResultSet rs)
|
static void |
safeClose(InputStream in)
Deprecated. This should correctly be handled at the place where the stream is about to be closed JBNADM-2600 |
static void |
safeClose(OutputStream out)
Deprecated. This should correctly be handled at the place where the stream is about to be closed JBNADM-2600 |
static void |
safeClose(Reader reader)
Deprecated. This should correctly be handled at the place where the stream is about to be closed JBNADM-2600 |
static void |
safeClose(ResultSet rs)
|
static void |
safeClose(Statement statement)
|
static void |
safeClose(Statement stm,
ResultSet rs)
|
static void |
safeClose(Writer writer)
Deprecated. This should correctly be handled at the place where the stream is about to be closed JBNADM-2600 |
static String |
transformQueryForMultipleInParameters(String query,
String replaceable,
int bindCount)
Populate the passed query with bindCount number of placeholders '?'. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCUtil()
| Method Detail |
|---|
public static void safeClose(Statement stm,
ResultSet rs)
public static void safeClose(Connection conn,
Statement stm,
ResultSet rs)
public static void safeClose(Connection con)
public static void safeClose(ResultSet rs)
public static void safeClose(Statement statement)
public static void bindNTimes(PreparedStatement ps,
int[] values,
int startingBinding)
throws SQLException
PreparedStatement, starting at position startBinding
ps - PreparedStatement to usevalues - the array of int values to fill instartingBinding - the starting position of the parameter to fill in
SQLException - if the Statement.setInt() call fails
public static String transformQueryForMultipleInParameters(String query,
String replaceable,
int bindCount)
query - the original query including text to replacereplaceable - the part of the original query that should be replaced by '?'s.bindCount - how many placeholders '?' should be generated
public static String generateInBinds(int count)
public static String getNextValSql(Connection conn,
String tableName)
conn - A valid database connectiontableName - The name of the table to use
@Deprecated public static void safeClose(InputStream in)
@Deprecated public static void safeClose(OutputStream out)
@Deprecated public static void safeClose(Reader reader)
@Deprecated public static void safeClose(Writer writer)
public static String convertSQLExceptionToString(SQLException e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||