|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sybase implementation of the Driver
interface.
It recognizes URLs of the form:
jdbc:sybase:<protocol>:<...>
If the URL is not of this form it will return a null connection.
If this is the case, and SybDriver is the only driver loaded,
DriverManager.getConnection
will throw a NoSuitableDriverException
.
The driver will raise a SQLException
if the URL is of the
correct form but the driver is unable to connect to
the database.
The java.util.Properties
argument can be used to pass
arbitrary string tag/value pairs as connection arguments.
Normally, at least "user" and "password" properties should be
included in the properties.
Driver
objects obtained from jConnect can be cast
to this class to access Sybase-specific methods.
There are two ways to set the driver connection properties:
Driver connection properties set in the URL do not
override any corresponding connection properties set in
the application using the DriverManager.getConnection
method.
To obtain a current list of properties for any driver, use
Driver.getDriverProperties
.
The driver connection property names are not
case-sensitive. jConnect uses prop.equalsIgnoreCase
to remove case-sensitivity on property names.
Driver constructors are never called, rather a single instance of a driver is statically created when its class is loaded and that instance is installed in the static DriverManager. This static driver instance serves as a Connection factory. Drivers are never destroyed.
Driver
,
java.sql.DriverManager
Field Summary | |
static int |
VERSION_2
Version 2.x. |
static int |
VERSION_3
Version 3.x. |
static int |
VERSION_4
Versions 4.0, 4.1 and 4.2. |
static int |
VERSION_5
Versions 5.0 and 5.2 Same behavior as versions 4.0, 4.1 and 4.2. |
static int |
VERSION_6
Versions 4.5 and 5.5 Versions 4.5 and 5.5 allow the user to request XNL widetable support from the server. |
static int |
VERSION_LATEST
Instructs the driver to behave as the latest version. |
Method Summary | |
DynamicClassLoader |
getClassLoader(String url,
Properties props)
Return a new class loader which will connect with the specified url and properties. |
Debug |
getDebug()
Returns a Debug object for this driver. |
SybMessageHandler |
getSybMessageHandler()
Returns the current message handler object for this driver. |
void |
setRemotePassword(String serverName,
String password,
Properties props)
Set the remote password in the given Properties object. |
void |
setSybMessageHandler(SybMessageHandler msgHandler)
Sets the message handler for this driver. |
void |
setVersion(int version)
Configures the driver for the desired behavior. |
Methods inherited from interface java.sql.Driver |
acceptsURL,
connect,
getMajorVersion,
getMinorVersion,
getPropertyInfo,
jdbcCompliant |
Field Detail |
public static final int VERSION_2
Version values can be passed to setVersion
to
cause the driver to have expected behavior relative to the
version of jConnect the application was built with.
The default is VERSION_2 since setVersion was not introduced
until VERSION_3
, and no 2.x application could set
VERSION_2.
Applications that require more recent behavior must explicitly
set a higher version number (or VERSION_LATEST
).
When VERSION_2
is specified, the default character-set
converter is TruncationConverter
unless the character
set in use
does not allow truncation, in which case the default is
PureConverter
.
For higher versions, the default is always
PureConverter
.
The CANCEL_ALL
connection property defaults to true.
The LANGUAGE
connection property defaults to us_english.
CharsetConverter
public static final int VERSION_3
When Version 3 is specified,
the default character-set converter is PureConverter
.
The CANCEL_ALL
property defaults to true.
The LANGUAGE
connection property defaults to
us_english
.
public static final int VERSION_4
When Version 4 is specified
the default character-set converter is PureConverter
.
The CANCEL_ALL
property defaults to false.
The LANGUAGE
connection property defaults to null, and
the initial language used to log in to the database is chosen based
upon the application's default localization. Supported languages
are chinese
, us_english
, french
,
german
,
japanese
, korean
, portuguese
and
spanish
.
public static final int VERSION_5
Same behavior as versions 4.0, 4.1 and 4.2.
public static final int VERSION_6
Versions 4.5 and 5.5 allow the user to request XNL widetable support from the server.
public static final int VERSION_LATEST
Method Detail |
public void setVersion(int version) throws SQLException
This method can be called multiple times with different version values. Connections inherit the behavior associated with the version at the time the connection is made. Subsequent changes to the version in the driver have no effect on existing connections.
version
- one of the SybDriver.VERSION
valuesVERSION_2
,
VERSION_3
,
VERSION_4
,
VERSION_5
,
VERSION_6
,
VERSION_LATEST
public void setSybMessageHandler(SybMessageHandler msgHandler)
msgHandler
- message handler to be called when an error
occurs or null to turn off error callbackspublic SybMessageHandler getSybMessageHandler()
public Debug getDebug()
public void setRemotePassword(String serverName, String password, Properties props)
This method can be used repeatedly to add servername/password combinations to the Properties object you provide. This Properties argument can then be used with the DriverManager.getConnection(String URL, Properties props) method.
serverName
- name of the remote serverpassword
- password at the remote serverprops
- the Properties in which to store the server/passwordpublic DynamicClassLoader getClassLoader(String url, Properties props)
url
- the db url used by the class loader to load classesprops
- the connection properties used by the loader to
connect to the database containing the classes.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |