FantasySportsModule 0.0.2-dev

org.fanfoot.db
Class DB

java.lang.Object
  |
  +--org.fanfoot.db.DB

public class DB
extends java.lang.Object

Provides utility methods for accessing the DB

Author:
rgardler

Constructor Summary
DB(java.lang.String dbURI)
          Create a DB objet to connect to the indicated DB
 
Method Summary
 void addResource(java.lang.String strID, java.lang.String strResource, java.lang.String strCollection)
          Add the supplied string as a resource to the collection indicated.
 org.xmldb.api.base.Collection getCollection(java.lang.String strCollectionName)
          Get the collection named from the DB in use
 org.xmldb.api.base.ResourceSet runXPathQuery(java.lang.String strCollection, java.lang.String strQuery)
          Query the indicated collection with the XPath query supplied.
 void runXUpdateQuery(java.lang.String strCollection, java.lang.String strUpdate)
          XUpdate the indicated collection with the XUpdate modificatons supplied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB

public DB(java.lang.String dbURI)
   throws DBException
Create a DB objet to connect to the indicated DB

Parameters:
dbURI - the URI of the DB to connect to
Throws:
DBException - Description of the Exception
Method Detail

runXPathQuery

public org.xmldb.api.base.ResourceSet runXPathQuery(java.lang.String strCollection,
                                                    java.lang.String strQuery)
                                             throws DBException
Query the indicated collection with the XPath query supplied.

Parameters:
strCollection - Description of the Parameter
strQuery - XPath query to run
Returns:
Throws:
DBException - if unable to query the database

runXUpdateQuery

public void runXUpdateQuery(java.lang.String strCollection,
                            java.lang.String strUpdate)
                     throws DBException
XUpdate the indicated collection with the XUpdate modificatons supplied.

Parameters:
strCollection - Description of the Parameter
strUpdate - XUdpate modifications to run
Throws:
DBException - if unable to update the database

getCollection

public org.xmldb.api.base.Collection getCollection(java.lang.String strCollectionName)
                                            throws DBException
Get the collection named from the DB in use

Parameters:
strCollectionName - Description of the Parameter
Returns:
The collection value
Throws:
DBException - if unable the get the collection

addResource

public void addResource(java.lang.String strID,
                        java.lang.String strResource,
                        java.lang.String strCollection)
                 throws DBException
Add the supplied string as a resource to the collection indicated.

Parameters:
strID - the id of the resource (if null an ID will be generated)
strResource - the resource to add
strCollection - the collection to add it to
Throws:
DBException - if any problem occurs connecting to the DB

FantasySportsModule 0.0.2-dev

Copyright © 2003 We know What you Want.net. All Rights Reserved.