org.pfsw.db.util
Class DBUtil

java.lang.Object
  extended by org.pfsw.db.util.DBUtil

public class DBUtil
extends java.lang.Object

Helper and convenience methods for Java database handling.


Field Summary
static DBUtil DBU
           
 
Constructor Summary
protected DBUtil()
           
 
Method Summary
static DBUtil current()
          Returns the only instance this class supports (design pattern "Singleton")
 boolean isDriverRegistered(java.lang.String driverClassName)
          Returns true if the database driver with the specified class name is registered at the java.sql.DriverManager.
 boolean loadAndRegisterDriver(java.lang.String driverClassName)
          Loads the database driver with the given class name and registers it at the java.sql.DriverManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBU

public static final DBUtil DBU
Constructor Detail

DBUtil

protected DBUtil()
Method Detail

current

public static DBUtil current()
Returns the only instance this class supports (design pattern "Singleton")


loadAndRegisterDriver

public boolean loadAndRegisterDriver(java.lang.String driverClassName)
Loads the database driver with the given class name and registers it at the java.sql.DriverManager.

Parameters:
driverClassName - The class name of the driver to load
Returns:
true if loading was successful, otherwise false

isDriverRegistered

public boolean isDriverRegistered(java.lang.String driverClassName)
Returns true if the database driver with the specified class name is registered at the java.sql.DriverManager.

Parameters:
driverClassName - The class name of the driver to load