net.spy.db
Class FileDriver

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.db.FileDriver
All Implemented Interfaces:
Driver

public class FileDriver
extends SpyObject
implements Driver


Nested Class Summary
static class FileDriver.AnyParamMatcher
          Parameter matching instance that matches any parameter.
static class FileDriver.ClassParamMatcher
          Parameter matching instance that matches objects by class.
static interface FileDriver.ParamMatcher
          Parameter matching interface for fuzzy matches on query parameters.
static interface FileDriver.Updater
          Interface for registering updates.
 
Field Summary
static String URL_PREFIX
           
 
Constructor Summary
FileDriver()
           
 
Method Summary
 boolean acceptsURL(String arg0)
           
 void clearQueries()
          Remove all mapped queries.
 Connection connect(String url, Properties prop)
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 DriverPropertyInfo[] getPropertyInfo(String arg0, Properties arg1)
           
 boolean jdbcCompliant()
           
 void registerQuery(String url, DBSQL db, Object[] args, URL path)
          Register the query(-ies) from the given DBSQL and args to a URL.
 void registerQuery(String url, String s, Object[] args, URL f)
          Register a ResultSet URL to a parameterized query.
 void registerQuery(String url, String s, URL f)
          Register a query to URL mapping.
 void registerUpdate(String url, DBSQL db, Object[] args, FileDriver.Updater u)
          Register the update(s) from the given DBSQL and args to an updater.
 void registerUpdate(String url, DBSQL db, Object[] args, int rv)
          Register the update(s) from the given DBSQL and args to return an int.
 void registerUpdate(String url, String s, Object[] args, FileDriver.Updater action)
          Register an update action.
 void registerUpdate(String url, String s, Object[] args, int rv)
          Register a simple update that returns an int.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_PREFIX

public static final String URL_PREFIX
See Also:
Constant Field Values
Constructor Detail

FileDriver

public FileDriver()
Method Detail

registerQuery

public void registerQuery(String url,
                          String s,
                          URL f)
Register a query to URL mapping.

Parameters:
url - JDBC URL to which this query applies
s - the query string
f - the URL that will provide the results

registerQuery

public void registerQuery(String url,
                          String s,
                          Object[] args,
                          URL f)
Register a ResultSet URL to a parameterized query.

Parameters:
url - JDBC URL to which this query applies
s - the query string
args - the args
f - the URL with the result set

registerQuery

public void registerQuery(String url,
                          DBSQL db,
                          Object[] args,
                          URL path)
Register the query(-ies) from the given DBSQL and args to a URL.

Parameters:
url - JDBC URL to which this query applies
db - the DBSQL instance.
args - arguments to this query
path - the path of the results

registerUpdate

public void registerUpdate(String url,
                           String s,
                           Object[] args,
                           FileDriver.Updater action)
Register an update action.

Parameters:
url - JDBC URL to which this query applies
s - the query
args - the args
action - the action to be performed upon this update

registerUpdate

public void registerUpdate(String url,
                           DBSQL db,
                           Object[] args,
                           FileDriver.Updater u)
Register the update(s) from the given DBSQL and args to an updater.

Parameters:
url - JDBC URL to which this query applies
db - the DBSQL instance
args - the arguments to the update
u - the updater

registerUpdate

public void registerUpdate(String url,
                           DBSQL db,
                           Object[] args,
                           int rv)
Register the update(s) from the given DBSQL and args to return an int.

Parameters:
url - JDBC URL to which this query applies
db - the DBSQL instance
args - the arguments to the update
rv - the return value

registerUpdate

public void registerUpdate(String url,
                           String s,
                           Object[] args,
                           int rv)
Register a simple update that returns an int.

Parameters:
url - JDBC URL to which this query applies
s - the query
args - the args
rv - the value that should be returned from this update

clearQueries

public void clearQueries()
Remove all mapped queries.


connect

public Connection connect(String url,
                          Properties prop)
                   throws SQLException
Specified by:
connect in interface Driver
Throws:
SQLException

acceptsURL

public boolean acceptsURL(String arg0)
                   throws SQLException
Specified by:
acceptsURL in interface Driver
Throws:
SQLException

getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String arg0,
                                            Properties arg1)
                                     throws SQLException
Specified by:
getPropertyInfo in interface Driver
Throws:
SQLException

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface Driver

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface Driver

jdbcCompliant

public boolean jdbcCompliant()
Specified by:
jdbcCompliant in interface Driver


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.