Question
Morgan Stanley
IN
Last activity: 14 Jun 2016 7:09 EDT
How to check the database on which pega is installed
I would like to know the database on which PRPC is installed.
How do i check that.. Any thoughts?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi Avinash,
If you know know database details then you can go to SMA>Node>Advanced>Database Management – displays the list of databases registered with PRPC
Now you can select the corresponding database and click on “Database Details” button to retrieve the Database details as shown below,
Note: If you are looking for the schema names then look into the context.xml file if your server is tomcat and in Data sources configuration if your server is WAS.
Kindly let me know if this is your requirement.
Regards,
Mahesh
-
Praveen John Kumar
Morgan Stanley
IN
Thanks Umamaheshwar.
Do we have the database details set in any of the DASS.. I have to actually retrieve these details using an activity..
How do i read those values? Any idea..
Pegasystems Inc.
US
Hi Avinash,
I believe there won't be any DASS available which will have the DB related details set to retrieve via activity.
Pegasystems Inc.
US
Hi Avinash,
So what information related to database you are looking to retrieve in Activity?
Regards,
Mahesh
Updated: 26 May 2016 4:32 EDT
Pegasystems Inc.
AU
-
Praveen John Kumar Shashikiran Kulkarni
Updated: 29 May 2016 7:00 EDT
Pegasystems Inc.
US
Hi Avinash,
You can use this piece of java code to get database specific details in your activity.
try {
ClassDefinition cd = tools.getDatabase().getClassDef("Rule-Obj-Class");
String dbName = cd.getDatabase();
DatabaseInformation dbInfo = tools.getDatabase().getDBInfo(dbName);
oLog.infoForced(dbInfo.getProductName()); //prints Microsoft SQL Server in my case.
}
catch(Exception e){
e.printStackTrace();
}
DatabaseInformation is a public interface and there are couple of methods in this interface to get additional details.
BR//
Harish
-
Vitor Alcantara de Almeida
Pegasystems Inc.
IN
fyi - knowing the database at runtime using activity via java method.
ClipboardPage primaryPage = tools.getPrimaryPage(); String strClassName = "@baseclass"; String strDBProductName = ""; try { if ( ! tools.getParamValue("ClassName").equals("") ) { strClassName = tools.getParamValue("ClassName"); } else if (primaryPage != null) { strClassName = primaryPage.getClassName(); } strDBProductName = tools.getDatabase().getClassDef(strClassName).getDBProductName(tools); // default to Microsoft SQL Server String DBType = "MSSQL"; if (strDBProductName.startsWith("Oracle")) { DBType = "oracle"; } else if (strDBProductName.startsWith("DB2")) { DBType = "DB2"; } //DB Product Name for 'PostgreSQL' else if (strDBProductName.startsWith("Postgre")) { DBType = "postgres"; } tools.putParamValue("DBType", DBType); } catch (DatabaseException de) { oLog.error("Unable to get database type for class: " + strClassName); }
Morgan Stanley
IN
Can i make use of the OOTB function @(Pega-RulesEngine:DBSchemaUtils).pzIsPostgreSQLDB(tools) to check if the DB is postgres or not..
Pegasystems Inc.
IN
- yes Avinash.
- we can use OOTB @(Pega-RulesEngine:DBSchemaUtils).pzIsPostgreSQLDB(tools) to check if DB is postgres.
- please refer OOTB when rule in Pega-Landing class RULE-OBJ-WHEN PEGA-LANDING PZISPOSTGRES
- we can use OOTB @(Pega-RulesEngine:DBSchemaUtils).pzIsPostgreSQLDB(tools) to check if DB is postgres.
Morgan Stanley
IN
Thanks Phani.
Are you aware of any such functions for Oracle & DB2..
I could only find it for Postgres
Pegasystems Inc.
IN
>>> Are you aware of any such functions for Oracle & DB2..
- I'm not sure if we have any OOTB
>>> I could only find it for Postgres
- this function is recently added in 7.1.10
Morgan Stanley
IN
Just found an OOTB function pzGetDBTypeForClass (Re: Executing Connect SQL specific to a database) which tells us the Database we are running.