Is it anyway to get the database user and password from "datasource & profile"

Confluence User - 10 Sep, 2016

Dear Expert,

I did not want to hard code the database user and password at the "Bean shell Form builder" when accessing the joget database. So anyway for us to get the information from the Joget configuration / datasource profile ?

Best Regards

Tony Chu

beanshell;forms;datasource

1


12 Sep, 2016
confluenceUser
1
confluenceUser

Hi,

From an example in Store Form Field Data to Multiple Tables, you can retrieve the default datasource connection directly using the following

// retrieve connection from the default datasource
DataSource ds = (DataSource)AppUtil.getApplicationContext().getBean("setupDataSource");
Connection con = ds.getConnection();
RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print