Christian Dupuis
Aug 16th, 2004, 10:10 AM
Hallo everybody,
I'm currently struggling with writing an clob field in oracle 8 database using build in stored procedure support of spring jdbc package.
I have the following class:
private static class InsertTransaction extends StoredProcedure {
public InsertTransaction(DataSource ds) {
super(ds, ECUTransactionDAO.INSERT_PROCEDURE);
declareParameter(new SqlParameter("REQUEST", Types.CLOB));
compile();
}
public Map execute(String request) {
HashMap map = new HashMap();
map.put("REQUEST", request);
return super.execute(map);
}
}
Calling the execute method gives me a
java.lang.ClassCastException
at oracle.jdbc.driver.OraclePreparedStatement.setObje ct(OraclePreparedStatement.java:3069)
at oracle.jdbc.driver.OraclePreparedStatement.setObje ct(OraclePreparedStatement.java:3107)
at org.springframework.jdbc.core.StatementCreatorUtil s.setParameterValue(StatementCreatorUtils.java:107 )
at org.springframework.jdbc.core.StatementCreatorUtil s.setParameterValue(StatementCreatorUtils.java:62)
at org.springframework.jdbc.core.CallableStatementCre atorFactory$CallableStatementCreatorImpl.createCal lableStatement(CallableStatementCreatorFactory.jav a:193)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:581)
at org.springframework.jdbc.core.JdbcTemplate.call(Jd bcTemplate.java:610)
at org.springframework.jdbc.object.StoredProcedure.ex ecute(StoredProcedure.java:101)
which I is quite obvious because I try to write a String in an CLOB field.
But what is the correct way getting a huge string in an clob field using an
stored procedure?
Any hints or pointers to examples?
Thanks
Christian Dupuis
I'm currently struggling with writing an clob field in oracle 8 database using build in stored procedure support of spring jdbc package.
I have the following class:
private static class InsertTransaction extends StoredProcedure {
public InsertTransaction(DataSource ds) {
super(ds, ECUTransactionDAO.INSERT_PROCEDURE);
declareParameter(new SqlParameter("REQUEST", Types.CLOB));
compile();
}
public Map execute(String request) {
HashMap map = new HashMap();
map.put("REQUEST", request);
return super.execute(map);
}
}
Calling the execute method gives me a
java.lang.ClassCastException
at oracle.jdbc.driver.OraclePreparedStatement.setObje ct(OraclePreparedStatement.java:3069)
at oracle.jdbc.driver.OraclePreparedStatement.setObje ct(OraclePreparedStatement.java:3107)
at org.springframework.jdbc.core.StatementCreatorUtil s.setParameterValue(StatementCreatorUtils.java:107 )
at org.springframework.jdbc.core.StatementCreatorUtil s.setParameterValue(StatementCreatorUtils.java:62)
at org.springframework.jdbc.core.CallableStatementCre atorFactory$CallableStatementCreatorImpl.createCal lableStatement(CallableStatementCreatorFactory.jav a:193)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:581)
at org.springframework.jdbc.core.JdbcTemplate.call(Jd bcTemplate.java:610)
at org.springframework.jdbc.object.StoredProcedure.ex ecute(StoredProcedure.java:101)
which I is quite obvious because I try to write a String in an CLOB field.
But what is the correct way getting a huge string in an clob field using an
stored procedure?
Any hints or pointers to examples?
Thanks
Christian Dupuis