Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle JDBC error - SOLVED!
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.
Glad it works. If the makers of Oracle JDBC drivers are reading, I hope it is clear to them why JDBC should echo back the query text with the location of the parse error. If it did, Peter would have seen something like
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, which enables the above error reporting via its API call,
OCIAttrGet(..., OCI_ATTR_PARSE_ERROR_OFFSET, ...)
JDBC driver developers everywhere: follow the clue. You can even adapt the OCI code in these other languages, which is open-sourced. We await your fix. ;)
--JH Received on Fri Jul 27 2007 - 08:13:35 CDT
![]() |
![]() |