-1

我有几个需要澄清的疑问。请帮我度过难关

我的 MSSQL Server 中有一个存储过程,我需要从 java 调用它,据我所知,我需要执行这些步骤来调用该过程

  1. 连接到数据库(存储过程的确切位置)
  2. 使用 callablestatement 调用过程 CallableStatement cstmt = con.prepareCall("{call getEmployeeDetails(?, ?)}");

知道的请给我一些关于如何使用 callablestatement 以及如何使用 java 将参数传递给程序的例子。

4

1 回答 1

1

/After Establishing the connection to MSSQL database, here goes the code how to call a stored procedure/

 Connection conn;
 CallableStatement stmt = conn.prepareCall("{call dbo.usp_scr_getAllFiles()}");
 stmt = conn.prepareCall("{call dbo.usp_scr_startLoading()}");   
 stmt.close();
 conn.close();

/In the above code i called two stored procedures/

于 2012-09-14T08:34:01.990 回答