Class FbConnectionProperties
- java.lang.Object
-
- org.firebirdsql.gds.ng.AbstractAttachProperties<IConnectionProperties>
-
- org.firebirdsql.gds.ng.FbConnectionProperties
-
- All Implemented Interfaces:
IAttachProperties<IConnectionProperties>,IConnectionProperties
public final class FbConnectionProperties extends AbstractAttachProperties<IConnectionProperties> implements IConnectionProperties
Mutable implementation ofIConnectionProperties- Since:
- 3.0
- Author:
- Mark Rotteveel
- See Also:
FbImmutableConnectionProperties
-
-
Field Summary
-
Fields inherited from interface org.firebirdsql.gds.ng.IAttachProperties
DEFAULT_CONNECT_TIMEOUT, DEFAULT_PORT, DEFAULT_SERVER_NAME, DEFAULT_SO_TIMEOUT, DEFAULT_SOCKET_BUFFER_SIZE
-
Fields inherited from interface org.firebirdsql.gds.ng.IConnectionProperties
DEFAULT_BUFFERS_NUMBER, DEFAULT_DIALECT, SESSION_TIME_ZONE_SERVER
-
-
Constructor Summary
Constructors Constructor Description FbConnectionProperties()Default constructor for FbConnectionPropertiesFbConnectionProperties(IConnectionProperties src)Copy constructor for FbConnectionProperties.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IConnectionPropertiesasImmutable()IConnectionPropertiesasNewMutable()protected voiddirtied()Called by setters if they have been called.voidfromDpb(DatabaseParameterBuffer dpb)Deprecated.TODO: This method is only intended to simplify migration of the protocol implementation and needs to be removed.java.lang.StringgetAttachObjectName()shortgetConnectionDialect()Get the dialect of the client connectionjava.lang.StringgetDatabaseName()DatabaseParameterBuffergetExtraDatabaseParameters()Gets the extra database parameters.intgetPageCacheSize()Get the page cache size.java.lang.StringgetSessionTimeZone()Get thesessionTimeZone.booleanisColumnLabelForName()Gets the current setting ofcolumnLabelForNamebooleanisResultSetDefaultHoldable()Get whether ResultSets are holdable by default.voidsetColumnLabelForName(boolean columnLabelForName)Set ifResultSetMetaData.getColumnName(int)returns thecolumnLabelinstead of thecolumnName.voidsetConnectionDialect(short connectionDialect)Set the dialect of the client connectionvoidsetDatabaseName(java.lang.String databaseName)voidsetPageCacheSize(int pageCacheSize)Set the page cache size.voidsetResultSetDefaultHoldable(boolean holdable)Set ifResultSetshould beResultSet.HOLD_CURSORS_OVER_COMMITby default.voidsetSessionTimeZone(java.lang.String sessionTimeZone)Sets thesessionTimeZone.-
Methods inherited from class org.firebirdsql.gds.ng.AbstractAttachProperties
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getPassword, getPortNumber, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setPassword, setPortNumber, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setUser, setWireCompression, setWireCrypt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.firebirdsql.gds.ng.IAttachProperties
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getPassword, getPortNumber, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setPassword, setPortNumber, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setUser, setWireCompression, setWireCrypt
-
-
-
-
Constructor Detail
-
FbConnectionProperties
public FbConnectionProperties(IConnectionProperties src)
Copy constructor for FbConnectionProperties.All properties defined in
IConnectionPropertiesare copied fromsrcto the new instance.- Parameters:
src- Source to copy from
-
FbConnectionProperties
public FbConnectionProperties()
Default constructor for FbConnectionProperties
-
-
Method Detail
-
getDatabaseName
public java.lang.String getDatabaseName()
- Specified by:
getDatabaseNamein interfaceIConnectionProperties- Returns:
- Name or alias of the database
-
setDatabaseName
public void setDatabaseName(java.lang.String databaseName)
- Specified by:
setDatabaseNamein interfaceIConnectionProperties- Parameters:
databaseName- Name or alias of the database
-
getAttachObjectName
public java.lang.String getAttachObjectName()
- Specified by:
getAttachObjectNamein interfaceIAttachProperties<IConnectionProperties>- Returns:
- The name of the object to attach to (either a database or service name).
-
getConnectionDialect
public short getConnectionDialect()
Description copied from interface:IConnectionPropertiesGet the dialect of the client connectionNOTE: Implementer should take care to return
IConnectionProperties.DEFAULT_DIALECTif the value hasn't been set yet.- Specified by:
getConnectionDialectin interfaceIConnectionProperties- Returns:
- SQL dialect of the client.
-
setConnectionDialect
public void setConnectionDialect(short connectionDialect)
Description copied from interface:IConnectionPropertiesSet the dialect of the client connectionNOTE: Implementer should take care to use
IConnectionProperties.DEFAULT_DIALECTif the value hasn't been set yet.- Specified by:
setConnectionDialectin interfaceIConnectionProperties- Parameters:
connectionDialect- SQL dialect of the client.
-
getPageCacheSize
public int getPageCacheSize()
Description copied from interface:IConnectionPropertiesGet the page cache size.A value of
0indicates that the value is not set, and that the server default is used.This option is only relevant for Firebird implementations with per connection cache (eg Classic)
NOTE: Implementer should take care to return
IConnectionProperties.DEFAULT_BUFFERS_NUMBERif the value hasn't been set yet.- Specified by:
getPageCacheSizein interfaceIConnectionProperties- Returns:
- number of cache buffers that should be allocated for this connection, should be specified for ClassicServer instances, SuperServer has a server-wide configuration parameter.
-
setPageCacheSize
public void setPageCacheSize(int pageCacheSize)
Description copied from interface:IConnectionPropertiesSet the page cache size.A value of
0indicates that the value is not set, and that the server default is used.This option is only relevant for Firebird implementations with per connection cache (eg Classic)
NOTE: Implementer should take care to use
IConnectionProperties.DEFAULT_BUFFERS_NUMBERif the value hasn't been set yet.- Specified by:
setPageCacheSizein interfaceIConnectionProperties- Parameters:
pageCacheSize- number of cache buffers that should be allocated for this connection, should be specified for ClassicServer instances, SuperServer has a server-wide configuration parameter.
-
setResultSetDefaultHoldable
public void setResultSetDefaultHoldable(boolean holdable)
Description copied from interface:IConnectionPropertiesSet ifResultSetshould beResultSet.HOLD_CURSORS_OVER_COMMITby default.- Specified by:
setResultSetDefaultHoldablein interfaceIConnectionProperties- Parameters:
holdable-trueResultSets are holdable,false(default) ResultSets areResultSet.CLOSE_CURSORS_AT_COMMIT
-
isResultSetDefaultHoldable
public boolean isResultSetDefaultHoldable()
Description copied from interface:IConnectionPropertiesGet whether ResultSets are holdable by default.- Specified by:
isResultSetDefaultHoldablein interfaceIConnectionProperties- Returns:
trueResultSets by default areResultSet.HOLD_CURSORS_OVER_COMMIT,false(default), ResultSets areResultSet.CLOSE_CURSORS_AT_COMMIT
-
setColumnLabelForName
public void setColumnLabelForName(boolean columnLabelForName)
Description copied from interface:IConnectionPropertiesSet ifResultSetMetaData.getColumnName(int)returns thecolumnLabelinstead of thecolumnName.The default behaviour (with
columnLabelForName=falseis JDBC-compliant. The behavior for valuetrueis to provide compatibility with tools with a wrong expectation.- Specified by:
setColumnLabelForNamein interfaceIConnectionProperties- Parameters:
columnLabelForName-falseJDBC compliant behavior (columnNameis returned),truecompatibility option (columnLabelis returned)
-
isColumnLabelForName
public boolean isColumnLabelForName()
Description copied from interface:IConnectionPropertiesGets the current setting ofcolumnLabelForName- Specified by:
isColumnLabelForNamein interfaceIConnectionProperties- Returns:
falseJDBC compliant behavior (columnNameis returned),truecompatibility option (columnLabelis returned)- See Also:
IConnectionProperties.setColumnLabelForName(boolean)
-
setSessionTimeZone
public void setSessionTimeZone(java.lang.String sessionTimeZone)
Description copied from interface:IConnectionPropertiesSets thesessionTimeZone.- Specified by:
setSessionTimeZonein interfaceIConnectionProperties- Parameters:
sessionTimeZone- Firebird 4+ session time zone name (we strongly suggest to use Java compatible names only), use"server"to use server default time zone (note: conversion will use JVM default time zone)
-
getSessionTimeZone
public java.lang.String getSessionTimeZone()
Description copied from interface:IConnectionPropertiesGet thesessionTimeZone.- Specified by:
getSessionTimeZonein interfaceIConnectionProperties- Returns:
- value for
sessionTimeZone
-
getExtraDatabaseParameters
public DatabaseParameterBuffer getExtraDatabaseParameters()
Description copied from interface:IConnectionPropertiesGets the extra database parameters. This can be used to pass extra database parameters that are not directly supported.An immutable instance of
IConnectionPropertiesmust return a copy.- Specified by:
getExtraDatabaseParametersin interfaceIConnectionProperties- Returns:
- DatabaseParameterBuffer instance.
-
asImmutable
public IConnectionProperties asImmutable()
- Specified by:
asImmutablein interfaceIAttachProperties<IConnectionProperties>- Specified by:
asImmutablein interfaceIConnectionProperties- Returns:
- An immutable version of this instance as an implementation of
IConnectionProperties
-
asNewMutable
public IConnectionProperties asNewMutable()
- Specified by:
asNewMutablein interfaceIAttachProperties<IConnectionProperties>- Specified by:
asNewMutablein interfaceIConnectionProperties- Returns:
- A new, mutable, instance as an implementation of
IConnectionPropertieswith all properties copied.
-
fromDpb
@Deprecated public void fromDpb(DatabaseParameterBuffer dpb) throws java.sql.SQLException
Deprecated.TODO: This method is only intended to simplify migration of the protocol implementation and needs to be removed.Method to populate an FbConnectionProperties from a database parameter buffer.Unsupported or unknown properties are ignored.
- Parameters:
dpb- Database parameter buffer- Throws:
java.sql.SQLException
-
dirtied
protected void dirtied()
Description copied from class:AbstractAttachPropertiesCalled by setters if they have been called.- Specified by:
dirtiedin classAbstractAttachProperties<IConnectionProperties>
-
-