Jump to content
JasperReports Library 7.0 is now available ×

Connect to the Jasper Reports samples database on localhost


berlin.brown
Go to solution Solved by kkumlien,

Recommended Posts

I am trying to connect to the hsqldb database that is running on localhost.  I can connect through the runManager fine, but when I try to connect through a jasper reports adapter and hit "Test" I get an error below.

When using the runmanager for hsqldb:

HSQL Database Engine Server
org.hsqldb.jdbcDriver
jdbc:hsqldb:hsql://localhost/
user: sa
password: empty

But when connecting through the database jdbc connector, this does not work:

jdbc:hsqldb:hsql://localhost/
Username:sa
Password: empty

In the jasper client:

net.sf.jasperreports.engine.JRException: java.sql.SQLTransientConnectionException: connection exception: connection failure: java.io.EOFException
    at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.contributeParameters(JdbcDataAdapterService.java:130)
    at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:122)
    at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.runOperations(AbstractDataAdapterWizard.java:162)
    at com.jaspersoft.studio.utils.jobs.CheckedRunnableWithProgress$1.run(CheckedRunnableWithProgress.java:59)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLTransientConnectionException: connection exception: connection failure: java.io.EOFException
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.getConnection(JdbcDataAdapterService.java:168)
    at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.contributeParameters(JdbcDataAdapterService.java:128)
    ... 4 more
Caused by: org.hsqldb.HsqlException: connection exception: connection failure: java.io.EOFException
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.ClientConnection.execute(Unknown Source)
    at org.hsqldb.ClientConnection.<init>(Unknown Source)
    ... 9 more
 

 

And even on the server side, I see this error on the hsql

     [java] Exception in thread "HSQLDB Connection @56f3bb82" java.lang.NullPointerException
     [java]     at org.hsqldb.ServerConnection.close(Unknown Source)
     [java]     at org.hsqldb.ServerConnection.run(Unknown Source)
     [java]     at java.lang.Thread.run(Thread.java:748)
 

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I was able to create a jdbc data adapter with the following settings and connect and print values from address table in a report. I've tested using Jaspersoft Studio 6.6.0 and hsqldb in JasperReports 6.8.0.

Note that hsqldb in JasperReports 6.8.0 is version 2.4.0. Jaspersoft Studio 6.6.0 is also using 2.4.0. They should match. If the server and client version do not match, you may get error.

JDBC Driver: org.hsqldb.jdbcDriver

JDBC Url: jdbc:hsqldb:hsql://localhost

Username: sa

Password:

1. I open a console in demo/hsqldb directory

2. Execute "ant"

3. Open Jaspersoft Studio 6.6.0 and create a Data Adapter with the above information and clicked on the "Test" button. Returned "Success".

4. Created JasperReports report and used the created data adapter with "SELECT * FROM address".

5. Put all fields in the details band.

6. Did a preview and all data were displayed in my report.

 

Link to comment
Share on other sites

I am using the "demo" samples from jasper reports.  It is clear that the hsqldb is running  as  standalone server.  For example:

https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/demo/samples/charts/src/ChartsApp.java

 

https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/src/net/sf/jasperreports/engine/util/AbstractSampleApp.java

 

//Change these settings according to your local configuration
            String driver = "org.hsqldb.jdbcDriver";
            String connectString = "jdbc:hsqldb:hsql://localhost";
            String user = "sa";
            String password = "";

Link to comment
Share on other sites

  • 2 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...