spring-jdbc

Send Multiple Data to DB in Spring

Hi, I have this scenario in my Spring MVC Apps. User has to choose what hobbies he/she likes. He can choose at least one or many hobbies. My problem is this, If I need to save the list of hobbies into my DB, I am thinking of sending the list of hobbies that my user has chosen, delimited by a comma separator. Its like this: Baskteba...

Can I ask JDBCTemplate to expand a list parameter for use in an in() clause?

Can I do something like this: select * from mytable m where m.group_id in (?) ... and pass in a list or array of arguments to be expanded in to my parameter, ie: select * from mytable m where m.group_id in (1,2,3,4) Specifically, I'm using Spring and the JdbcTemplate/SimpleJdbcTemplate classes. ...

Do a DB2 insert with a select and parameters

I want to do something like this: INSERT INTO TABLEA ( COLUMN1, COLUMN2, COLUMN 3 ) SELECT FOOBAR, DOOBAR, ? FROM TABLEB And then send this to JDBC via Spring JDBC to update... simpleJdbcTemplate.update( mySqlFromAbove, someVariableToReplaceQuestionMark ); Is this even possible? It would work fine if I replace the question mark wi...

Getting a JDBC connection by JNDI in Spring JDBC

This page on Spring JDBC says The DataSourceUtils class … provides static methods to obtain connections from JNDI However the API doc for DataSourceUtils does not include the said static methods, as far as I can see. What am I missing? ...

Cannot get a connection, pool exhausted

Hi, I am using Spring,ibatis. I have configured following in xml file <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"><value>${driverClassName}</value></property> <property name="url"><value>${url}</value></property> <property name="u...

pushing data to a clob with spring JDBC; what if I don't know the length?

Here's a bit of example code from the spring doc. Note that it passes the length of the clob and blob data to the lobCreator. What if I don't know the length? Do I have any choices save to buffer? jdbcTemplate.execute( "INSERT INTO lob_table (id, a_clob, a_blob) VALUES (?, ?, ?)", new AbstractLobCreatingPreparedStatementCallback(lo...

Spring JDBC versus Derby Stored Procedure ...

Derby documents syscs_util.syscs_backup_database. I made the following trivial class: public class DerbyMemoryDatabaseDumpDao extends JdbcDaoSupport { private SimpleJdbcCall caller; @PostConstruct public void initialize() { caller = new SimpleJdbcCall(getDataSource()).withCatalogName("SYSCS_UTIL") .with...

How to get prepared SQL statement from JdbcDaoSupport (Spring)

I use JdbcDaoSupport (Spring) approch to access data from my DB. I would like to get prepared SQL statement for logging. Any idea how to get it? ...