Jump to content
Changes to the Jaspersoft community edition download ×

Using stored procedures with parameters


Recommended Posts

By: Gloria Cortes - gcortes

Using stored procedures with parameters

2002-01-03 08:49

Hi all,

 

We are testing Jasper to use it in a project. We want use stored procedures with parameters. When we fill the query with the stored procedure and parameters(i.e. "exec sp_rc31ConsRelCobros($P{planilla},$P{ciudad})"), we got an error filling the report. Whe solved the problem changing the method executeQuery(connection)in the JRQueryExecuter class.

 

The code:

 

...

 

if (clazz.equals(java.lang.Byte.class)

|| clazz.equals(java.lang.Double.class)

|| clazz.equals(java.lang.Float.class)

|| clazz.equals(java.lang.Integer.class)

|| clazz.equals(java.lang.Long.class)

|| clazz.equals(java.lang.Short.class)

|| clazz.equals(java.lang.String.class)) {

if (parameterValue == null) {

pstmt.setNull(i + 1, Types.VARCHAR);

} else {

/*** HERE WE CHANGED ***/

/*** you had setString..*/

pstmt.setObject(i + 1, parameterValue);

}

....

 

Good Luck!

 

Gloria Cortes

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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