PL/SQL包过程代码: 
create or replace package body cridit_pkg is 
procedure add_bill( 
cardno bill.cardno%type, 
btype bill.btype%type, 
shopno bill.shopno%type, 
tono bill.tono%type, 
ip bill.ip%type, 
fromno bill.fromno%type, 
amount bill.amount%type, 
bdate bill.bdate%type) 
is 
begin 
  insert into bill values(gb_billno.nextval,cardno,btype,shopno,tono,ip,fromno,amount,bdate); 
end; 
end cridit_pkg; JAVA代码 
String cardno = request.getParameter("cardno"); 
String btype = request.getParameter("btype"); 
String shopno = request.getParameter("shopno"); 
String tono = request.getParameter("tono"); 
String ip1= request.getParameter("ip1"); 
String ip2= request.getParameter("ip2"); 
String ip3= request.getParameter("ip3"); 
String ip4= request.getParameter("ip4"); 
String ip = ip1+"."+ip2+"."+ip3+"."+ip4; 
String fromno = request.getParameter("fromno"); 
String amount = request.getParameter("amount"); 
String date = request.getParameter("date1")+"-"+ 
              request.getParameter("date2")+"-"+ 
              request.getParameter("date3"); 
String bdate ="to_date('"+date+"','yyyy-mm-dd')"; CriditcardDAO criditcardao = new CriditcardDAOJdbc(); 
result = criditcardao.insertBill(cardno,btype,shopno,tono,ip,fromno,amount,bdate); //具体方法: 
public int insertBill(String cardno, String btype, 
String shopno, String tono, String ip, String fromno, 
String amount, String bdate) { 
// TODO Auto-generated method stub 
    int result=0; 
    String sql="{ call cridit_pkg.add_bill(?,?,?,?,?,?,?,?)}"; 
    String param[]={cardno,btype,shopno,tono,ip,fromno,amount,bdate}; 
    result=db.update(sql, param); 
    return result; 

//测试 
cardno:9527 
btype:商场消费 
amount:1000 
date1:2009 
date2:1 
date3:1 
//提交结果 
java.sql.SQLException: ORA-01858: 在要求输入数字处找到非数字字符 
ORA-06512: 在 line 1 
Query: { call cridit_pkg.add_bill(?,?,?,?,?,?,?,?)} Parameters: [9527, 商场消费, 9527, null, null, null, 1000, to_date('2009-1-01','yyyy-mm-dd')] 
//当不输入日期时(没有to_date('2009-1-01','yyyy-mm-dd')时),结果正确. 
//请教各位大侠,我该怎么改。