List of usage examples for org.apache.commons.dbutils GenKeyQueryRunner update
public int update(Connection conn, String sql) throws SQLException
From source file:ttf.persistence.sql.TopicSaver.java
private void insert(Topic topic) throws SQLException { GenKeyQueryRunner<String> run; run = new GenKeyQueryRunner<String>(dataSource, new IdResultHandler()); String sql = "INSERT INTO Topics (title) VALUES (?)"; run.update(sql, topic.getTitle()); String id = run.getGeneratedKeys(); topic.setId(id);//from ww w .j a v a 2 s . co m }