public class IRISDataSource extends com.intersystems.jdbc.ConnectionParameters implements DataSource
IRISDataSource is an implementation of the java.sql.DataSource interface.
IRISDataSource also includes a number of InterSystems IRIS specific extensions that
can be used to set up the DataSource.
By default, IRISDataSource will attempt to connect to "127.0.0.1:1972/USER".
Username and Password can be set via the setters, or alternatively, can be
supplied via the getConnection(String usr, String pwd).
| Modifier and Type | Field and Description |
|---|---|
protected com.intersystems.jdbc.LogFileStream |
logFile |
| Constructor and Description |
|---|
IRISDataSource() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessToken()
Returns a
String representing the current AccessToken. |
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 Level. |
String |
getDescription()
Returns a
String representing the current description. |
String |
getEventClass()
Returns a
String representing the Event Class object. |
String |
getKeyRecoveryPassword()
Returns a
String representing current Key Recovery Password. |
com.intersystems.jdbc.LogFileStream |
getLogFile()
Returns a
LogFileStream as the current log file instance. |
String |
getLogFileName()
Returns a
String representing the current log file path. |
int |
getLoginTimeout()
Gets the time, in seconds, that the driver will wait for to obtain
a connection before throwing a SQLException.
|
PrintWriter |
getLogWriter()
Returns a
PrintWriter as the current log file instance. |
boolean |
getNodelay()
Returns a
boolean representing the current TCP_NODELAY flag setting. |
Logger |
getParentLogger() |
String |
getPassword()
Returns a
String representing the current password. |
int |
getPortNumber()
Returns an
int representing the current port number. |
int |
getPreparseCacheSize()
Returns an
int representing the Preparsed Cache size. |
String |
getServerName()
Returns a
String representing the current host. |
String |
getServicePrincipalName()
Returns a
String representing current Service Principal Name. |
Boolean |
getSharedMemory()
Returns an
boolean representing whether or not shared memory connections
are enabled for this DataSource object. |
String |
getSSLConfigurationName()
Returns a
String representing current SSL Configuration Name. |
int |
getStreamPrefetchSize()
Returns an
int representing the Stream Prefetch size. |
String |
getURL()
Returns a
String representing a current URL for this DataSource object. |
String |
getUser()
Returns a
String representing the current username. |
void |
setAccessToken(String token)
Sets the AccessToken for this
DataSource object. |
void |
setCommitTimeout(int timeout)
Sets the commitTimeout for this
DataSource object. |
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 tthe 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 the description for this
DataSource object. |
void |
setEventClass(String eventClassName)
Sets the Event Class for this
DataSource object. |
void |
setKeyRecoveryPassword(String password)
Sets the Key Recovery Password for this
DataSource object. |
void |
setLogFile(com.intersystems.jdbc.LogFileStream lf)
Sets a
LogFileStream as the current log file. |
void |
setLogFile(String fileName)
Sets an
String representing the current log file path. |
protected void |
setLogFileNoThrow(String fileName) |
void |
setLoginTimeout(int seconds)
Sets the maximum time, in seconds, that the driver will wait for to
obtain a connection before throwing a SQLException.
|
void |
setLogWriter(PrintWriter pw)
Sets a
PrintWriter as the current log file. |
void |
setNetworkTimeout(int timeout)
Sets the networkTimeout for this
DataSource object. |
void |
setNodelay(boolean noDelay)
Sets the TCP_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 |
setPreparseCacheSize(int size)
Sets the Preparsed Cache size 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 |
setSSLConfigurationName(String name)
Sets the SSL Configuration Name for this
DataSource object. |
void |
setStreamPrefetchSize(int size)
Sets the StreamPrefetch size for this
DataSource object. |
void |
setURL(String u)
Sets the url for this
DataSource object. |
void |
setUser(String user)
Sets the username for this
DataSource object. |
addToPool, clone, copy, getFeatureOption, getHash, getSQLDialect, getTransactionIsolationLevel, isPooled, setFeatureOption, setFeatureOption, setSharedMemory, setSQLDialect, setTransactionIsolationLevel, updateConParamsequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogWriter, setLogWriterisWrapperFor, unwrappublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String usr, String pwd) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic void setUser(String user)
DataSource object.user - usernamepublic void setPassword(String pwd)
DataSource object.pwd - passwordpublic void setAccessToken(String token) throws SQLException
DataSource object.token - accesstokenSQLExceptionpublic void setServerName(String serverName)
DataSource object.setServerName in class com.intersystems.jdbc.ConnectionParametersserverName - Host name of the serverpublic void setPortNumber(int portNumber)
DataSource object.setPortNumber in class com.intersystems.jdbc.ConnectionParametersportNumber - port address on hostpublic void setDatabaseName(String databaseName)
DataSource object.setDatabaseName in class com.intersystems.jdbc.ConnectionParametersdatabaseName - namespacepublic void setEventClass(String eventClassName)
Sets the Event Class for this DataSource object.
Event Classes are an optional mechanism specific to InterSystems IRIS JDBC.
Event Classes are Objectscript classes that extend %Library.ServerEvent
and implements the %OnTranCommit and %OnTranRollback
methods. When an event class is specified, the InterSystems IRIS JDBC will dispatch
to the %OnTranCommit and %OnTranRollback just prior
to committing or rolling back the current transaction. Neither method can abort the
current transaction nor return any values.
The vast majority of applications will not need this feature.
eventClassName - - The Event Class Name, e.g. "User.CustomServerEvent"public void setNetworkTimeout(int timeout)
DataSource object.timeout - networkTimeout in millisecondspublic void setCommitTimeout(int timeout)
DataSource object.timeout - commitTimeout in millisecondspublic void setNodelay(boolean noDelay)
DataSource object.noDelay - tcp nodelay valuepublic void setConnectionSecurityLevel(int level)
throws SQLException
DataSource object.setConnectionSecurityLevel in class com.intersystems.jdbc.ConnectionParameterslevel - connection's security level (0) default, (10) sslSQLExceptionpublic int getLoginTimeout()
Gets the time, in seconds, that the driver will wait for to obtain a connection before throwing a SQLException.
The default login timeout corresponds with java.sql.DriverManager.getLoginTimeout().
getLoginTimeout in interface CommonDataSourcepublic void setLoginTimeout(int seconds)
setLoginTimeout in interface CommonDataSourceseconds - login max wait timepublic String getDataSourceName()
String representing the current Data Source Name.public void setDataSourceName(String dataSourceName)
DataSource object.dataSourceName - Name alias for DataSourcepublic String getDescription()
String representing the current description.public void setDescription(String desc)
DataSource object.desc - Text to describe DataSourcepublic String getServicePrincipalName()
String representing current Service Principal Name.public void setServicePrincipalName(String name)
DataSource object.name - Kerberos service principal namepublic String getSSLConfigurationName()
String representing current SSL Configuration Name.public void setSSLConfigurationName(String name)
DataSource object.name - SSL configuration namepublic String getKeyRecoveryPassword()
String representing current Key Recovery Password.public void setKeyRecoveryPassword(String password)
DataSource object.password - SSL keyRecovery passwordpublic int getDefaultTransactionIsolation()
int representing current Default Transaction Isolation Level.public void setDefaultTransactionIsolation(int level)
throws SQLException
DataSource object.level - Transaction Isolation LevelSQLException - - Invalid transaction isolation levelpublic int getPreparseCacheSize()
int representing the Preparsed Cache size.public void setPreparseCacheSize(int size)
DataSource object.size - Max size allowed for preParsed cache of statementspublic int getStreamPrefetchSize()
int representing the Stream Prefetch size.public void setStreamPrefetchSize(int size)
DataSource object.size - Values smaller than this will return the stream data in the original fetchpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic String getURL()
String representing a current URL for this DataSource object.public void setURL(String u) throws SQLException
DataSource object.u - urlSQLException - throws SQLExceptionpublic String getUser()
String representing the current username.public String getPassword()
String representing the current password.public String getAccessToken()
String representing the current AccessToken.public String getServerName()
String representing the current host.public int getPortNumber()
int representing the current port number.public String getDatabaseName()
String representing the current database (InterSystems IRIS Namespace) name.public String getEventClass()
String representing the Event Class object.public boolean getNodelay()
boolean representing the current TCP_NODELAY flag setting.public int getConnectionSecurityLevel()
int representing current Connection Security Level setting.public Boolean getSharedMemory()
boolean representing whether or not shared memory connections
are enabled for this DataSource object.public com.intersystems.jdbc.LogFileStream getLogFile()
LogFileStream as the current log file instance.public void setLogFile(String fileName) throws SQLException
String representing the current log file path.fileName - path and filename of log file to useSQLException - - Invalid log file nameprotected void setLogFileNoThrow(String fileName)
public void setLogFile(com.intersystems.jdbc.LogFileStream lf)
LogFileStream as the current log file.lf - instance of a logfileStream to usepublic PrintWriter getLogWriter()
PrintWriter as the current log file instance.public void setLogWriter(PrintWriter pw)
PrintWriter as the current log file.pw - sets logfile to use this PrintWriterpublic String getLogFileName()
String representing the current log file path.Copyright © 2000-2025 InterSystems Corporation. All rights reserved.