public class DBSupport
extends java.lang.Object
| Constructor and Description |
|---|
DBSupport(javax.sql.DataSource cp) |
| Modifier and Type | Method and Description |
|---|---|
int |
deleteRecords(java.lang.String tableName,
SqlCondition condition)
Deletes the records from the given table with the given condition
|
int |
executeSQL(java.lang.String sql)
Executes the given SQL statement.
|
java.sql.DatabaseMetaData |
getDatabaseMetaData() |
int |
getRecordCount(java.lang.String table)
Counts the number of records in the given table.
|
java.lang.String |
printSQL(java.lang.String sql) |
int |
readMaxValue(java.lang.String table,
java.lang.String column)
Reads the maximum value in the given table column.
|
int |
readMaxValue(java.lang.String table,
java.lang.String column,
SqlCondition cond)
Reads the maximum value in the given table column.
|
java.util.List<java.lang.String> |
readSchemas() |
JdbcTable |
readTable(java.lang.String schema,
java.lang.String tableNamePattern,
java.lang.String[] validTableTypes)
Returns the JdbcTable that matches the tableNamePattern or null if none was found.
|
java.util.List<JdbcTable> |
readTables(java.lang.String schema,
java.lang.String[] validTableTypes) |
int |
updateColumnValue(java.lang.String tableName,
java.lang.String columnName,
java.lang.String columnValue,
SqlCondition condition)
Update a table column with the given value in all records that match the given condition
|
public java.util.List<JdbcTable> readTables(java.lang.String schema, java.lang.String[] validTableTypes) throws java.lang.Exception
java.lang.Exceptionpublic JdbcTable readTable(java.lang.String schema, java.lang.String tableNamePattern, java.lang.String[] validTableTypes) throws java.lang.Exception
java.lang.Exceptionpublic java.sql.DatabaseMetaData getDatabaseMetaData()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<java.lang.String> readSchemas()
throws java.lang.Exception
java.lang.Exceptionpublic int executeSQL(java.lang.String sql)
throws java.lang.Exception
java.lang.Exceptionpublic int deleteRecords(java.lang.String tableName,
SqlCondition condition)
throws java.lang.Exception
condition - the SQL filter condition, may be null.java.lang.Exceptionpublic int updateColumnValue(java.lang.String tableName,
java.lang.String columnName,
java.lang.String columnValue,
SqlCondition condition)
throws java.lang.Exception
columnValue - the value of the column, may be null. String values must be single quotedcondition - the SQL filter condition, may be null.java.lang.Exceptionpublic int readMaxValue(java.lang.String table,
java.lang.String column)
throws java.lang.Exception
java.lang.Exceptionpublic int readMaxValue(java.lang.String table,
java.lang.String column,
SqlCondition cond)
throws java.lang.Exception
java.lang.Exceptionpublic int getRecordCount(java.lang.String table)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String printSQL(java.lang.String sql)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.