存储过程有形参
如果形参的类型是 out 的时候应该怎么书写调用代码?
以及如何得到这个返回值,在java中?
谢谢了

解决方案 »

  1.   

    // Call a procedure with one OUT parameter
            cs = connection.prepareCall("{call myprocout(?)}");
        
            // Register the type of the OUT parameter
            cs.registerOutParameter(1, Types.VARCHAR);
        
            // Execute the stored procedure and retrieve the OUT value
            cs.execute();
            String outParam = cs.getString(1);     // OUT parameter