|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.node.port.database.DatabaseConnectionSettings
public class DatabaseConnectionSettings
| Field Summary | |
|---|---|
static String |
CFG_STATEMENT
Config for SQL statement. |
static StringHistory |
DATABASE_URLS
Keeps the history of all database URLs. |
static StringHistory |
DRIVER_ORDER
Keeps the history of all loaded driver and its order. |
static Integer |
FETCH_SIZE
DriverManager fetch size to chunk specified number of rows. |
| Constructor Summary | |
|---|---|
DatabaseConnectionSettings()
Create a default settings connection object. |
|
DatabaseConnectionSettings(DatabaseConnectionSettings conn)
Creates a new DBConnection based on the given connection
object. |
|
DatabaseConnectionSettings(String driver,
String dbName,
String user,
String pass,
String credName)
Create a default database connection object. |
|
| Method Summary | |
|---|---|
Connection |
createConnection()
Deprecated. use createConnection(CredentialsProvider) |
Connection |
createConnection(CredentialsProvider cp)
Create a database connection based on this settings. |
ModelContentRO |
createConnectionModel()
Create connection model with all settings used to create a database connection. |
void |
execute(String statement,
CredentialsProvider cp)
Execute statement on current database connection. |
String |
getDBName()
|
String |
getDriver()
|
String |
getPassword()
Deprecated. use getPassword(CredentialsProvider) |
String |
getPassword(CredentialsProvider cp)
|
String |
getUserName()
Deprecated. use getUserName(CredentialsProvider) |
String |
getUserName(CredentialsProvider cp)
|
boolean |
loadValidatedConnection(ConfigRO settings,
CredentialsProvider cp)
Load validated settings. |
void |
saveConnection(ConfigWO settings)
Save settings. |
void |
setDBName(String databaseName)
Deprecated. use DatabaseConnectionSettings(String, String, String, String, String) |
void |
setDriver(String driver)
Deprecated. use DatabaseConnectionSettings(String, String, String, String, String) |
void |
setPassword(String password)
Deprecated. use DatabaseConnectionSettings(String, String, String, String, String) |
void |
setUserName(String userName)
Deprecated. use DatabaseConnectionSettings(String, String, String, String, String) |
(package private) Object |
syncConnection(Connection connection)
Used to sync access to mySQL databases. |
void |
validateConnection(ConfigRO settings,
CredentialsProvider cp)
Validate settings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CFG_STATEMENT
public static final StringHistory DRIVER_ORDER
public static final StringHistory DATABASE_URLS
public static final Integer FETCH_SIZE
| Constructor Detail |
|---|
public DatabaseConnectionSettings()
public DatabaseConnectionSettings(String driver,
String dbName,
String user,
String pass,
String credName)
driver - the database driverdbName - database URLuser - user namepass - password for user namecredName - credential id from CredentialsProvider or nullpublic DatabaseConnectionSettings(DatabaseConnectionSettings conn)
DBConnection based on the given connection
object.
conn - connection used to copy settings from
NullPointerException - if the connection is null| Method Detail |
|---|
@Deprecated
public Connection createConnection()
throws InvalidSettingsException,
SQLException,
BadPaddingException,
IllegalBlockSizeException,
InvalidKeyException,
IOException
createConnection(CredentialsProvider)
SQLException - SQLException
InvalidSettingsException - InvalidSettingsException
IllegalBlockSizeException - IllegalBlockSizeException
BadPaddingException - BadPaddingException
InvalidKeyException - InvalidKeyException
IOException - IOException
public Connection createConnection(CredentialsProvider cp)
throws InvalidSettingsException,
SQLException,
BadPaddingException,
IllegalBlockSizeException,
InvalidKeyException,
IOException
cp - CredentialsProvider provides user/password pairs
SQLException - SQLException
InvalidSettingsException - InvalidSettingsException
IllegalBlockSizeException - IllegalBlockSizeException
BadPaddingException - BadPaddingException
InvalidKeyException - InvalidKeyException
IOException - IOExceptionfinal Object syncConnection(Connection connection)
connection - (not null) used to sync mySQL database access
NullPointerException - if the given connection is nullpublic void saveConnection(ConfigWO settings)
settings - connection settings
public void validateConnection(ConfigRO settings,
CredentialsProvider cp)
throws InvalidSettingsException
settings - to validatecp - CredentialProvider used to get user name/password
InvalidSettingsException - if the settings are not valid
public boolean loadValidatedConnection(ConfigRO settings,
CredentialsProvider cp)
throws InvalidSettingsException
settings - to loadcp - CredentialProvider used to get user name/password
InvalidSettingsException - if settings are invalid
public void execute(String statement,
CredentialsProvider cp)
throws InvalidKeyException,
BadPaddingException,
IllegalBlockSizeException,
InvalidSettingsException,
SQLException,
IOException
statement - to be executedcp - CredentialsProvider providing user/password
SQLException - SQLException
InvalidSettingsException - InvalidSettingsException
IllegalBlockSizeException - IllegalBlockSizeException
BadPaddingException - BadPaddingException
InvalidKeyException - InvalidKeyException
IOException - IOExceptionpublic ModelContentRO createConnectionModel()
public final String getDriver()
public final String getDBName()
public final String getUserName(CredentialsProvider cp)
cp - CredentialsProvider
public final String getPassword(CredentialsProvider cp)
cp - CredentialsProvider
@Deprecated public final String getUserName()
getUserName(CredentialsProvider)
@Deprecated public final String getPassword()
getPassword(CredentialsProvider)
@Deprecated public final void setDriver(String driver)
DatabaseConnectionSettings(String, String, String, String, String)
driver - used to open the connection@Deprecated public final void setDBName(String databaseName)
DatabaseConnectionSettings(String, String, String, String, String)
databaseName - used to access the database URL@Deprecated public final void setUserName(String userName)
DatabaseConnectionSettings(String, String, String, String, String)
userName - used to login to the database@Deprecated public final void setPassword(String password)
DatabaseConnectionSettings(String, String, String, String, String)
password - (decrypted) used to login to the database
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||