net.wgen.op.db
Class DatabaseUtils

java.lang.Object
  extended bynet.wgen.op.db.DatabaseUtils

public class DatabaseUtils
extends java.lang.Object

Version:
$Id: DatabaseUtils.html,v 1.2 2007/01/28 04:09:36 paulfeuer Exp $
Author:
Paul Feuer, Wireless Generation, Inc.

Field Summary
private static org.apache.log4j.Logger LOG
           
static int MAX_ROWS_ALLOWED
          Currently set to 50,000, until we have a better sense of what will break when we knock this down to 5,000.!!
static int MAX_ROWS_WARNED
           
 
Constructor Summary
DatabaseUtils()
           
 
Method Summary
static java.lang.String buildCallWithBindVariables(java.lang.String functionName, int numInputs, boolean withOutput)
          Builds a SQL call statement with a question-mark bind variable for each of the function's arguments.
static java.sql.PreparedStatement buildSqlStatement(DatabaseCall call, java.sql.Connection connection)
          Builds a java.sql.PreparedStatement (or java.sql.Callablestatement) from a DatabaseCall.
static void closeConnectionQuietly(java.sql.Connection connection)
          Close a connection without concern for any exceptions.
static void closeResultSetQuietly(java.sql.ResultSet rs)
          Close a ResultSet without concern for any exceptions.
static void closeStatementQuietly(java.sql.Statement statement)
          Close a statement without concern for any exceptions.
static LobHandler getLobHandler(DatabaseCall dbCall, java.sql.Connection connection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ROWS_ALLOWED

public static final int MAX_ROWS_ALLOWED
Currently set to 50,000, until we have a better sense of what will break when we knock this down to 5,000.!!

See Also:
Constant Field Values

MAX_ROWS_WARNED

public static final int MAX_ROWS_WARNED
See Also:
Constant Field Values

LOG

private static final org.apache.log4j.Logger LOG
Constructor Detail

DatabaseUtils

public DatabaseUtils()
Method Detail

closeConnectionQuietly

public static void closeConnectionQuietly(java.sql.Connection connection)
Close a connection without concern for any exceptions.

Parameters:
connection - the connection to close

closeStatementQuietly

public static void closeStatementQuietly(java.sql.Statement statement)
Close a statement without concern for any exceptions.

Parameters:
statement - the statement to close

closeResultSetQuietly

public static void closeResultSetQuietly(java.sql.ResultSet rs)
Close a ResultSet without concern for any exceptions.

Parameters:
rs - the ResultSet to close

buildCallWithBindVariables

public static java.lang.String buildCallWithBindVariables(java.lang.String functionName,
                                                          int numInputs,
                                                          boolean withOutput)
Builds a SQL call statement with a question-mark bind variable for each of the function's arguments.


getLobHandler

public static LobHandler getLobHandler(DatabaseCall dbCall,
                                       java.sql.Connection connection)
Parameters:
dbCall -
connection -
Returns:
the LobHandler for this connection

buildSqlStatement

public static java.sql.PreparedStatement buildSqlStatement(DatabaseCall call,
                                                           java.sql.Connection connection)
                                                    throws java.sql.SQLException
Builds a java.sql.PreparedStatement (or java.sql.Callablestatement) from a DatabaseCall.

Parameters:
call - the DatabaseCall representing the statement we wish to use
connection - the connection against which this statement will be called
Returns:
a java.sql.Statement built according to the input
Throws:
java.sql.SQLException