2001 JI Open Discussion Posted August 13, 2006 Share Posted August 13, 2006 By: Gloria Cortes - gcortes Using stored procedures with parameters 2002-01-03 08:49Hi 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now