My standalone java app looks up a JNDI Datasource, defined in a JBoss application server. I use spring 2.5.6, which has a nice SimpleJdbcInsert class.
The use of the JNDI Datasource works when I use the SimpleJdbcTemplate, but not with the SimpleJdbcInsert. The last one gives a ClassCastException. Ofcourse I can work around it, because with the SimpleJdbcTemplate you can do inserts as well, but maybe it's a bug?
Above code works with a locally defined DataSource, but not with a JNDI DataSource, defined in a JBoss 4.3. environment, then it throws:
Map<String, Object> parms = new HashMap<String, Object>();
When I replace the use of the SimpleJdbcInsert with SimpleJdbcTemplate, the error has gone:
at $Proxy10.getTables(Unknown Source)
Due to time constraints I stopped looking, since I got it working, but anybody an idea?
jdbcTemplate.update("insert into my_table ("
+ "field1, field2, field3)"
+ " values (?, ?, ?)"
, x, y, z)