[java]代码库
package com.clcud.oracle;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.clcud.bean.IDao;
public class Oracle {
private static ApplicationContext context = new ClassPathXmlApplicationContext("classpath:app-context.xml");
public static void main(String[] args) throws SQLException {
procedureAndDiaoyong();
}
public static void procedureAndDiaoyong() throws SQLException {
Connection conn = IDao.getDataSource().getConnection();
CallableStatement cs = conn.prepareCall("{call pro_1(?)}");
cs.setString(1, "曹虎1");
cs.execute();
cs.close();
System.out.println("过程:pro_1 执行成功");
conn.close();
}
}