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 IConnectionProperties
asImmutable()
IConnectionProperties
asNewMutable()
protected void
dirtied()
Called by setters if they have been called.void
fromDpb(DatabaseParameterBuffer dpb)
Deprecated.TODO: This method is only intended to simplify migration of the protocol implementation and needs to be removed.java.lang.String
getAttachObjectName()
short
getConnectionDialect()
Get the dialect of the client connectionjava.lang.String
getDatabaseName()
DatabaseParameterBuffer
getExtraDatabaseParameters()
Gets the extra database parameters.int
getPageCacheSize()
Get the page cache size.java.lang.String
getSessionTimeZone()
Get thesessionTimeZone
.boolean
isColumnLabelForName()
Gets the current setting ofcolumnLabelForName
boolean
isResultSetDefaultHoldable()
Get whether ResultSets are holdable by default.void
setColumnLabelForName(boolean columnLabelForName)
Set ifResultSetMetaData.getColumnName(int)
returns thecolumnLabel
instead of thecolumnName
.void
setConnectionDialect(short connectionDialect)
Set the dialect of the client connectionvoid
setDatabaseName(java.lang.String databaseName)
void
setPageCacheSize(int pageCacheSize)
Set the page cache size.void
setResultSetDefaultHoldable(boolean holdable)
Set ifResultSet
should beResultSet.HOLD_CURSORS_OVER_COMMIT
by default.void
setSessionTimeZone(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
IConnectionProperties
are copied fromsrc
to 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:
getDatabaseName
in interfaceIConnectionProperties
- Returns:
- Name or alias of the database
-
setDatabaseName
public void setDatabaseName(java.lang.String databaseName)
- Specified by:
setDatabaseName
in interfaceIConnectionProperties
- Parameters:
databaseName
- Name or alias of the database
-
getAttachObjectName
public java.lang.String getAttachObjectName()
- Specified by:
getAttachObjectName
in 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:IConnectionProperties
Get the dialect of the client connectionNOTE: Implementer should take care to return
IConnectionProperties.DEFAULT_DIALECT
if the value hasn't been set yet.- Specified by:
getConnectionDialect
in interfaceIConnectionProperties
- Returns:
- SQL dialect of the client.
-
setConnectionDialect
public void setConnectionDialect(short connectionDialect)
Description copied from interface:IConnectionProperties
Set the dialect of the client connectionNOTE: Implementer should take care to use
IConnectionProperties.DEFAULT_DIALECT
if the value hasn't been set yet.- Specified by:
setConnectionDialect
in interfaceIConnectionProperties
- Parameters:
connectionDialect
- SQL dialect of the client.
-
getPageCacheSize
public int getPageCacheSize()
Description copied from interface:IConnectionProperties
Get the page cache size.A value of
0
indicates 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_NUMBER
if the value hasn't been set yet.- Specified by:
getPageCacheSize
in 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:IConnectionProperties
Set the page cache size.A value of
0
indicates 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_NUMBER
if the value hasn't been set yet.- Specified by:
setPageCacheSize
in 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:IConnectionProperties
Set ifResultSet
should beResultSet.HOLD_CURSORS_OVER_COMMIT
by default.- Specified by:
setResultSetDefaultHoldable
in interfaceIConnectionProperties
- Parameters:
holdable
-true
ResultSets are holdable,false
(default) ResultSets areResultSet.CLOSE_CURSORS_AT_COMMIT
-
isResultSetDefaultHoldable
public boolean isResultSetDefaultHoldable()
Description copied from interface:IConnectionProperties
Get whether ResultSets are holdable by default.- Specified by:
isResultSetDefaultHoldable
in interfaceIConnectionProperties
- Returns:
true
ResultSets 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:IConnectionProperties
Set ifResultSetMetaData.getColumnName(int)
returns thecolumnLabel
instead of thecolumnName
.The default behaviour (with
columnLabelForName=false
is JDBC-compliant. The behavior for valuetrue
is to provide compatibility with tools with a wrong expectation.- Specified by:
setColumnLabelForName
in interfaceIConnectionProperties
- Parameters:
columnLabelForName
-false
JDBC compliant behavior (columnName
is returned),true
compatibility option (columnLabel
is returned)
-
isColumnLabelForName
public boolean isColumnLabelForName()
Description copied from interface:IConnectionProperties
Gets the current setting ofcolumnLabelForName
- Specified by:
isColumnLabelForName
in interfaceIConnectionProperties
- Returns:
false
JDBC compliant behavior (columnName
is returned),true
compatibility option (columnLabel
is returned)- See Also:
IConnectionProperties.setColumnLabelForName(boolean)
-
setSessionTimeZone
public void setSessionTimeZone(java.lang.String sessionTimeZone)
Description copied from interface:IConnectionProperties
Sets thesessionTimeZone
.- Specified by:
setSessionTimeZone
in 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:IConnectionProperties
Get thesessionTimeZone
.- Specified by:
getSessionTimeZone
in interfaceIConnectionProperties
- Returns:
- value for
sessionTimeZone
-
getExtraDatabaseParameters
public DatabaseParameterBuffer getExtraDatabaseParameters()
Description copied from interface:IConnectionProperties
Gets the extra database parameters. This can be used to pass extra database parameters that are not directly supported.An immutable instance of
IConnectionProperties
must return a copy.- Specified by:
getExtraDatabaseParameters
in interfaceIConnectionProperties
- Returns:
- DatabaseParameterBuffer instance.
-
asImmutable
public IConnectionProperties asImmutable()
- Specified by:
asImmutable
in interfaceIAttachProperties<IConnectionProperties>
- Specified by:
asImmutable
in interfaceIConnectionProperties
- Returns:
- An immutable version of this instance as an implementation of
IConnectionProperties
-
asNewMutable
public IConnectionProperties asNewMutable()
- Specified by:
asNewMutable
in interfaceIAttachProperties<IConnectionProperties>
- Specified by:
asNewMutable
in interfaceIConnectionProperties
- Returns:
- A new, mutable, instance as an implementation of
IConnectionProperties
with 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:AbstractAttachProperties
Called by setters if they have been called.- Specified by:
dirtied
in classAbstractAttachProperties<IConnectionProperties>
-
-