xbn.db
Class QueryBase

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.db.QueryBase
Direct Known Subclasses:
QueryPlain, QueryPrepared

public class QueryBase
extends XBNObject

The base class for handling a Query, via the Statement contained in a DBConnStatement.

Source code:  QueryBase.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
QueryBase()
           
QueryBase(boolean b_throwOnNoRowUpdate)
           
 
Method Summary
 boolean doThrowOnNoRowUpdate()
          If true, and no rows are affected in an update statement, then throw an SQLException, instead of returning 0.
protected  boolean execute(DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
          Executes DML.
protected  int getInt(DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
           
 int getIntFromRS(ResultSet rs)
          If the string returned is null, it is assumed to be zero.
protected  long getLong(DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
           
 long getLongFromRS(ResultSet rs)
          If the string returned is null, it is assumed to be zero.
protected  ResultSet getResultSet(DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
           
protected  ResultSet getResultSet(String s_callingFunc, DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
           
protected  String getString(DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
           
 String getStringFromRS(ResultSet rs)
          This closes the ResultSet.
 void setThrowOnNoRowUpdate(boolean b_throw)
          If true, and no rows are affected in an update statement, the throw an SQLException, instead of returning 0.
protected  int update(DBCSPlain dbcs_plain, DBCSPrepared dbcs_prepared)
          Executes a non-select query, such as update, insert, delete...
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryBase

public QueryBase(boolean b_throwOnNoRowUpdate)

QueryBase

public QueryBase()
Method Detail

getStringFromRS

public String getStringFromRS(ResultSet rs)
                       throws SQLException

This closes the ResultSet.


getIntFromRS

public int getIntFromRS(ResultSet rs)
                 throws SQLException

If the string returned is null, it is assumed to be zero.


getLongFromRS

public long getLongFromRS(ResultSet rs)
                   throws SQLException

If the string returned is null, it is assumed to be zero.


update

protected int update(DBCSPlain dbcs_plain,
                     DBCSPrepared dbcs_prepared)
              throws SQLException

Executes a non-select query, such as update, insert, delete...

Returns:
The number of rows affected by the update. For example, if 10 rows are deleted, then 10 is returned. If no rows are deleted, 0 is returned.


execute

protected boolean execute(DBCSPlain dbcs_plain,
                          DBCSPrepared dbcs_prepared)
                   throws SQLException

Executes DML.


setThrowOnNoRowUpdate

public void setThrowOnNoRowUpdate(boolean b_throw)
If true, and no rows are affected in an update statement, the throw an SQLException, instead of returning 0.

Normally, an update query returns the number of rows affected by the query.


doThrowOnNoRowUpdate

public boolean doThrowOnNoRowUpdate()
If true, and no rows are affected in an update statement, then throw an SQLException, instead of returning 0.

Normally, an update query returns the number of rows affected by the query.


getString

protected String getString(DBCSPlain dbcs_plain,
                           DBCSPrepared dbcs_prepared)
                    throws SQLException

getInt

protected int getInt(DBCSPlain dbcs_plain,
                     DBCSPrepared dbcs_prepared)
              throws SQLException

getLong

protected long getLong(DBCSPlain dbcs_plain,
                       DBCSPrepared dbcs_prepared)
                throws SQLException

getResultSet

protected ResultSet getResultSet(DBCSPlain dbcs_plain,
                                 DBCSPrepared dbcs_prepared)
                          throws SQLException

getResultSet

protected ResultSet getResultSet(String s_callingFunc,
                                 DBCSPlain dbcs_plain,
                                 DBCSPrepared dbcs_prepared)
                          throws SQLException



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo