日期:2014-05-20 浏览次数:20817 次
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@192.168.1.12:1521:QB";
String user = "qb";
String pwd = "qb";
Connection conn = null;
CallableStatement cs = null;
ResultSet rs = null;
try {
Class.forName(driver);
conn = DriverManager.getConnection(url, user, pwd);
// cs = conn.prepareCall("{ call DBO.PRO_3(?) }");
cs = conn.prepareCall("{ call pkg_wzpeople.p_area(?,?,?,?) }");
Calendar c=Calendar.getInstance();
c.clear();
c.set(Calendar.YEAR, 2010);
c.set(Calendar.MONTH, 7);
Date d1 = c.getTime();
java.sql.Date d1s=new java.sql.Date(d1.getTime());
c.clear();
c.set(Calendar.YEAR, 2014);
c.set(Calendar.MONTH, 9);
Date d2 = c.getTime();
java.sql.Date d2s=new java.sql.Date(d2.getTime());
cs.registerOutParameter(4, oracle.jdbc.OracleTypes.CURSOR);
cs.setDate(1, d1s);
cs.setDate(2, d1s);