- All Superinterfaces:
BaseProperties
- All Known Subinterfaces:
BackupManager
,DatabaseConnectionProperties
,EventManager
,FBManagerMBean
,FirebirdConnectionProperties
,IAttachProperties<T>
,IConnectionProperties
,IServiceProperties
,MaintenanceManager
,NBackupManager
,ServiceConnectionProperties
,ServiceManager
,StatisticsManager
,TraceManager
,UserManager
- All Known Implementing Classes:
AbstractAttachProperties
,AbstractConnectionPropertiesDataSource
,AbstractImmutableAttachProperties
,FBAbstractCommonDataSource
,FBBackupManager
,FBBackupManagerBase
,FBConnectionPoolDataSource
,FbConnectionProperties
,FBConnectionProperties
,FBEventManager
,FbImmutableConnectionProperties
,FbImmutableServiceProperties
,FBMaintenanceManager
,FBManagedConnectionFactory
,FBManager
,FBNBackupManager
,FBServiceManager
,FbServiceProperties
,FBSimpleDataSource
,FBStatisticsManager
,FBStreamingBackupManager
,FBTraceManager
,FBUserManager
,FBXADataSource
- Since:
- 5
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Get the list of authentication plugins to try.default String
Java character set configured for the connection.default int
Get the connect timeout in seconds.default String
Get the database encryption plugin configuration.default String
Comma-separated list of additionally enabled protocols.default String
Firebird character set configured for the connection.default int
default String
default int
Get the port number of the server.default Integer
default String
default String
default String
Get the hostname or IP address of the Firebird server.default int
Get the socket buffer size.default String
The class name of a custom socket factory to be used for pure Java connections.default int
Get the initial Socket blocking timeout (SoTimeout).default String
getType()
default String
getUser()
default String
Get the wire encryption level.default boolean
Get if wire compression should be enabled.default void
setAuthPlugins
(String authPlugins) Sets the authentication plugins to try.default void
setCharSet
(String charSet) Set the Java character set for the connection.default void
setConnectTimeout
(int connectTimeout) Set the connect timeout in seconds.default void
setDbCryptConfig
(String dbCryptConfig) Sets the database encryption plugin configuration.default void
setEnableProtocol
(String enableProtocol) Comma-separated list of additionally enabled protocols.default void
setEncoding
(String encoding) Set the Firebird character set for the connection.default void
setParallelWorkers
(int parallelWorkers) Sets the number of parallel workers of the connection.default void
setPassword
(String password) default void
setPortNumber
(int portNumber) Set the port number of the server.default void
setProcessId
(Integer processId) Sets a custom process id to send to Firebird on attach.default void
setProcessName
(String processName) Sets a custom process name to send to Firebird on attachdefault void
setRoleName
(String roleName) default void
setServerName
(String serverName) Set the hostname or IP address of the Firebird server.default void
setSocketBufferSize
(int socketBufferSize) Set the socket buffer size.default void
setSocketFactory
(String socketFactory) Sets the class name of a custom socket factory to be used for pure Java connections.default void
setSoTimeout
(int soTimeout) Set the initial Socket blocking timeout (SoTimeout).default void
default void
default void
setWireCompression
(boolean wireCompression) Sets if the connection should try to enable wire compression.default void
setWireCrypt
(String wireCrypt) Set the wire encryption level.Methods inherited from interface org.firebirdsql.jaybird.props.BaseProperties
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
-
Method Details
-
getServerName
Get the hostname or IP address of the Firebird server.- Returns:
- Hostname or IP address of the server
- See Also:
-
setServerName
Set the hostname or IP address of the Firebird server.When set to
null
(the default), thedatabaseName
orserviceName
is used as the full identification of the database host, port and database path/alias. Protocol implementations, for examplePURE_JAVA
, may default tolocalhost
when this property isnull
, butdatabaseName
/serviceName
does not (seem to) contain a host name.- Parameters:
serverName
- Hostname or IP address of the server
-
getPortNumber
default int getPortNumber()Get the port number of the server.- Returns:
- Port number of the server
- See Also:
-
setPortNumber
default void setPortNumber(int portNumber) Set the port number of the server.Defaults to
3050
. This property value will be ignored ifserverName
isnull
, unless the protocol implementation needs a hostname, but cannot find a hostname indatabaseName
/serviceName
.- Parameters:
portNumber
- Port number of the server- See Also:
-
getType
- Returns:
- type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS implementations installed in the system.
-
setType
- Parameters:
type
- type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS implementations installed in the system.- Throws:
IllegalStateException
- may be thrown when type cannot or can no longer be changed
-
getUser
- Returns:
- Name of the user to authenticate to the server.
-
setUser
- Parameters:
user
- Name of the user to authenticate to the server.
-
getPassword
- Returns:
- Password to authenticate to the server.
-
setPassword
- Parameters:
password
- Password to authenticate to the server.
-
getRoleName
- Returns:
- SQL role to use.
-
setRoleName
- Parameters:
roleName
- SQL role to use.
-
getCharSet
Java character set configured for the connection.After connect, the actual Java character set applied can be obtained from
FbAttachment.getEncoding()
(propertycharsetName
), orFbAttachment.getEncodingFactory()
(propertiesdefaultEncoding.charsetName
or {code defaultEncodingDefinition.javaCharset}).- Returns:
- Java character set for the connection (
null
when not explicitly configured).
-
setCharSet
Set the Java character set for the connection.It is possible to set both the
charSet
andencoding
to achieve a character set conversion effect, but in general only one of both properties should be set.- Parameters:
charSet
- Character set for the connection. Similar toencoding
property, but accepts Java names instead of Firebird ones.- See Also:
-
getEncoding
Firebird character set configured for the connection.After connect, the actual Firebird character set applied can be obtained from
FbAttachment.getEncodingFactory()
, propertydefaultEncodingDefinition.firebirdEncodingName
.- Returns:
- Firebird character encoding for the connection (
null
when not explicitly configured).
-
setEncoding
Set the Firebird character set for the connection.It is possible to set both the
charSet
andencoding
to achieve a character set conversion effect, but in general only one of both properties should be set.- Parameters:
encoding
- Firebird character encoding for the connection. See Firebird documentation for more information.- See Also:
-
getProcessId
- Returns:
- Custom process id sent to Firebird on attach;
null
means the default is applied (read from system propertyorg.firebirdsql.jdbc.pid
, future versions may also determine the actual process id)
-
setProcessId
Sets a custom process id to send to Firebird on attach.- Parameters:
processId
- The process id to send;null
to apply the default behaviour (seegetProcessId()
)
-
getProcessName
- Returns:
- Custom process name sent to Firebird on attach;
null
means the default is applied (read from system propertyorg.firebirdsql.jdbc.processName
)
-
setProcessName
Sets a custom process name to send to Firebird on attach- Parameters:
processName
- The process name to send;null
to apply the default behaviour (seegetProcessName()
)
-
getSocketBufferSize
default int getSocketBufferSize()Get the socket buffer size.- Returns:
- socket buffer size in bytes, or
-1
if not set
-
setSocketBufferSize
default void setSocketBufferSize(int socketBufferSize) Set the socket buffer size.- Parameters:
socketBufferSize
- socket buffer size in bytes.
-
getSoTimeout
default int getSoTimeout()Get the initial Socket blocking timeout (SoTimeout).- Returns:
- The initial socket blocking timeout in milliseconds (0 is 'infinite'), or
-1
if not set
-
setSoTimeout
default void setSoTimeout(int soTimeout) Set the initial Socket blocking timeout (SoTimeout).- Parameters:
soTimeout
- Timeout in milliseconds (0 is 'infinite')
-
getConnectTimeout
default int getConnectTimeout()Get the connect timeout in seconds.- Returns:
- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout), or
-1
if not set
-
setConnectTimeout
default void setConnectTimeout(int connectTimeout) Set the connect timeout in seconds.- Parameters:
connectTimeout
- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)
-
getWireCrypt
Get the wire encryption level.- Returns:
- Wire encryption level
- Since:
- 4.0
-
setWireCrypt
Set the wire encryption level.Values are defined by
WireCrypt
, values are handled case insensitive. Invalid values will throw an exception.- Parameters:
wireCrypt
- Wire encryption level (null
not allowed)- Throws:
InvalidPropertyValueException
- If the value is not one of the allowed values- Since:
- 4.0
-
getDbCryptConfig
Get the database encryption plugin configuration.- Returns:
- Database encryption plugin configuration, meaning plugin specific
- Since:
- 3.0.4
-
setDbCryptConfig
Sets the database encryption plugin configuration.- Parameters:
dbCryptConfig
- Database encryption plugin configuration, meaning plugin specific- Since:
- 3.0.4
-
getAuthPlugins
Get the list of authentication plugins to try.- Returns:
- comma-separated list of authentication plugins
- Since:
- 4.0
-
setAuthPlugins
Sets the authentication plugins to try.Invalid names are skipped during authentication.
- Parameters:
authPlugins
- comma-separated list of authentication plugins- Since:
- 4.0
-
isWireCompression
default boolean isWireCompression()Get if wire compression should be enabled.Wire compression requires Firebird 3 or higher, and the server must have the zlib library. If compression cannot be negotiated, the connection will be made without wire compression.
This property will be ignored for native connections. For native connections, the configuration in
firebird.conf
read by the client library will be used.- Returns:
true
wire compression enabled- Since:
- 4.0
-
setWireCompression
default void setWireCompression(boolean wireCompression) Sets if the connection should try to enable wire compression.- Parameters:
wireCompression
-true
enable wire compression,false
disable wire compression (the default)- Since:
- 4.0
- See Also:
-
getEnableProtocol
Comma-separated list of additionally enabled protocols.By default, pure Java connections of Jaybird only supports the protocol versions of supported Firebird versions. This property lists the additionally enabled unsupported protocol versions. If Jaybird does not have a listed protocol, it is silently ignored.
This property is ignored for native connections.
- Returns:
- List of unsupported protocol versions to try in addition to the supported protocols. Comma-separated
using only the version number (e.g.
"10,11"
). Both the unmasked and masked version are supported (e.g.32780
for protocol12
), but we recommend to use the unmasked version. The value"*"
will try all available protocols. - Since:
- 6
-
setEnableProtocol
Comma-separated list of additionally enabled protocols.- Parameters:
enableProtocol
- List of unsupported protocol versions to try in addition to the supported protocols.- Since:
- 6
- See Also:
-
getParallelWorkers
default int getParallelWorkers()- Returns:
- number of parallel workers,
-1
means no value was set (or it was explicitly set to-1
) - Since:
- 5.0.2
-
setParallelWorkers
default void setParallelWorkers(int parallelWorkers) Sets the number of parallel workers of the connection.Requires Firebird 5.0 or higher, and a Firebird server configured with
MaxParallelWorkers
higher than specified byparallelWorkers
.NOTE: For service attachments, this property controls behaviour only for specific operations, and requires Jaybird to explicitly set the parallel workers for that operation.
- Parameters:
parallelWorkers
- number of parallel workers- Since:
- 5.0.2
-
getSocketFactory
The class name of a custom socket factory to be used for pure Java connections.- Returns:
- fully-qualified class name of a
SocketFactory
implementation, or (default)null
for the default socket factory - Since:
- 6
- See Also:
-
setSocketFactory
Sets the class name of a custom socket factory to be used for pure Java connections.The class must extend
SocketFactory
and have a public single-arg constructor accepting aProperties
, or a public no-arg constructor. TheProperties
object passed in the first case contains custom connection properties with the suffix@socketFactory
, and — possibly — other selected properties.- Parameters:
socketFactory
- fully-qualified class name of aSocketFactory
implementation, ornull
for the default socket factory- Since:
- 6
-