Jump to content
We've recently updated our Privacy Statement, available here ×

how to create data sources


monloi

Recommended Posts

Hi,

I'm new to Jasper. I just installed jasperserver from this link http://jasperforge.org/website/jasperserverwebsite/JSJA%20Website/js_download.html?header=project&target=jasperserver. Specifically this distribution 64-bit: jasperreports-server-cp-4.5.0-linux-x64-installer.run

I can see the sample reports and data sources, but how can I create new data sources (e.g. from mysql). Is that feature present with this distribution or it's only in "Jaspersoft Business Intelligence Software" (http://www.jaspersoft.com/thanks-download-30-day).

I would like to try Jaspersoft with new datasources and create new reports. Can I do that with the distribution I just installed?

 

Thanks,

Mon

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

1. yes, you can create the datasource using CE

2. Steps:

- view repository -> select any folder -> right click -> menu option -> add resource - new data source

There are 3 options:-

1. JDBC

2. JNDI

3. Bean

- you can create any datasource u want. You can edit the existing datasource for the values u need for the fields in creating new datasource

Ramnik Kaur

Lead QA Engineer

Link to comment
Share on other sites

 A quick how to  with MySQL and other database examples:

1) Ensure Driver is in the Classpath

It is important to ensure that the drivers for your database are included in the JasperServer classpath. Normaly that will be either your JasperServer WEB-INF/lib or your Tomcat lib folder

For my MySQL the driver .jar file can be downloaded here http://dev.mysql.com/downloads/connector/j/

2) Ensure that the Driver Class Name is correct

The following are some example driver class names for various databases:

MySQL: com.mysql.jdbc.Driver

Ingres: com.ingres.jdbc.IngresDriver

Oracle: oracle.jdbc.OracleDriver

SQL Server: com.microsoft.sqlserver.jdbc.SQLServerDriver

3) Database Privileges

When creating Database users, you must ensure that the user has the appropriate permissions to your database as well as from the server that JasperServer is running on.

Many databases, including MySQL, also require the user grants to include the specific host from which connections are allowed. Otherwise, when testing the JDBC connection, a connection may not be allowed even though the username and password are correct.  

For example, you may refer to the following page for Setting up MySQL users: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

4) Ensure Database URL is correct

Ensure that the Database URL string entered when defining your JDBC Connection is consistent with what is required for your specific database and database driver.

Example Database Connection URLs

MySQL: jdbc:mysql://localhost:3306/mydatabasename?useUnicode=true&characterEncoding=UTF-8

PostgreSQL jdbc:postgresql://localhost:5432/mydatabasename

SQL Server jdbc:sqlserver://localhost:1433;databaseName=mydatabasename;SelectMethod=cursor

Replace localhot to your MySQL hostname if it's running in a diferent machine, and also mydatabasename for the name of the database you want to connect.

 

Hope this helps :)

 

MarianoL

Link to comment
Share on other sites

  • 1 year later...
  • 7 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...