今天爱分享给大家带来用 JDBC 如何调用存储过程?【面试题详解】,希望可以帮助到大家!
通过JDBC组件中的CallableStatement接口实现调用存储过程。
核心代码如下:
<pre>
Class.forName(“com.mysql.jdbc.Driver”);
Connection conn=
DriverManager.getConnection(“jdbc:mysql:///test”,”root”,”root”);
CallableStatement cstmt = cn.prepareCall(“{call
insert_Student(?,?,?)}”);
cstmt.registerOutParameter(3,Types.INTEGER);
cstmt.setString(1, “wangwu”);
cstmt.setInt(2, 25);
cstmt.execute();
</pre>
原文链接:http://blog.itblood.com/2711.html,转载请注明出处。

![用洗脑APP肆意玩弄狂妄大小姐2 V1.0.5 官方中文正式版+存档[更新][电脑/3.3G] [调教互动SLG/中文/动态]](/wp-content/uploads/replace/2025/10/15/d43db3728f96fc9ba05a5ba4e8a67794.webp)