|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lapetus_ltd._2009.xml.types.XLptsDBConnectionType
com.lapetus_ltd.api.db.xml.types.TLptsDBConnectionType
public class TLptsDBConnectionType
Class Description : The wrapper class for XLptsDBConnectionType.
Field Summary |
---|
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBConnectionType |
---|
charset, connectionString, credentials, dataFileUrl, driverType, holdabilityCode, holdabilityString, id, properties, timestamp, title, version |
Constructor Summary | |
---|---|
TLptsDBConnectionType()
This constructor initiates DBConnectionType. |
|
TLptsDBConnectionType(XLptsDBConnectionType connectionType)
This constructor copies the connection type information from an XLptsDBConnectionType. |
Method Summary |
---|
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBConnectionType |
---|
getCharset, getConnectionString, getCredentials, getDataFileUrl, getDriverType, getHoldabilityCode, getHoldabilityString, getId, getProperties, getTimestamp, getTitle, getVersion, setCharset, setConnectionString, setCredentials, setDataFileUrl, setDriverType, setHoldabilityCode, setHoldabilityString, setId, setProperties, setTimestamp, setTitle, setVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TLptsDBConnectionType()
This constructor initiates DBConnectionType.
Thread Safe : Yes Spawns its own Thread : No May Return NULL : Never. Notes : Default Constructor initiates DBConnectionType.... TLptsDBConnectionType connectionType; //Connect To PostgreSQL: Title of Connection, Class Name of Driver, The Name of the DB you want to connect, username and password for the db connectionType = connectToDB("POSTGRESQL BANK-DB","org.postgresql.ds.PGSimpleDataSource","bank","postgres","test"); if (connectionType!=null) { connectionPostgresId = connectionType.getId(); TLptsFactoryConnection.initiateConnection(connectionType); // This generates another thread!! } ... private TLptsDBConnectionType connectToDB(String title, String driverClassName, String dbName, String username, String password) { TLptsDBConnectionType connectionType = new TLptsDBConnectionType(); connectionType.setTitle(title); XLptsDriverType driverType = TLptsDriverLoader.getDriverTypeByClassName(driverClassName); if (driverType==null) { System.out.println("Could not find driver for class : " + driverClassName); return null; } TLptsDriverType dt = new TLptsDriverType(driverType); // changing values that are default in the driver.loader.xml file. // the DB is now set correctly and will filter through to the Datasource interface execution if(dbName!=null) dt.setValueForInterfaceFunctionParameter("setDatabaseName","Database Name",dbName); connectionType.setDriverType(dt); if(username==null || password==null) connectionType.setCredentials(TLptsCryptoUtil.defaultEncryptCredentialsRSA(driverType.getGuestUser(),driverType.getGuestPassword())); else connectionType.setCredentials(TLptsCryptoUtil.defaultEncryptCredentialsRSA(username,password)); return connectionType; }
public TLptsDBConnectionType(XLptsDBConnectionType connectionType)
This constructor copies the connection type information from an XLptsDBConnectionType.
Thread Safe : Yes Spawns its own Thread : No May Return NULL : Never. Notes : Use this function every time you need to copy or instantiate a type XLptsDBConnectionType class.... TLptsDBConnectionType connectionType; //Connect To PostgreSQL: Title of Connection, Class Name of Driver, The Name of the DB you want to connect, username and password for the db connectionType = connectToDB("POSTGRESQL BANK-DB","org.postgresql.ds.PGSimpleDataSource","bank","postgres","test"); if (connectionType!=null) { connectionPostgresId = connectionType.getId(); TLptsFactoryConnection.initiateConnection(connectionType); // This generates another thread!! } ... private TLptsDBConnectionType connectToDB(String title, String driverClassName, String dbName, String username, String password) { TLptsDBConnectionType connectionType = new TLptsDBConnectionType(); connectionType.setTitle(title); XLptsDriverType driverType = TLptsDriverLoader.getDriverTypeByClassName(driverClassName); if (driverType==null) { System.out.println("Could not find driver for class : " + driverClassName); return null; } TLptsDriverType dt = new TLptsDriverType(driverType); // changing values that are default in the driver.loader.xml file. // the DB is now set correctly and will filter through to the Datasource interface execution if(dbName!=null) dt.setValueForInterfaceFunctionParameter("setDatabaseName","Database Name",dbName); connectionType.setDriverType(dt); if(username==null || password==null) connectionType.setCredentials(TLptsCryptoUtil.defaultEncryptCredentialsRSA(driverType.getGuestUser(),driverType.getGuestPassword())); else connectionType.setCredentials(TLptsCryptoUtil.defaultEncryptCredentialsRSA(username,password)); return connectionType; }
connectionType
- the class object to copy.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |