Ethan
Ethan

Reputation: 45

Where database configuration files are stored?

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

Answers (1)

Alex K
Alex K

Reputation: 22857

Internal DB configuration

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;amp;characterEncoding=UTF-8&amp;amp;autoReconnect=true&amp;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):

Connection with pgAdmin

Where datasources are stored

The table jijdbcdatasource contains information about jdbc based datasources.

For example, I created the new datasource like this:

Datasource at JRS

The all parameters were placed at new row of jijdbcdatasource table:

The jijdbcdatasource at pgAdmin

Upvotes: 3

Related Questions