public class JdbcUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
log |
Constructor and Description |
---|
JdbcUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
applyParameter(PreparedStatement statement,
ParameterValue pv,
int parameterIndex,
boolean parameterTypeMatchRequired) |
static void |
applyParameters(IDbmsSupport dbmsSupport,
PreparedStatement statement,
ParameterList parameters,
Message message,
PipeLineSession session) |
static void |
applyParameters(IDbmsSupport dbmsSupport,
PreparedStatement statement,
ParameterValueList parameters) |
static void |
close(Connection connection) |
static String |
executeBlobQuery(IDbmsSupport dbmsSupport,
Connection connection,
String query) |
static int |
executeIntQuery(Connection connection,
String query) |
static int |
executeIntQuery(Connection connection,
String query,
int param) |
static int |
executeIntQuery(Connection connection,
String query,
int param1,
int param2) |
static int |
executeIntQuery(Connection connection,
String query,
int param1,
int param2,
String param3) |
static int |
executeIntQuery(Connection connection,
String query,
int param1,
int param2,
String param3,
String param4) |
static int |
executeIntQuery(Connection connection,
String query,
int param1,
String param2) |
static int |
executeIntQuery(Connection connection,
String query,
int param1,
String param2,
String param3) |
static int |
executeIntQuery(Connection connection,
String query,
String param) |
static int |
executeIntQuery(Connection connection,
String query,
String param1,
String param2)
executes query that returns an integer.
|
static List<List<Object>> |
executeObjectListListQuery(Connection connection,
String query,
int columnsCount) |
static Object |
executeQuery(IDbmsSupport dbmsSupport,
Connection connection,
String query,
ParameterValueList parameterValues) |
static void |
executeStatement(Connection connection,
String query) |
static void |
executeStatement(Connection connection,
String query,
int param) |
static void |
executeStatement(Connection connection,
String query,
int param1,
int param2,
int param3,
String param4,
String param5) |
static void |
executeStatement(Connection connection,
String query,
int param1,
int param2,
String param3,
String param4) |
static void |
executeStatement(Connection connection,
String query,
int param1,
String param2) |
static void |
executeStatement(Connection connection,
String query,
int param1,
String param2,
String param3) |
static void |
executeStatement(Connection connection,
String query,
String param) |
static void |
executeStatement(Connection connection,
String query,
String param1,
String param2) |
static void |
executeStatement(IDbmsSupport dbmsSupport,
Connection connection,
String query,
ParameterValueList parameterValues) |
static String |
executeStringQuery(Connection connection,
String query)
executes query that returns a string.
|
static void |
fullClose(Connection connection,
ResultSet rs) |
static void |
fullClose(Connection connection,
Statement statement)
Note: Depending on the connect pool used (for example with Tomcat 7) the
connection retrieved from the statement will be the direct connection
instead of the proxied connection.
|
static String |
getBlobAsString(IDbmsSupport dbmsSupport,
ResultSet rs,
int column,
String charset,
boolean blobIsCompressed,
boolean blobSmartGet,
boolean encodeBlobBase64) |
static String |
getBlobAsString(IDbmsSupport dbmsSupport,
ResultSet rs,
String column,
String charset,
boolean blobIsCompressed,
boolean blobSmartGet,
boolean encodeBlobBase64) |
static String |
getBlobAsString(InputStream blobIntputStream,
String column,
String charset,
boolean blobSmartGet,
boolean encodeBlobBase64) |
static InputStream |
getBlobInputStream(IDbmsSupport dbmsSupport,
ResultSet rs,
int column,
boolean blobIsCompressed) |
static InputStream |
getBlobInputStream(IDbmsSupport dbmsSupport,
ResultSet rs,
String column,
boolean blobIsCompressed) |
static OutputStream |
getBlobOutputStream(IDbmsSupport dbmsSupport,
Object blobUpdateHandle,
PreparedStatement stmt,
int columnIndex,
boolean compressBlob) |
static OutputStream |
getBlobOutputStream(IDbmsSupport dbmsSupport,
Object blobUpdateHandle,
ResultSet rs,
int columnIndex,
boolean compressBlob) |
static Reader |
getBlobReader(IDbmsSupport dbmsSupport,
ResultSet rs,
int column,
String charset,
boolean blobIsCompressed) |
static Reader |
getBlobReader(IDbmsSupport dbmsSupport,
ResultSet rs,
String column,
String charset,
boolean blobIsCompressed) |
static Reader |
getBlobReader(InputStream blobIntputStream,
String charset) |
static Writer |
getBlobWriter(IDbmsSupport dbmsSupport,
Object blobUpdateHandle,
ResultSet rs,
int columnIndex,
String charset,
boolean compressBlob) |
static String |
getClobAsString(IDbmsSupport dbmsSupport,
ResultSet rs,
int columnIndex,
boolean xmlEncode) |
static String |
getClobAsString(IDbmsSupport dbmsSupport,
ResultSet rs,
String columnName,
boolean xmlEncode) |
static String |
getValue(IDbmsSupport dbmsSupport,
ResultSet rs,
int colNum,
ResultSetMetaData rsmeta,
String blobCharset,
boolean decompressBlobs,
String nullValue,
boolean trimSpaces,
boolean getBlobSmart,
boolean encodeBlobBase64) |
static Writer |
getWriter(Object target)
Deprecated.
|
static boolean |
isNumeric(int sqlTYpe) |
static boolean |
isQueryResultEmpty(Connection connection,
String query) |
static void |
putByteArrayAsBlob(IDbmsSupport dbmsSupport,
ResultSet rs,
int columnIndex,
byte[] content,
boolean compressBlob) |
static void |
putStringAsBlob(IDbmsSupport dbmsSupport,
ResultSet rs,
int columnIndex,
String content,
String charset,
boolean compressBlob) |
static void |
putStringAsClob(IDbmsSupport dbmsSupport,
ResultSet rs,
int columnIndex,
String content) |
static String |
selectAllFromTable(IDbmsSupport dbmsSupport,
Connection conn,
String tableName) |
static String |
selectAllFromTable(IDbmsSupport dbmsSupport,
Connection conn,
String tableName,
String orderBy) |
static void |
setParameter(PreparedStatement statement,
int parameterIndex,
String value,
boolean parameterTypeMatchRequired) |
static void |
streamBlob(IDbmsSupport dbmsSupport,
ResultSet rs,
int columnIndex,
String charset,
boolean blobIsCompressed,
Base64Pipe.Direction blobBase64Direction,
Object target,
boolean close) |
static void |
streamBlob(IDbmsSupport dbmsSupport,
ResultSet rs,
String columnName,
String charset,
boolean blobIsCompressed,
Base64Pipe.Direction blobBase64Direction,
Object target,
boolean close) |
static void |
streamBlob(InputStream blobIntputStream,
String charset,
Base64Pipe.Direction blobBase64Direction,
Object target,
boolean close) |
static void |
streamClob(IDbmsSupport dbmsSupport,
ResultSet rs,
int column,
Object target,
boolean close) |
static void |
warningsToDocument(SQLWarning warnings,
ObjectBuilder parent) |
static String |
warningsToString(SQLWarning warnings)
Deprecated.
|
static void |
warningsToXml(SQLWarning warnings,
SaxElementBuilder parent) |
static void |
warningsToXml(SQLWarning warnings,
XmlBuilder parent)
Deprecated.
|
static XmlBuilder |
warningsToXmlBuilder(SQLWarning warnings)
Deprecated.
|
@Deprecated public static String warningsToString(SQLWarning warnings)
@Deprecated public static void warningsToXml(SQLWarning warnings, XmlBuilder parent)
@Deprecated public static XmlBuilder warningsToXmlBuilder(SQLWarning warnings)
public static void warningsToXml(SQLWarning warnings, SaxElementBuilder parent) throws SAXException
SAXException
public static void warningsToDocument(SQLWarning warnings, ObjectBuilder parent) throws SAXException
SAXException
public static String getValue(IDbmsSupport dbmsSupport, ResultSet rs, int colNum, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart, boolean encodeBlobBase64) throws IOException, SQLException
IOException
SQLException
public static InputStream getBlobInputStream(IDbmsSupport dbmsSupport, ResultSet rs, int column, boolean blobIsCompressed) throws SQLException, JdbcException
SQLException
JdbcException
public static InputStream getBlobInputStream(IDbmsSupport dbmsSupport, ResultSet rs, String column, boolean blobIsCompressed) throws SQLException, JdbcException
SQLException
JdbcException
public static Reader getBlobReader(IDbmsSupport dbmsSupport, ResultSet rs, int column, String charset, boolean blobIsCompressed) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static Reader getBlobReader(IDbmsSupport dbmsSupport, ResultSet rs, String column, String charset, boolean blobIsCompressed) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static Reader getBlobReader(InputStream blobIntputStream, String charset) throws IOException
IOException
public static void streamBlob(IDbmsSupport dbmsSupport, ResultSet rs, int columnIndex, String charset, boolean blobIsCompressed, Base64Pipe.Direction blobBase64Direction, Object target, boolean close) throws JdbcException, SQLException, IOException
JdbcException
SQLException
IOException
public static void streamBlob(IDbmsSupport dbmsSupport, ResultSet rs, String columnName, String charset, boolean blobIsCompressed, Base64Pipe.Direction blobBase64Direction, Object target, boolean close) throws JdbcException, SQLException, IOException
JdbcException
SQLException
IOException
public static void streamBlob(InputStream blobIntputStream, String charset, Base64Pipe.Direction blobBase64Direction, Object target, boolean close) throws JdbcException, IOException
JdbcException
IOException
@Deprecated public static Writer getWriter(Object target) throws IOException
IOException
public static void streamClob(IDbmsSupport dbmsSupport, ResultSet rs, int column, Object target, boolean close) throws JdbcException, SQLException, IOException
JdbcException
SQLException
IOException
public static String getBlobAsString(IDbmsSupport dbmsSupport, ResultSet rs, int column, String charset, boolean blobIsCompressed, boolean blobSmartGet, boolean encodeBlobBase64) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static String getBlobAsString(IDbmsSupport dbmsSupport, ResultSet rs, String column, String charset, boolean blobIsCompressed, boolean blobSmartGet, boolean encodeBlobBase64) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static String getBlobAsString(InputStream blobIntputStream, String column, String charset, boolean blobSmartGet, boolean encodeBlobBase64) throws IOException, JdbcException
IOException
JdbcException
public static OutputStream getBlobOutputStream(IDbmsSupport dbmsSupport, Object blobUpdateHandle, ResultSet rs, int columnIndex, boolean compressBlob) throws JdbcException, SQLException
JdbcException
SQLException
public static OutputStream getBlobOutputStream(IDbmsSupport dbmsSupport, Object blobUpdateHandle, PreparedStatement stmt, int columnIndex, boolean compressBlob) throws JdbcException, SQLException
JdbcException
SQLException
public static Writer getBlobWriter(IDbmsSupport dbmsSupport, Object blobUpdateHandle, ResultSet rs, int columnIndex, String charset, boolean compressBlob) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static void putStringAsBlob(IDbmsSupport dbmsSupport, ResultSet rs, int columnIndex, String content, String charset, boolean compressBlob) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static void putByteArrayAsBlob(IDbmsSupport dbmsSupport, ResultSet rs, int columnIndex, byte[] content, boolean compressBlob) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static String getClobAsString(IDbmsSupport dbmsSupport, ResultSet rs, int columnIndex, boolean xmlEncode) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static String getClobAsString(IDbmsSupport dbmsSupport, ResultSet rs, String columnName, boolean xmlEncode) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static void putStringAsClob(IDbmsSupport dbmsSupport, ResultSet rs, int columnIndex, String content) throws IOException, JdbcException, SQLException
IOException
JdbcException
SQLException
public static void fullClose(Connection connection, ResultSet rs)
public static void fullClose(Connection connection, Statement statement)
connection
- the proxied/original connection the statement was created withstatement
- the statement to closepublic static void close(Connection connection)
public static String executeStringQuery(Connection connection, String query) throws JdbcException
JdbcException
public static String executeBlobQuery(IDbmsSupport dbmsSupport, Connection connection, String query) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, String param) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, String param1, String param2) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, int param) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, int param1, String param2) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, int param1, String param2, String param3) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, int param1, int param2) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, int param1, int param2, String param3) throws JdbcException
JdbcException
public static int executeIntQuery(Connection connection, String query, int param1, int param2, String param3, String param4) throws JdbcException
JdbcException
public static boolean isQueryResultEmpty(Connection connection, String query) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, String param) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, String param1, String param2) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, int param) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, int param1, String param2) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, int param1, String param2, String param3) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, int param1, int param2, String param3, String param4) throws JdbcException
JdbcException
public static void executeStatement(Connection connection, String query, int param1, int param2, int param3, String param4, String param5) throws JdbcException
JdbcException
public static String selectAllFromTable(IDbmsSupport dbmsSupport, Connection conn, String tableName) throws SQLException
SQLException
public static String selectAllFromTable(IDbmsSupport dbmsSupport, Connection conn, String tableName, String orderBy) throws SQLException
SQLException
public static List<List<Object>> executeObjectListListQuery(Connection connection, String query, int columnsCount) throws JdbcException
JdbcException
public static void executeStatement(IDbmsSupport dbmsSupport, Connection connection, String query, ParameterValueList parameterValues) throws JdbcException
JdbcException
public static Object executeQuery(IDbmsSupport dbmsSupport, Connection connection, String query, ParameterValueList parameterValues) throws JdbcException
JdbcException
public static void applyParameters(IDbmsSupport dbmsSupport, PreparedStatement statement, ParameterList parameters, Message message, PipeLineSession session) throws SQLException, JdbcException, ParameterException
public static void applyParameters(IDbmsSupport dbmsSupport, PreparedStatement statement, ParameterValueList parameters) throws SQLException, JdbcException
SQLException
JdbcException
public static void applyParameter(PreparedStatement statement, ParameterValue pv, int parameterIndex, boolean parameterTypeMatchRequired) throws SQLException, JdbcException
SQLException
JdbcException
public static void setParameter(PreparedStatement statement, int parameterIndex, String value, boolean parameterTypeMatchRequired) throws SQLException
SQLException
public static boolean isNumeric(int sqlTYpe)
Copyright © 2023 Frank!Framework. All rights reserved.