Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle JDBC error - SOLVED!
On Fri, 27 Jul 2007, hin_at_alma.com wrote:
> On Jul 26, 11:05 pm, Peter Ashford <peter.m.ashf..._at_gmail.com> wrote:
>> I got it! >> >> PreparedStatement pStmt = db.prepareStatement( >> "INSERT INTO departments ("+ >> " deptName, schoolName, division, dean, AVC, HOD, >> admin, adminPhone, adminEmail," + >> " streetAddress, city, cbCostCentre, >> cbOHAccountCode, cbOHDisection, comments, " + >> " schoolLiasonAdmin, dateEntered)" + >> " VALUES (?,?,?,?,?,?,?,?,?,?"+ >> " ?,?,?,?,?,?,?)"); >> >> There's a missing comma between the lines of ?'s.
I'm not sure how jdbc is supposed to echo anything back to anywhere. An exception is an object. What Peter would have seen is a stack trace from the exception being hit.
Maybe the exception object needs to be amended so as to put more juicy stuff in the correct section of the exception object.
> If it did, Peter would have seen something like
>
> ------------------------------------------------
> Error, near <*> indicator in statement:
>
> INSERT INTO departments (
> deptName, schoolName, division, dean, AVC,
> HOD, admin, adminPhone, adminEmail, streetAddress, city,
> cbCostCentre, cbOHAccountCode, cbOHDisection, comments,
> schoolLiasonAdmin, dateEntered)
> VALUES (?,?,?,?,?,?,?,?,?,? <*> ?,?,?,?,?,?,?)
> ------------------------------------------------
>
> and we would not have known this 13-message thread.
>
> As I mentioned, the above is like what perl's, Lisp's and other Oracle
> "connectors" give you. Presumably most Oracle JDBC drivers
> are written on top of OCI,
The OCI driver would be, the thin driver would not. Which is what I'm guessing to really be the issue. I believe java wants the same exact behaviour from its OCI and thin layers. Since it cannot give the OCI behaviour in thin, I wonder if they forgo that behaviour and instead match the thin driver. Imagine if the exception handling mechanism coded by the client of the driver looked for a certain error and did something when it was hit. If the OCI driver returned a different error than the thin driver, then the substitution of different drivers might break the codebase.
> which enables the above error reporting via its API call,
>
You need to be barking at Oracle directly. It is their driver's not being verbose enough.
-- Galen BoyerReceived on Sun Jul 29 2007 - 23:59:01 CDT