存储过程

1.创建存储过程

USE [test]  
GO  
CREATE PROCEDURE findAllBooks   
AS  
BEGIN  
    SELECT * from tb_books  
END  
GO  

 

2.调用存储过程

CallableStatement cs = connection.prepareCall("{call findAllBook()}");  
  
ResultSet resultSet = cs.executeQuery();  

 

posted @ 2017-06-08 09:37  鱼長  阅读(136)  评论(0编辑  收藏  举报