1 16 17 package org.springframework.jdbc.core; 18 19 import java.sql.PreparedStatement ; 20 import java.sql.SQLException ; 21 22 28 class ArgPreparedStatementSetter implements PreparedStatementSetter, ParameterDisposer { 29 30 private final Object [] args; 31 32 33 public ArgPreparedStatementSetter(Object [] args) { 34 this.args = args; 35 } 36 37 38 public void setValues(PreparedStatement ps) throws SQLException { 39 if (this.args != null) { 40 for (int i = 0; i < this.args.length; i++) { 41 StatementCreatorUtils.setParameterValue(ps, i + 1, SqlTypeValue.TYPE_UNKNOWN, null, this.args[i]); 42 } 43 } 44 } 45 46 public void cleanupParameters() { 47 StatementCreatorUtils.cleanupParameters(this.args); 48 } 49 50 } 51 | Popular Tags |