ca.krasnay.sqlbuilder
Class InsertCreator
java.lang.Object
ca.krasnay.sqlbuilder.InsertCreator
- All Implemented Interfaces:
- Serializable, org.springframework.jdbc.core.PreparedStatementCreator
public class InsertCreator
- extends Object
- implements org.springframework.jdbc.core.PreparedStatementCreator, Serializable
A Spring PreparedStatementCreator that you can use like an InsertBuilder.
Example usage is as follows:
PreparedStatementCreator psc = new InsertCreator("emp").setRaw("id", "emp_id_seq.nextval").setValue("name",
employee.getName());
new JdbcTemplate(dataSource).update(psc);
- Author:
- John Krasnay
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InsertCreator
public InsertCreator(String table)
createPreparedStatement
public PreparedStatement createPreparedStatement(Connection conn)
throws SQLException
- Specified by:
createPreparedStatement in interface org.springframework.jdbc.core.PreparedStatementCreator
- Throws:
SQLException
setParameter
public ParameterizedPreparedStatementCreator setParameter(String name,
Object value)
setRaw
public InsertCreator setRaw(String column,
String value)
setValue
public InsertCreator setValue(String column,
Object value)
Copyright © 2014. All rights reserved.