更新时间:2022-11-12 15:20:56
这就是在java中调用参数化程序的方法
That's how calling a parametric procedure in java
import java.sql.CallableStatement;
...
//
// Prepare a call to the stored procedure 'demoSp'
// with two parameters
//
// Notice the use of JDBC-escape syntax ({call ...})
//
CallableStatement s = conn.prepareCall("{CALL Users(@fromdate=?,@Todate=?,@Users=?)}");
s.setString("1/2/2017", "2/3/2017","username");
对于整数:
For Integers:
cStmt.setInt(2, 1);