Reputation: 45
I"m trying to find database connection configuration files inside JasperReports Server. If you can tell me where JR Server stores database configuration files then it will be great help
Upvotes: 1
Views: 6279
Reputation: 22857
You can find JasperReports Server (JRS) internal DB configuration at <tomcat>\webapps\jasperserver\META-INF\context.xml file.
The sample of this configuration file (of my local JRS deployed on Tomcat):
<Context path="/jasperserver" reloadable="false">
<Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
username="jasperdb" password="password" driverClassName="org.postgresql.Driver" accessToUnderlyingConnectionAllowed="true"
validationQuery="SELECT 1" testOnBorrow="true"
url="jdbc:postgresql://127.0.0.1:5432/jasperserver?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true&amp;autoReconnectForPools=true"
factory="com.jaspersoft.jasperserver.tomcat.jndi.JSCommonsBasicDataSourceFactory"/>
<Manager pathname=""/>
</Context>
As you can see the username and password stored as just an unencrypted text: username="jasperdb" password="password"
.
And the db connection string is storing like this: url="jdbc:postgresql://127.0.0.1:5432/jasperserver
I used this credentials for DB connect with pgAdmin (my local JRS is using Postgres):
The table jijdbcdatasource contains information about jdbc based datasources.
For example, I created the new datasource like this:
The all parameters were placed at new row of jijdbcdatasource table:
Upvotes: 3