How can we insert Date into oracle table using TO_DATE injava?

56 Views Asked by At

I'm try to execute this function but I'm getting an exception.Can anybody tell me what is wrong?

public static void insertTransaction(String St_Id,String Bk_Id,String issuedate,String returndate)//throws Exception
    {
        getConnection();
        try{
         select.executeUpdate("insert into TRANSACTION values('"+St_Id+"','"+Bk_Id+"',to_date('"+issuedate+"','DD-MON-YYYY'),to_date('"+returndate+"','DD-MON-YYYY')");

        }catch(Exception e){
            e.printStackTrace();
            System.err.println("In Excpetion of insert");
        }
    }
0

There are 0 best solutions below