public abstract class IlvDBConnectionInfo extends Object implements IlvPersistentObject
IlvDBConnectionInfo info = new IlvDB2ConnectionInfo(); info.setUser("db2admin"); info.setPassword("password"); info.setDatabaseName("sample"); connection = info.connect();
Constructor and Description |
---|
IlvDBConnectionInfo()
Creates a new
IlvDBConnectionInfo . |
IlvDBConnectionInfo(IlvInputStream stream)
Reads an object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
Connection |
connect()
Establish a database connection with all the parameters that have already been set
|
void |
disconnect()
Disconnect from the database if currently connected, committing outstanding work.
|
Connection |
getConnection()
Get a database connection with the currently set parameters.
|
String |
getDatabaseName()
Get the database name
|
abstract String |
getDriverClassName()
Get the JDBC driver class name
|
String |
getHostName()
Get the name of the database host system
|
String |
getHostPort()
Get the string representation of the tcp/ip port number for the database server.
|
String |
getNodeNumber()
The node number to which you wish to connect in DB2 Partitioned Database environment.
|
protected String |
getPassword()
Get the connection password.
|
String |
getServer()
Get the name of the database server (INFORMIX only).
|
abstract ilog.views.maps.datasource.ibm.internal.DBAbstractSpatialCatalog |
getSpatialCatalog()
Get a spatial catalog object which can be used to obtain the names of spatial tables.
|
String[] |
getSpatiallyEnabledTableNames()
Get the names of spatial tables.
|
abstract String |
getUrlFull()
Get the full URL for the database server.
|
String |
getUser()
Get the connection user ID.
|
protected boolean |
isLUWDB()
Checks if current database connection is for DB2 LUW
|
boolean |
isReady()
Indicates whether the connection is ready.
|
boolean |
isSavingPassword()
Indicates if the password is saved in an
.ivl file. |
void |
setDatabaseName(String dbName)
Set the database name for the connection.
|
void |
setHostName(String hostName)
Set the host name for the connection.
|
void |
setHostPort(String hostPort)
Set the connection port number as a string.
|
void |
setNodeNumber(String nodeNumber)
In DB2 Partitioned Database environment, set this to the node number to which you wish to connect.
|
void |
setPassword(String password)
Set the database connection password.
|
protected abstract Properties |
setProperties()
Sets up the properties for use in
DriverManager.getConnection(String, Properties) . |
void |
setSavingPassword(boolean savePassword)
Specifies whether the password should be saved in an
.ivl file. |
void |
setServer(String server)
Set the database server name (INFORMIX only).
|
void |
setUser(String userid)
Set the database connection user ID.
|
void |
write(IlvOutputStream stream)
Writes the attributes of a persistent object.
|
public IlvDBConnectionInfo()
IlvDBConnectionInfo
.public IlvDBConnectionInfo(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The stream to read from.IlvReadFileException
- if there is a problem reading from
stream
.public boolean isReady()
public Connection connect() throws SQLException, IllegalArgumentException
SQLException
- when the connection cannot be made.IllegalArgumentException
- when some parameters are missing.public void disconnect() throws SQLException
SQLException
public Connection getConnection() throws SQLException
connect()
to it.SQLException
- when the connection cannot be made.public String getDatabaseName()
public abstract String getDriverClassName()
public String getHostName()
public String getHostPort()
protected String getPassword()
public String getServer()
public abstract String getUrlFull()
public String getUser()
protected boolean isLUWDB()
public void setDatabaseName(String dbName)
dbName
- The database name.public void setHostName(String hostName)
hostName
- the host name.public void setHostPort(String hostPort)
hostPort
- the port.public void setPassword(String password)
password
- the password.public void setServer(String server)
server
- the server name.public void setUser(String userid)
userid
- the user ID.public String getNodeNumber()
public void setNodeNumber(String nodeNumber)
nodeNumber
- the DB2 node number.protected abstract Properties setProperties()
DriverManager.getConnection(String, Properties)
.public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.public boolean isSavingPassword()
.ivl
file.true
if the password is saved in an .ivl
file.public void setSavingPassword(boolean savePassword)
.ivl
file.
By default, the password is saved.savePassword
- If set to true
, the password
will be saved with the connection.
Otherwise, it is not saved in an .ivl
file and the
internal value for the password is set to null
.public abstract ilog.views.maps.datasource.ibm.internal.DBAbstractSpatialCatalog getSpatialCatalog() throws SQLException
SQLException
public String[] getSpatiallyEnabledTableNames() throws SQLException
SQLException
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.