public class DBCommand
extends java.lang.Object
Constructor and Description |
---|
DBCommand() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static int |
executeUpdate(java.sql.Connection oCon,
java.lang.String sSQL)
Execute an INSERT or UPDATE statement
|
static java.math.BigDecimal |
queryBigDecimal(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get a BigDecimal value as result
|
static int |
queryCount(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to count occurences of rows matching a criteria
|
static java.util.Date |
queryDateTime(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get a BigDecimal value as result
|
static boolean |
queryExists(java.sql.Connection oCon,
java.lang.String sTable,
java.lang.String sWhere) |
static java.lang.Integer |
queryInt(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get an Integer value as result
|
static java.lang.Object |
queryMax(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to get the maximum value for a column
|
static java.util.Date |
queryMaxDate(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to get the maximum date value for a date column
|
static java.lang.Integer |
queryMaxInt(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to get the maximum value for a column of type INTEGER
|
static java.lang.Object |
queryMin(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to get the minimum value for a column
|
static java.util.Date |
queryMinDate(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to get the minimum value for a date column
|
static java.lang.Integer |
queryMinInt(java.sql.Connection oCon,
java.lang.String sColumn,
java.lang.String sTable,
java.lang.String sWhere)
Execute a SQL query to get the maximum value for a column of type INTEGER
|
java.sql.ResultSet |
queryResultSet(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get a ResultSet
|
static java.lang.Short |
queryShort(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get a Short value as result
|
static java.lang.String |
queryStr(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get a String value as result
|
static java.lang.String[] |
queryStrs(java.sql.Connection oCon,
java.lang.String sSQL)
Execute a SQL query and get an Array of Strings as result
|
public void close() throws java.sql.SQLException
java.sql.SQLException
public java.sql.ResultSet queryResultSet(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
public static boolean queryExists(java.sql.Connection oCon, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException
java.sql.SQLException
public static java.lang.Integer queryInt(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException, java.lang.NumberFormatException, java.lang.ClassCastException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException
public static java.lang.Short queryShort(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException, java.lang.NumberFormatException, java.lang.ClassCastException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException
public static java.lang.String queryStr(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException
public static java.lang.String[] queryStrs(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException
public static java.math.BigDecimal queryBigDecimal(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException, java.lang.NumberFormatException, java.lang.ClassCastException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException
public static java.lang.Object queryMax(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict maximum searchjava.sql.SQLException
public static java.lang.Object queryMin(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict minimum searchjava.sql.SQLException
public static java.util.Date queryMaxDate(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict maximum searchjava.sql.SQLException
public static java.util.Date queryMinDate(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict minimum searchjava.sql.SQLException
public static java.lang.Integer queryMaxInt(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException, java.lang.NumberFormatException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict maximum searchjava.sql.SQLException
java.lang.NumberFormatException
public static java.lang.Integer queryMinInt(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException, java.lang.NumberFormatException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict maximum searchjava.sql.SQLException
java.lang.NumberFormatException
public static int queryCount(java.sql.Connection oCon, java.lang.String sColumn, java.lang.String sTable, java.lang.String sWhere) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsColumn
- Column NamesTable
- Table NamesWhere
- WHERE clause to restrict countingjava.sql.SQLException
public static java.util.Date queryDateTime(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException
public static int executeUpdate(java.sql.Connection oCon, java.lang.String sSQL) throws java.sql.SQLException
oCon
- Connection Open JDBC database connectionsSQL
- String Command to be executedjava.sql.SQLException