com.wrq.apptrieve.jdbc
Class ApptrieveDriver

java.lang.Object
  extended by com.wrq.apptrieve.jdbc.ApptrieveDriver
All Implemented Interfaces:
java.sql.Driver

public class ApptrieveDriver
extends java.lang.Object
implements java.sql.Driver


Constructor Summary
ApptrieveDriver()
          Your basic constructor
 
Method Summary
 boolean acceptsURL(java.lang.String url)
          Discovers whether or not this driver can open a connection to the given URL.
 java.sql.Connection connect(java.lang.String urlIn, java.util.Properties info)
          Creates a connection to the Host Integrator server.
static void debug(java.lang.String classname, java.lang.String methodname)
           
static void debug(java.lang.String classname, java.lang.String methodname, boolean param1)
           
static void debug(java.lang.String classname, java.lang.String methodname, int param1)
           
static void debug(java.lang.String classname, java.lang.String methodname, int param1, boolean param2)
           
static void debug(java.lang.String classname, java.lang.String methodname, int param1, double param2)
           
static void debug(java.lang.String classname, java.lang.String methodname, int param1, int param2)
           
static void debug(java.lang.String classname, java.lang.String methodname, int param1, java.lang.Object param2)
           
static void debug(java.lang.String classname, java.lang.String methodname, int param1, java.lang.Object param2, int param3)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1, int param2)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1, java.lang.Object param2)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3, java.lang.Object param4)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3, java.lang.Object param4, java.lang.Object param5)
           
static void debug(java.lang.String classname, java.lang.String methodname, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3, java.lang.Object param4, java.lang.Object param5, java.lang.Object param6)
           
static void debugException(java.lang.String classname, java.lang.String methodname, java.sql.SQLException e)
           
static java.lang.String debugMessage(java.lang.String resource, java.lang.Object msg)
           
 int getMajorVersion()
          Gets the major version for this driver
 int getMinorVersion()
          Gets the minor version for this driver
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
          The getPropertyInfo method allows a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database.
static boolean isDebug()
           
 boolean jdbcCompliant()
          Returns the whether or not this driver supports a JDBC compliant implementation.
static java.lang.Object throwUnsupported(java.lang.String resource, java.lang.String method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApptrieveDriver

public ApptrieveDriver()
Your basic constructor

Method Detail

acceptsURL

public boolean acceptsURL(java.lang.String url)
Discovers whether or not this driver can open a connection to the given URL. Typically drivers will return true if they understand the sub-protocol specified in the URL and false otherwise.

Specified by:
acceptsURL in interface java.sql.Driver
Parameters:
url - java.lang.String - The URL for connecting to the database.
Returns:
boolean - True if this driver can connect to the given URL.
See Also:
Driver.acceptsURL(java.lang.String)

connect

public java.sql.Connection connect(java.lang.String urlIn,
                                   java.util.Properties info)
                            throws java.sql.SQLException
Creates a connection to the Host Integrator server. It first checks the given URL to see if it is meant for this driver. If not, the method simply returns null. Otherwise, it attempts to connect to the database. For the Host Integrator implementation of JDBC, it looks for a URL in the form of


     jdbc:apptrieve:table[;aads=aads_name][;domain=domain_name][;serverid=host_addr]
                         [;database=model][;session=sessionpool]
                         [;user=name][;password=xxx][;variables.varname=value]
 
Notes:
  1. either database or session have to be set in the url parameter or in the info parameter.
  2. either aads and domain or serverid have to be set in the url parameter or in the info parameter.
  3. user and password are for Host Integrator server authentication.
  4. each 'variables.varname=value' segment will cause model variable 'varname' to be initialized to 'value' upon connection to the Host Integrator server.

In addition to specifying connection properties in the url parameter, the same properties can also be specified in the info parameter Properties object. This object can include name-value pairs for aads, domain, serverid, database, session, user, and password. If a connection value is specified in both the info and url parameters, the url setting takes precedence.

Specified by:
connect in interface java.sql.Driver
Parameters:
urlIn - java.lang.String - the connection URL for the database
info - java.util.Properties - the properties object to use in connecting
Returns:
Connection - the connection object if connection is successful, null if not
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
Driver.connect(java.lang.String, java.util.Properties)

getMajorVersion

public int getMajorVersion()
Gets the major version for this driver

Specified by:
getMajorVersion in interface java.sql.Driver
Returns:
int - the major version number
See Also:
Driver.getMajorVersion()

getMinorVersion

public int getMinorVersion()
Gets the minor version for this driver

Specified by:
getMinorVersion in interface java.sql.Driver
Returns:
int - the minor version
See Also:
Driver.getMinorVersion()

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
                                              throws java.sql.SQLException
The getPropertyInfo method allows a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. Note that depending on the values the human has supplied so far, additional values may become necessary, so you may have to iterate though several calls to getPropertyInfo.

Specified by:
getPropertyInfo in interface java.sql.Driver
Parameters:
url - java.lang.String - The URL of the database to connect to.
info - Properties - A proposed list of tag/value pairs that will be sent on connect open.
Returns:
DriverPropertyInfo[] - An array of DriverPropertyInfo objects describing possible properties. This array may be an empty array if no properties are required.
Throws:
java.sql.SQLException
See Also:
Driver.getPropertyInfo(java.lang.String, java.util.Properties)

jdbcCompliant

public boolean jdbcCompliant()
Returns the whether or not this driver supports a JDBC compliant implementation. For Host Integrator this is always false.

Specified by:
jdbcCompliant in interface java.sql.Driver
Returns:
int - false

isDebug

public static boolean isDebug()

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         int param1)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         boolean param1)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1,
                         java.lang.Object param2)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         int param1,
                         int param2)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         int param1,
                         java.lang.Object param2)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1,
                         int param2)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         int param1,
                         boolean param2)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         int param1,
                         double param2)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1,
                         java.lang.Object param2,
                         java.lang.Object param3)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         int param1,
                         java.lang.Object param2,
                         int param3)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1,
                         java.lang.Object param2,
                         java.lang.Object param3,
                         java.lang.Object param4)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1,
                         java.lang.Object param2,
                         java.lang.Object param3,
                         java.lang.Object param4,
                         java.lang.Object param5)

debug

public static void debug(java.lang.String classname,
                         java.lang.String methodname,
                         java.lang.Object param1,
                         java.lang.Object param2,
                         java.lang.Object param3,
                         java.lang.Object param4,
                         java.lang.Object param5,
                         java.lang.Object param6)

debugException

public static void debugException(java.lang.String classname,
                                  java.lang.String methodname,
                                  java.sql.SQLException e)

debugMessage

public static java.lang.String debugMessage(java.lang.String resource,
                                            java.lang.Object msg)

throwUnsupported

public static java.lang.Object throwUnsupported(java.lang.String resource,
                                                java.lang.String method)
                                         throws java.sql.SQLException
Throws:
java.sql.SQLException