|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jtds.jdbc.DefaultProperties
Container for default property constants.
This class also provides static utility methods forProperties
and Settings
objects.
To add new properties to the jTDS driver, do the following:
prop.foo
and prop.desc.foo
properties to Messages.properties
.static final
default field to DefaultProperties
.addDefaultProperties(java.util.Properties)
to set the default.Driver.createChoicesMap()
and
DriverUnitTest.test_getPropertyInfo_Choices()
if the property
has a specific set of inputs, e.g., "true" and "false", or "1" and "2".Driver.createRequiredTrueMap()
and
DriverUnitTest.test_getPropertyInfo_Required()
if the property
is required.DefaultPropertiesTestLibrary
for the new
property.
Field Summary | |
static java.lang.String |
APP_NAME
Default appName property. |
static java.lang.String |
AUTO_COMMIT
Default autoCommit property. |
static java.lang.String |
BATCH_SIZE_SQLSERVER
Default batchSize property for SQL Server. |
static java.lang.String |
BATCH_SIZE_SYBASE
Default batchSize property for Sybase. |
private static java.util.HashMap |
batchSizeDefaults
Default max batch size based on server type |
static java.lang.String |
BIND_ADDRESS
Default bindAddress property. |
static java.lang.String |
BUFFER_DIR
Default tmpDir property. |
static java.lang.String |
BUFFER_MAX_MEMORY
Default bufferMaxMemory property. |
static java.lang.String |
BUFFER_MIN_PACKETS
Default bufferMinPackets property. |
static java.lang.String |
CACHEMETA
Default cacheMetaData property. |
static java.lang.String |
CHARSET
Default charset property. |
static java.lang.String |
DATABASE_NAME
Default databaseName property. |
static java.lang.String |
DOMAIN
Default domain property. |
static java.lang.String |
INSTANCE
Default instance property. |
static java.lang.String |
LANGUAGE
Default language property. |
static java.lang.String |
LAST_UPDATE_COUNT
Default lastUpdateCount property. |
static java.lang.String |
LOB_BUFFER_SIZE
Default lobBufferSize property. |
static java.lang.String |
LOGFILE
Default logfile property. |
static java.lang.String |
LOGIN_TIMEOUT
Default loginTimeout property. |
static java.lang.String |
MAC_ADDRESS
Default macAddress property. |
static java.lang.String |
MAX_STATEMENTS
Default maxStatements property. |
static java.lang.String |
NAMED_PIPE
Default namedPipe property. |
static java.lang.String |
NAMED_PIPE_PATH_SQLSERVER
Default namedPipePath property for SQL Server. |
static java.lang.String |
NAMED_PIPE_PATH_SYBASE
Default namedPipePath property for Sybase. |
static java.lang.String |
PACKET_SIZE_42
Default packetSize property for TDS 4.2. |
static java.lang.String |
PACKET_SIZE_50
Default packetSize property for TDS 5.0. |
static java.lang.String |
PACKET_SIZE_70_80
Default packetSize property for TDS 7.0 and TDS 8.0. |
private static java.util.HashMap |
packetSizeDefaults
Default packet size based on TDS version |
static java.lang.String |
PASSWORD
Default password property. |
static java.lang.String |
PORT_NUMBER_SQLSERVER
Default portNumber property for SQL Server. |
static java.lang.String |
PORT_NUMBER_SYBASE
Default portNumber property for Sybase. |
private static java.util.HashMap |
portNumberDefaults
Default port number based on server type |
static java.lang.String |
PREPARE_SQLSERVER
Default prepareSql property for SQL Server. |
static java.lang.String |
PREPARE_SYBASE
Default prepareSql property for Sybase. |
private static java.util.HashMap |
prepareSQLDefaults
Default prepare SQL mode based on server type |
static java.lang.String |
PROCESS_ID
Default processId property. |
static java.lang.String |
PROG_NAME
Default progName property. |
static java.lang.String |
SERVER_TYPE_SQLSERVER
Default serverType property for SQL Server. |
static java.lang.String |
SERVER_TYPE_SYBASE
Default serverType property for Sybase. |
static java.lang.String |
SOCKET_KEEPALIVE
Default socketKeepAlive property. |
static java.lang.String |
SOCKET_TIMEOUT
Default sockeTimeout property. |
static java.lang.String |
SSL
Default ssl property. |
static java.lang.String |
TCP_NODELAY
Default tcpNoDelay property. |
static java.lang.String |
TDS_VERSION_42
Default tds property for TDS 4.2. |
static java.lang.String |
TDS_VERSION_50
Default tds property for TDS 5.0. |
static java.lang.String |
TDS_VERSION_70
Default tds property for TDS 7.0. |
static java.lang.String |
TDS_VERSION_80
Default tds property for TDS 8.0. |
private static java.util.HashMap |
tdsDefaults
Default TDS version based on server type |
static java.lang.String |
USE_UNICODE
Default sendStringParametersAsUnicode property. |
static java.lang.String |
USECURSORS
Default useCursors property. |
static java.lang.String |
USEJCIFS
Default useJCIFS property. |
static java.lang.String |
USELOBS
Default useLOBs property. |
static java.lang.String |
USENTLMV2
Default useNTLMv2 property. |
static java.lang.String |
USER
Default user property. |
static java.lang.String |
WSID
Default wsid property. |
static java.lang.String |
XAEMULATION
Default XaEmulation property. |
Constructor Summary | |
DefaultProperties()
|
Method Summary | |
static java.util.Properties |
addDefaultProperties(java.util.Properties props)
Add default properties to the props properties object. |
private static void |
addDefaultPropertyIfNotSet(java.util.Properties props,
java.lang.String key,
java.lang.String defaultValue)
Sets a default property if the property is not already set. |
private static void |
addDefaultPropertyIfNotSet(java.util.Properties props,
java.lang.String key,
java.lang.String defaultKey,
java.util.Map defaults)
Sets a default property if the property is not already set, using the defaultKey and the defaults map to
determine the correct value. |
static java.lang.String |
getNamedPipePath(int serverType)
Returns the default path for the named pipe for a given serverType. |
static java.lang.String |
getServerType(int serverType)
Converts an integer server type to its string representation. |
static java.lang.Integer |
getServerType(java.lang.String serverType)
Converts a string server type to its integer representation. |
static java.lang.String |
getServerTypeWithDefault(int serverType)
Same as getServerType(int) , only it returns the default server
type ("sqlserver" ) if serverType is 0. |
static java.lang.Integer |
getTdsVersion(java.lang.String tdsVersion)
Converts a string TDS version to its integer representation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String APP_NAME
appName
property.
public static final java.lang.String AUTO_COMMIT
autoCommit
property.
public static final java.lang.String BATCH_SIZE_SQLSERVER
batchSize
property for SQL Server.
public static final java.lang.String BATCH_SIZE_SYBASE
batchSize
property for Sybase.
public static final java.lang.String BIND_ADDRESS
bindAddress
property.
public static final java.lang.String BUFFER_MAX_MEMORY
bufferMaxMemory
property.
public static final java.lang.String BUFFER_MIN_PACKETS
bufferMinPackets
property.
public static final java.lang.String CACHEMETA
cacheMetaData
property.
public static final java.lang.String CHARSET
charset
property.
public static final java.lang.String DATABASE_NAME
databaseName
property.
public static final java.lang.String INSTANCE
instance
property.
public static final java.lang.String DOMAIN
domain
property.
public static final java.lang.String LAST_UPDATE_COUNT
lastUpdateCount
property.
public static final java.lang.String LOB_BUFFER_SIZE
lobBufferSize
property.
public static final java.lang.String LOGIN_TIMEOUT
loginTimeout
property.
public static final java.lang.String MAC_ADDRESS
macAddress
property.
public static final java.lang.String MAX_STATEMENTS
maxStatements
property.
public static final java.lang.String NAMED_PIPE
namedPipe
property.
public static final java.lang.String NAMED_PIPE_PATH_SQLSERVER
namedPipePath
property for SQL Server.
public static final java.lang.String NAMED_PIPE_PATH_SYBASE
namedPipePath
property for Sybase.
public static final java.lang.String PACKET_SIZE_42
packetSize
property for TDS 4.2.
public static final java.lang.String PACKET_SIZE_50
packetSize
property for TDS 5.0.
public static final java.lang.String PACKET_SIZE_70_80
packetSize
property for TDS 7.0 and TDS 8.0.
public static final java.lang.String PASSWORD
password
property.
public static final java.lang.String PORT_NUMBER_SQLSERVER
portNumber
property for SQL Server.
public static final java.lang.String PORT_NUMBER_SYBASE
portNumber
property for Sybase.
public static final java.lang.String LANGUAGE
language
property.
public static final java.lang.String PREPARE_SQLSERVER
prepareSql
property for SQL Server.
public static final java.lang.String PREPARE_SYBASE
prepareSql
property for Sybase.
public static final java.lang.String PROG_NAME
progName
property.
public static final java.lang.String TCP_NODELAY
tcpNoDelay
property.
public static final java.lang.String BUFFER_DIR
tmpDir
property.
public static final java.lang.String USE_UNICODE
sendStringParametersAsUnicode
property.
public static final java.lang.String USECURSORS
useCursors
property.
public static final java.lang.String USEJCIFS
useJCIFS
property.
public static final java.lang.String USELOBS
useLOBs
property.
public static final java.lang.String USENTLMV2
useNTLMv2
property.
public static final java.lang.String USER
user
property.
public static final java.lang.String WSID
wsid
property.
public static final java.lang.String XAEMULATION
XaEmulation
property.
public static final java.lang.String LOGFILE
logfile
property.
public static final java.lang.String SOCKET_TIMEOUT
sockeTimeout
property.
public static final java.lang.String SOCKET_KEEPALIVE
socketKeepAlive
property.
public static final java.lang.String PROCESS_ID
processId
property.
public static final java.lang.String SERVER_TYPE_SQLSERVER
serverType
property for SQL Server.
public static final java.lang.String SERVER_TYPE_SYBASE
serverType
property for Sybase.
public static final java.lang.String TDS_VERSION_42
tds
property for TDS 4.2.
public static final java.lang.String TDS_VERSION_50
tds
property for TDS 5.0.
public static final java.lang.String TDS_VERSION_70
tds
property for TDS 7.0.
public static final java.lang.String TDS_VERSION_80
tds
property for TDS 8.0.
public static final java.lang.String SSL
ssl
property.
private static final java.util.HashMap tdsDefaults
private static final java.util.HashMap portNumberDefaults
private static final java.util.HashMap packetSizeDefaults
private static final java.util.HashMap batchSizeDefaults
private static final java.util.HashMap prepareSQLDefaults
Constructor Detail |
public DefaultProperties()
Method Detail |
public static java.util.Properties addDefaultProperties(java.util.Properties props)
props
properties object.
props
- The properties object.
props
object, or null
if the serverType
property is not set.private static void addDefaultPropertyIfNotSet(java.util.Properties props, java.lang.String key, java.lang.String defaultValue)
props
- The properties object.key
- The message key to set.defaultValue
- The default value to set.private static void addDefaultPropertyIfNotSet(java.util.Properties props, java.lang.String key, java.lang.String defaultKey, java.util.Map defaults)
defaultKey
and the defaults
map to
determine the correct value.
props
- The properties object.key
- The message key to set.defaultKey
- The key whose value determines which default
value to set from defaults
.defaults
- The mapping of defaultKey
values to
the correct key
value to set.public static java.lang.String getNamedPipePath(int serverType)
serverType
- Driver.SQLSERVER
or Driver.SYBASE
or 0
(default)
java.lang.IllegalArgumentException
- if an invalid serverType is givenpublic static java.lang.String getServerType(int serverType)
serverType
- the server type as an int
null
if unknownpublic static java.lang.Integer getServerType(java.lang.String serverType)
serverType
- the server type as a string
null
if
unknownpublic static java.lang.String getServerTypeWithDefault(int serverType)
getServerType(int)
, only it returns the default server
type ("sqlserver"
) if serverType
is 0.
serverType
- integer server type or 0 for default
"sqlserver"
if unknownpublic static java.lang.Integer getTdsVersion(java.lang.String tdsVersion)
tdsVersion
- The TDS version as a string.
null
if unknown.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |