public class CSDatabaseConnectionPool
extends java.lang.Object
CSDatabaseItem
derived classes use this class to implement connection pooling if the
DBConnectionPooling
property is set to true
/yes
within the database
property file.
This class also provides methods for creating/closing statements on a database connection. All
CSDatabaseItem
derived classes use these methods to help ensure that all statements are closed,
especially in the event of an exception being thrown. IMPORTANT - Although this wrapper class is capable of handling
connections to different types of datasource, the underlying third party connection broker class DOES NOT! It loses
all knowledge of the previous datasource when the new one is connected to!!!
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decrypt(java.lang.String value)
Checks the given value for the prefix
ENCRYPTED_PREFIX , if present this is removed
and the remainder is Base64 decoded before being decrypted using ENCRYPTION_ALGORITHM
and KEY_VALUE . |
static java.lang.String |
encrypt(java.lang.String value)
Encrypts the given value using
ENCRYPTION_ALGORITHM and KEY_VALUE . |
static void |
main(java.lang.String[] args)
Encrypts or decrypts the DBPassword in the given datasource.properties file.
|
public static java.lang.String encrypt(java.lang.String value) throws java.lang.Exception
ENCRYPTION_ALGORITHM
and KEY_VALUE
.
The result of the encryption is then Base64
encoded, the result of which is then
appended to ENCRYPTED_PREFIX
.value
- the value to encryptjava.lang.Exception
- if an error occurs during encryptionpublic static java.lang.String decrypt(java.lang.String value) throws java.io.IOException
ENCRYPTED_PREFIX
, if present this is removed
and the remainder is Base64
decoded before being decrypted using ENCRYPTION_ALGORITHM
and KEY_VALUE
. If the prefix is not present the value is returned as is.value
- Valuejava.io.IOException
- IOExceptionpublic static void main(java.lang.String[] args)
args
- the arguments that are passed to this methodCopyright © 2022 Goss Interactive Ltd. All Rights Reserved.