`
meiyoudao
  • 浏览: 90560 次
  • 性别: Icon_minigender_1
  • 来自: 冲脉
社区版块
存档分类
最新评论

JDBC存储过程调用

阅读更多
接口CallableStatement继承PreparedStatement接口用于调用存储过程
//无参调用
String sql = "{call p_t_regeistUser()}";
		CallableStatement call = con.prepareCall(sql);
		
//带参调用
		String sql2 = "{call p_t_regeistUser(?,?,?,?)}";
		CallableStatement call2 = con.prepareCall(sql);
		//输出参数为verchar类型
		call2.registerOutParameter(3, Types.VARCHAR);
		//输入参数
		call2.setInt(1, 201008269);
		call2.setString(2, "name");
		call2.setDate(3, new Date(System.currentTimeMillis()));
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics