-
Apr 6th, 2013, 05:21 AM
#1
How to execute simplejdbccall multiple times?
This is my code:
simpleJdbcCall = new SimpleJdbcCall(dataSource);
simpleJdbcCall.withProcedureName("sp_login")
.addDeclaredRowMapper(parameterName, rowMapper)
.returningResultSet(parameterName, rowMapper);
simpleJdbcCall.addDeclaredParameter(new SqlParameter("userid", Types.VARCHAR));
simpleJdbcCall.addDeclaredParameter(new SqlParameter("username", Types.VARCHAR));
simpleJdbcCall.addDeclaredParameter(new SqlOutParameter("result", Types.INTEGER));
Map<String, Object> result = null;
for (int i = 1; i <= 100; i++) {
SqlParameterSource in = new MapSqlParameterSource()
.addValue("userid", ""+i)
.addValue("username", "user"+i);
result=simpleJdbcCall.execute(in);
}
Executing 100 times in this way - is the correct one??
Any alternative solutions???
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules