com.knowgate.dataobjs
Class DBCommand

java.lang.Object
  extended bycom.knowgate.dataobjs.DBCommand

public class DBCommand
extends java.lang.Object

A wrapper for some common SQL command sequences

Version:
3.0

Method Summary
static java.math.BigDecimal queryBigDecimal(java.sql.Connection oCon, java.lang.String sSQL)
          Execute a SQL query and get a String value as result
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.String queryStr(java.sql.Connection oCon, java.lang.String sSQL)
          Execute a SQL query and get a String value as result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

queryInt

public static java.lang.Integer queryInt(java.sql.Connection oCon,
                                         java.lang.String sSQL)
                                  throws java.sql.SQLException,
                                         java.lang.NumberFormatException,
                                         java.lang.ClassCastException
Execute a SQL query and get an Integer value as result

Parameters:
oCon - Connection Open JDBC database connection
sSQL - String to be executed
Returns:
Integer Value of the first column selected by the query or null if no row was found or selected row was null
Throws:
java.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException

queryStr

public static java.lang.String queryStr(java.sql.Connection oCon,
                                        java.lang.String sSQL)
                                 throws java.sql.SQLException
Execute a SQL query and get a String value as result

Parameters:
oCon - Connection Open JDBC database connection
sSQL - String to be executed
Returns:
String Value of the first column selected by the query or null if no row was found or selected row was null
Throws:
java.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException

queryBigDecimal

public static java.math.BigDecimal queryBigDecimal(java.sql.Connection oCon,
                                                   java.lang.String sSQL)
                                            throws java.sql.SQLException
Execute a SQL query and get a String value as result

Parameters:
oCon - Connection Open JDBC database connection
sSQL - String to be executed
Returns:
String Value of the first column selected by the query or null if no row was found or selected row was null
Throws:
java.sql.SQLException
java.lang.NumberFormatException
java.lang.ClassCastException