- All Superinterfaces:
BaseProperties
- All Known Subinterfaces:
BackupManager,DatabaseConnectionProperties,EventManager,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,FBNBackupManager,FBServiceManager,FbServiceProperties,FBSimpleDataSource,FBStatisticsManager,FBStreamingBackupManager,FBTraceManager,FBUserManager,FBXADataSource
- Since:
- 5
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringGet the list of authentication plugins to try.default StringJava character set configured for the connection.default intGet the connect timeout in seconds.default StringGet the database encryption plugin configuration.default StringComma-separated list of additionally enabled protocols.default StringFirebird character set configured for the connection.default intdefault Stringdefault intGet the port number of the server.default Integerdefault Stringdefault Stringdefault StringGet the hostname or IP address of the Firebird server.default intGet the socket buffer size.default StringThe class name of a custom socket factory to be used for pure Java connections.default intGet the initial Socket blocking timeout (SoTimeout).default StringgetType()default StringgetUser()default StringGet the wire encryption level.default booleanGet if wire compression should be enabled.default voidsetAuthPlugins(String authPlugins) Sets the authentication plugins to try.default voidsetCharSet(String charSet) Set the Java character set for the connection.default voidsetConnectTimeout(int connectTimeout) Set the connect timeout in seconds.default voidsetDbCryptConfig(String dbCryptConfig) Sets the database encryption plugin configuration.default voidsetEnableProtocol(String enableProtocol) Comma-separated list of additionally enabled protocols.default voidsetEncoding(String encoding) Set the Firebird character set for the connection.default voidsetParallelWorkers(int parallelWorkers) Sets the number of parallel workers of the connection.default voidsetPassword(String password) default voidsetPortNumber(int portNumber) Set the port number of the server.default voidsetProcessId(Integer processId) Sets a custom process id to send to Firebird on attach.default voidsetProcessName(String processName) Sets a custom process name to send to Firebird on attachdefault voidsetRoleName(String roleName) default voidsetServerName(String serverName) Set the hostname or IP address of the Firebird server.default voidsetSocketBufferSize(int socketBufferSize) Set the socket buffer size.default voidsetSocketFactory(String socketFactory) Sets the class name of a custom socket factory to be used for pure Java connections.default voidsetSoTimeout(int soTimeout) Set the initial Socket blocking timeout (SoTimeout).default voiddefault voiddefault voidsetWireCompression(boolean wireCompression) Sets if the connection should try to enable wire compression.default voidsetWireCrypt(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), thedatabaseNameorserviceNameis used as the full identification of the database host, port and database path/alias. Protocol implementations, for examplePURE_JAVA, may default tolocalhostwhen this property isnull, butdatabaseName/serviceNamedoes 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 ifserverNameisnull, 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.charsetNameor {code defaultEncodingDefinition.javaCharset}).- Returns:
- Java character set for the connection (
nullwhen not explicitly configured).
-
setCharSet
Set the Java character set for the connection.It is possible to set both the
charSetandencodingto 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 toencodingproperty, 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 (
nullwhen not explicitly configured).
-
setEncoding
Set the Firebird character set for the connection.It is possible to set both the
charSetandencodingto 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;
nullmeans 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;nullto apply the default behaviour (seegetProcessId())
-
getProcessName
- Returns:
- Custom process name sent to Firebird on attach;
nullmeans 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;nullto apply the default behaviour (seegetProcessName())
-
getSocketBufferSize
default int getSocketBufferSize()Get the socket buffer size.- Returns:
- socket buffer size in bytes, or
-1if 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
-1if 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
-1if 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 (nullnot 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.confread by the client library will be used.- Returns:
truewire compression enabled- Since:
- 4.0
-
setWireCompression
default void setWireCompression(boolean wireCompression) Sets if the connection should try to enable wire compression.- Parameters:
wireCompression-trueenable wire compression,falsedisable 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.32780for 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,
-1means 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
MaxParallelWorkershigher 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
SocketFactoryimplementation, or (default)nullfor 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
SocketFactoryand have a public single-arg constructor accepting aProperties, or a public no-arg constructor. ThePropertiesobject 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 aSocketFactoryimplementation, ornullfor the default socket factory- Since:
- 6
-