public class IRISDataSource extends com.intersystems.jdbc.IRISWrapper implements DataSource
IRISDataSource
object is an implementation of DataSource
interface.
In addition to the apis defined by the interface, this class also includes a number
of InterSystems IRIS specific apis that can be used to set up the DataSource
properties (setters) or get the information about the DataSource
object properties (getters). In order to be able to connect, at least server name
and database name properties must be defined, either by using the corresponding
setters, or by supplying a valid url (same as what would be used when connecting
via Driver
class).
Port number is optional, and defaults to 1972.
Username and Password can be set via the setters, or alternatively, can be
supplied via the getConnection api.
Description and DataSource name are completely optional and are not used by
IRISDataSource
object in order to connect.
Logging can be enabled by setting the LogWritter, and Login Timeout set by calling
the corresponding setter (both are optional).
InterSystems IRIS also provides a way to set the TCP nodelay flag. Toggling this flag can
affect the performance of this application. If not set, it defaults to true.
Event Class is a mechanism specific to InterSystems IRIS JDBC. It is completely optional, and
the vast majority of applications will not need this feature. See setEventClass for
more info on Event Class objects.Constructor and Description |
---|
IRISDataSource() |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection() |
Connection |
getConnection(String usr,
String pwd) |
int |
getConnectionSecurityLevel()
Returns an
int representing current Connection Security Level setting. |
String |
getDatabaseName()
Returns a
String representing the current database (InterSystems IRIS Namespace) name. |
String |
getDataSourceName()
Returns a
String representing the current Data Source name. |
int |
getDefaultTransactionIsolation()
Returns an
int representing current Default Transaction Isolation setting. |
String |
getDescription()
Returns a
String representing the current description. |
String |
getEventClass()
Returns a
String representing an Event Class object. |
String |
getIPv6ServerAddress()
Returns a
String representing the current IPv6 server address. |
String |
getKeyRecoveryPassword()
Returns a
String representing current Key Recovery Password setting. |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
boolean |
getNodelay()
Returns a
boolean representing a current nodelay flag setting. |
Logger |
getParentLogger() |
String |
getPassword()
Returns a
String representing the current password. |
int |
getPortNumber()
Returns an
int representing the current port number. |
String |
getServerName()
Returns a
String representing the current server name. |
String |
getServicePrincipalName()
Returns a
String representing current Service Principal Name setting. |
Boolean |
getSharedMemory()
Gets shared memory connections setting for this
DataSource object. |
String |
getSSLConfigurationName()
Returns a
String representing current SSL Configuration Name setting. |
String |
getURL()
Returns a
String representing a current URL for this DataSource object. |
String |
getUser()
Returns a
String representing the current username. |
void |
setConnectionSecurityLevel(int level)
Sets the Connection Security Level for this
DataSource object. |
void |
setDatabaseName(String databaseName)
Sets Database (InterSystems IRIS Namespace) name for this
DataSource object. |
void |
setDataSourceName(String dataSourceName)
Sets Data Source name for this
DataSource object. |
void |
setDefaultTransactionIsolation(int level)
Sets the default Transaction Isolation Level for this
DataSource object. |
void |
setDescription(String desc)
Sets description for this
DataSource object. |
void |
setEventClass(String eventClassName)
Sets the Event Class for this
DataSource object. |
void |
setIPv6ServerAddress(String address)
Sets the IPv6 server address for this
DataSource object. |
void |
setKeyRecoveryPassword(String password)
Sets the Key Recovery Password for this
DataSource object. |
void |
setLogFile(String logFile)
Unconditionally sets log file name for this
DataSource object. |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
setNodelay(boolean noDelay)
Sets the noDelay flag for this
DataSource object. |
void |
setPassword(String pwd)
Sets the password for this
DataSource object. |
void |
setPortNumber(int portNumber)
Sets the port number for this
DataSource object |
void |
setServerName(String serverName)
Sets the server name for this
DataSource object. |
void |
setServicePrincipalName(String name)
Sets the Service Principal Name for this
DataSource object. |
void |
setSharedMemory(Boolean sharedMemory)
Sets shared memory connections on for this
DataSource object. |
void |
setSSLConfigurationName(String name)
Sets the SSL Configuration Name for this
DataSource object. |
void |
setURL(String u)
Sets the url for this
DataSource object. |
void |
setUser(String username)
Sets the username for this
DataSource object. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isWrapperFor, unwrap
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String usr, String pwd) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter()
getLogWriter
in interface CommonDataSource
public void setLogWriter(PrintWriter out)
setLogWriter
in interface CommonDataSource
public void setLoginTimeout(int seconds)
setLoginTimeout
in interface CommonDataSource
public int getLoginTimeout()
getLoginTimeout
in interface CommonDataSource
public void setDatabaseName(String databaseName)
DataSource
object.databaseName
- database (InterSystems IRIS namespace) namepublic String getDatabaseName()
String
representing the current database (InterSystems IRIS Namespace) name.public void setDataSourceName(String dataSourceName)
DataSource
object.dataSourceName
- DataSource
namepublic String getDataSourceName()
String
representing the current Data Source name.DataSource
namepublic void setDescription(String desc)
DataSource
object.desc
- DataSource
descriptionpublic String getDescription()
String
representing the current description.public void setPassword(String pwd)
DataSource
object.pwd
- passwordpublic String getPassword()
String
representing the current password.public void setPortNumber(int portNumber)
DataSource
objectportNumber
- port numberpublic int getPortNumber()
int
representing the current port number.public void setServerName(String serverName)
DataSource
object.
To be used with IPv4 address, or an actual server name. For IPv6
address, use setIPv6ServerAddress apiserverName
- server name or an IPv4 server addresspublic String getServerName()
String
representing the current server name.public void setSharedMemory(Boolean sharedMemory)
DataSource
object.sharedMemory
- true to turn on shared memorypublic Boolean getSharedMemory()
DataSource
object.public void setIPv6ServerAddress(String address)
DataSource
object.
To be used with IPv6 address only. For specifying and IPv4ddress
address or an actual host name, use setServerName apiaddress
- addresspublic String getIPv6ServerAddress()
String
representing the current IPv6 server address.public void setUser(String username)
DataSource
object.username
- usernamepublic String getUser()
String
representing the current username.public void setEventClass(String eventClassName)
DataSource
object.
InterSystems IRIS JDBC server will dispatch to methods implemented in a class when
a transaction is about to be committed and when a transaction is about
to be rolled back. The class in which these methods are implemented is
referred to as the 'event class'. If an event class is specified during
login then the JDBC server will dispatch to %OnTranCommit just prior to
committing the current transaction and will dispatch to %OnTranRollback
just prior to rolling back (aborting) the current transaction. User
event classes should extend %ServerEvent. The methods do not return any
values and cannot abort the current transaction.eventClassName
- event class namepublic String getEventClass()
String
representing an Event Class object.public void setURL(String u) throws SQLException
DataSource
object.u
- urlSQLException
- throws SQLExceptionpublic String getURL()
String
representing a current URL for this DataSource
object.public void setNodelay(boolean noDelay)
DataSource
object.noDelay
- nodelay flagpublic boolean getNodelay()
boolean
representing a current nodelay flag setting.public void setServicePrincipalName(String name)
DataSource
object.name
- principal namepublic String getServicePrincipalName()
String
representing current Service Principal Name setting.public void setConnectionSecurityLevel(int level)
DataSource
object.level
- security levelpublic int getConnectionSecurityLevel()
int
representing current Connection Security Level setting.public void setSSLConfigurationName(String name)
DataSource
object.name
- SSL configuration namepublic String getSSLConfigurationName()
String
representing current SSL Configuration Name setting.public void setKeyRecoveryPassword(String password)
DataSource
object.password
- key recovery passwordpublic String getKeyRecoveryPassword()
String
representing current Key Recovery Password setting.public void setLogFile(String logFile) throws SQLException
DataSource
object.logFile
- log file nameSQLException
- throws SQLExceptionpublic int getDefaultTransactionIsolation()
int
representing current Default Transaction Isolation setting.public void setDefaultTransactionIsolation(int level)
DataSource
object.
Defaults to java.sql.Connection.TRANSACTION_READ_UNCOMMITTEDlevel
- default transaction isolation levelpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
© 2024 InterSystems Corporation, Cambridge, MA. All rights reserved. Privacy & Terms Guarantee Accessibility