Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle JDBC error - SOLVED!

Re: Oracle JDBC error - SOLVED!

From: Peter Ashford <peter.m.ashford_at_gmail.com>
Date: Thu, 26 Jul 2007 20:05:28 -0700
Message-ID: <1185505528.357076.152680@j4g2000prf.googlegroups.com>


On Jul 26, 4:39 pm, Peter Ashford <peter.m.ashf..._at_gmail.com> wrote:
> I'm getting this error doing an SQL insert:
>
> java.sql.SQLException: ORA-01745: invalid host/bind variable name
>
> I know there's no invalid names in the insert because I can insert
> data into the table by hand over sqlplus.
>
> I'm using oracle's ojbdc14 jdbc driver and Java 1.6.
>
> Any ideas?

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 am SUCH an idiot. :o)

Thanks everyone who offered help and ideas - especially Joe and Steve!

Peter. Received on Thu Jul 26 2007 - 22:05:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US