|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.spy.db.DefaultQuerySelector
Default implementation of query selector.
This implementation of QuerySelector works by finding the best match for
the given Connection by package name. If given a SpyConfig, it looks
for either an entry called queryName or a prefix match
against the driver name as specified for SpyDB.
The following driver prefixes are mapped to their respective names in this implementation:
| Driver class prefix | Query Name | Driver Provider |
|---|---|---|
| org.postgresql. | pgsql | http://www.postgresql.org |
| oracle.jdbc.driver. | oracle | http://www.oracle.com |
| weblogic.jdbc.oci. | oracle | http://www.bea.com |
| com.ashna.jturbo. | mssql | http://www.newatlanta.com/ |
SpyDB| Field Summary |
| Fields inherited from interface net.spy.db.QuerySelector |
DEFAULT_QUERY |
| Constructor Summary | |
DefaultQuerySelector()
Get an instance of DefaultQuerySelector. |
|
| Method Summary | |
String |
getQuery(Connection conn,
Map queryMap)
Get the query for the given connection. |
String |
getQuery(SpyConfig conf,
Map queryMap)
Get the query for the given config. |
protected String |
getQuery(String name,
Map queryMap)
Attempt to get a query in the given map by a name. |
protected void |
initNameMap()
Initialize the prefix to name map. |
protected void |
registerNameMapping(String prefix,
String name)
Register a prefix -> name mapping. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultQuerySelector()
| Method Detail |
protected void initNameMap()
protected void registerNameMapping(String prefix,
String name)
prefix - the prefix to match for a namename - the name
public String getQuery(Connection conn,
Map queryMap)
QuerySelector
getQuery in interface QuerySelectorconn - the connection that wants the queryqueryMap - the Map of queries by name
QuerySelector
public String getQuery(SpyConfig conf,
Map queryMap)
QuerySelector
getQuery in interface QuerySelectorconf - a SpyConfig containing enough information to find a queryqueryMap - the Map of queries by name
QuerySelector
protected String getQuery(String name,
Map queryMap)
name - the name against which to searchqueryMap - the map containing the queries
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||