100分急问,JDBC中怎么样创建存储过程

cao_zp 2005-04-08 01:19:09
我用的是oracle数据库,用jdbc的execute命令来加载存储过程脚本。
但是总是返回false,而且加载的脚本编译不通过
...全文
176 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
cao_zp 2005-04-09
  • 打赏
  • 举报
回复
没有人做过?
全粘架构师 2005-04-09
  • 打赏
  • 举报
回复
CallableStatement cstmt=new CallableStatement({call procName});这几天看书正好看到
cao_zp 2005-04-08
  • 打赏
  • 举报
回复
要解决的问题是有一个a.orasql的脚本。里面有很多存储过程,要把他们自动加载到数据库中。
cenlmmx 2005-04-08
  • 打赏
  • 举报
回复
你可以执行存储过程A来创建存储过程B.A里用动态语句创建B.
topil 2005-04-08
  • 打赏
  • 举报
回复
路过,不创建过,只会执行,帮你顶吧
escalj 2005-04-08
  • 打赏
  • 举报
回复
那就跟你一起关注^_^
cao_zp 2005-04-08
  • 打赏
  • 举报
回复
是创建存储过程不是执行。
escalj 2005-04-08
  • 打赏
  • 举报
回复
用CallableStatement

A CallableStatement object provides a way to call stored procedures in a standard way for all RDBMSs. A stored procedure is stored in a database; the call to the stored procedure is what a CallableStatement object contains. This call is written in an escape syntax that may take one of two forms: one form with a result parameter, and the other without one. A result parameter, a kind of OUT parameter, is the return value for the stored procedure. Both forms may have a variable number of parameters used for input (IN parameters), output (OUT parameters), or both (INOUT parameters). A question mark serves as a placeholder for a parameter.

The syntax for invoking a stored procedure using the JDBC API is shown here. Note that the square brackets indicate that what is between them is optional; they are not themselves part of the syntax.

{call procedure_name[(?, ?, ...)]}

The syntax for a procedure that returns a result parameter is:

{? = call procedure_name[(?, ?, ...)]}

The syntax for a stored procedure with no parameters would look like this:

{call procedure_name}
cao_zp 2005-04-08
  • 打赏
  • 举报
回复
脚本没有任何问题,用plsql可以直接加载

62,616

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧