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

Java Server Postgresql JDBC


jcleiva

Recommended Posts

Jasper server 02/08/2012 20:22  

Hi all

 

I publish a report to the Jasper Server and it is not working as expected

The report uses a jdbc connection against a Postgresql DB.

The error message on the server log is this one:

Error Message

com.jaspersoft.jasperserver.api.JSExceptionWrapper: Error executing SQL statement for : report1
Error Trace

com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : report1 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:229) at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.createDatasource(JRTimezoneJdbcQueryExecuter.java:167) at com.jaspersoft.commons.util.JSControlledJdbcQueryExecuter.createDatasource(JSControlledJdbcQueryExecuter.java:113) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:

So I double checked  the postgresql logs and I foud that the jasper server is sending this statement to the postgresql DB inf front of our function call

SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY (this creates a lock on the tables involved in the function)

The function is dropping and creating some tables

 

So that makes the function we are calling to fail.

How can we disable it ?

It is something in the jdbc driver?

The reports works ok in the Ireport designer.

Thanks

 

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Actually what I found is that any select statement coming from the jasper server is encapsulated in a  transaction block,.

That means that the tables involved in the query are locked , we don't want that for just a select.......

Wondering if that is configurable some where in the server side .

 

Thanks

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi all

Never mind

After TWO WEEKS of looking in the forum I was able to find the solution for thism problem

This is the URL just in case someone come across with the same issue

 

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=50351&page=2

Basically what I needed to do was to change from using a jdbc connection to a jndi connection, wich was a little tricky due the lack of documentation .

The down size, my test licence for jasper has expired , so.........

../../../themes/jasper/images//tools/forum/shock.gif

 

 

Thanks

 

Link to comment
Share on other sites

  • 3 weeks later...

Hellow Everybody !

Im a student and i need a help to make a project for two days.I have to make this project :

 

Design and implement a program in Java RMI JDBC that enables remote clients to
control some parameters in a Documental Archive Building, which stores documents
sensitive to temperature, light, humidity and ventilation. The correct parameter values
should be as follows:
• Temperature: between min= 13ºC and max=18ºC
• Light: between min=65 lux and max 105 lux
• Humidity: between min 20% and max=30%
• Ventilation: open / close
 

The objective of this practice is to develop a client/server program in Java RMI JDBC
that offers to remote clients the following options, which enable to change the values
of the parameters, through a contextual menu1:
1. Connect a remote client to the server application: A client (employee) requests
to enter the application by providing its username and its password.
a. if the username and password (verified at the database) are correct, the
client enters the program and the options are shown to him.
b. the username and password (verified at the database) are incorrect, the
server should notify “You don’t have access to the application”.
2. A client (employee) can modify (increment and decrement the values of
temperature, light and humidity and open/close the ventilation) and consult
the value of each of the parameters above. When the introduced value is out of
the specified interval, exceptions should arise and error notifications should be
shown to the client.
3. Disconnect the user from application server.
The data base should have two tables:
• User, which keeps information on all users (clients): Id, name, surname,
username, active or not, blocked or not, last entrance to the system.

 

• Changes, which keep all changes done by a user in the parameter values. This is
done to keep track of who did parameter changes. Each row of the table should
contain the relative information on the user who did the changes, the date
when changes took place and the new values of the parameters.
To implement the program follow the steps below:
1. Design and implement the database in postgresql
2. Define the remote interface (only one remote interface in this case)
3. Implement the remote interface
4. Implement a Java server application
5. Implement a Java client application that uses the remote interface.
6. Compile all java sources (with javac) and further generate stubs and skeletons
(with rmic)
7. Deploy and run the application
For running and testing the application you can use the localhost.

I tried to solve but can not until we've reached the end as not promised time, if you help will be given the honor of knowing.

thank you.....best regards ! Andrin

 

 

Link to comment
Share on other sites

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