com.youyounet.db
Class DBInterface

java.lang.Object
  |
  +--com.youyounet.db.DBInterface

public class DBInterface
extends java.lang.Object

This class is intended to be customized by the users who want to use their own database connection pooling package. The default implementation uses a class from the Jakarta Struts library, and hence the struts.jar file should be included in the class path in order to run it. The only required method that must be defined in any customization is the static getConnection() method, which will return a database connection object when called.


Field Summary
protected static org.apache.struts.util.GenericDataSource ds
           
 
Constructor Summary
DBInterface()
           
 
Method Summary
static void close()
          Do the cleaning work, clase the DataSource object.
static java.sql.Connection getConnection()
          Return the Connection object.
static javax.sql.DataSource getDataSource()
          Return the DataSource object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ds

protected static org.apache.struts.util.GenericDataSource ds
Constructor Detail

DBInterface

public DBInterface()
Method Detail

getDataSource

public static javax.sql.DataSource getDataSource()
                                          throws java.sql.SQLException
Return the DataSource object.

Throws:
java.sql.SQLException

getConnection

public static java.sql.Connection getConnection()
                                         throws java.sql.SQLException
Return the Connection object.

Throws:
java.sql.SQLException

close

public static void close()
                  throws java.sql.SQLException
Do the cleaning work, clase the DataSource object.

Throws:
java.sql.SQLException