com.cafesoft.core.jdbc
Class JdbcUtils

java.lang.Object
  |
  +--com.cafesoft.core.jdbc.JdbcUtils

public class JdbcUtils
extends Object

Provides convenience methods Java Database Connectivity.

Since:
10/12/01

Constructor Summary
JdbcUtils()
           
 
Method Summary
static void close(Connection c, Statement s, ResultSet r)
          Close an SQLException connection.
static void displayResultSet(ResultSet rs)
          Dump a JDBC ResultSet to the current PrintStream.
static void err(SQLException e)
          Dump an SQLException to the current PrintStream.
static Driver loadDriver(String className)
          Dynamically load a JDBC Driver class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcUtils

public JdbcUtils()
Method Detail

loadDriver

public static Driver loadDriver(String className)
Dynamically load a JDBC Driver class.

If an Exception occurs, write a stack trace to the current PrintStream. (The default PrintStream is System.err).

Parameters:
className - the fully-qualified JDBC Driver classname.
Returns:
the loaded JDBC Driver.

displayResultSet

public static void displayResultSet(ResultSet rs)
Dump a JDBC ResultSet to the current PrintStream.

Parameters:
rs - the ResultSet to be dumped.

err

public static void err(SQLException e)
Dump an SQLException to the current PrintStream.

Parameters:
e - The SQLException to be dumped.

close

public static void close(Connection c,
                         Statement s,
                         ResultSet r)
Close an SQLException connection. Parameters are test for null condition, a 'null' ResultSet can be passed in for operations that don't use one.

Parameters:
c - The Connection to be closed.
s - The Statement or PrepardedStatement to be closed.
r - The ResultSet to be closed.


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.