Re: Columns out of range-error

Lists: pgsql-jdbc
From: "Andreas Percher" <andreas(dot)percher(at)automedia(dot)de>
To: <pg(at)fastcrypt(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>, <tobias(dot)zielke(at)automedia(dot)de>
Subject: Re: Columns out of range-error
Date: 2004-08-20 15:20:16
Message-ID: 000601c486c9$33972b30$1600a8c0@developer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


> First of all, do not use begin, use setAutoCommit(false);
Silly question:
Where ?
How ?

I don't get any acces to the postgresDB, only the JDBC-Conection.

> I still need to see the loop that you are inserting the data in?
This is what Woolve73 will send to you, i guess.

Dave
On Fri, 2004-08-20 at 11:05, (AnPe) Andreas Percher wrote:
> I'm a Newbe in using commitment control.
> Toby (Woolve73) is my Colleague.
> So I try to refine his question.
>
> Step 1
> We've got a Table with 203 columns.
> We wan't to add (insert) up to 150 new rows.
> Each row need 38-52 columns.
>
> Step 2
> Using pgAdmin anithing is fine.
> Adding "begin" and "roolback" (we don't want to kill our live
> database)
> - it works.
> Sending the inserts out of our Java-Application without start/roolback
> works too.
>
> Step 3
> Now back in Java.
> Sending a "begin" it gives us a SQL Error
> "Spaltenindex außerhalb des gültigen Bereichs"
> Which meens
> "The column index is out of range."
>
> --> postgresql.res.colrange:Spaltenindex außerhalb des gültigen
> --> Bereichs postgresql.res.colrange:The column index is out of range.
>
> This error message occur after 13-16 inserts, depending on the column
> count of each insert. Sending the inserts without the long data field
> "specialequipment", results in letting the error occur one insert
> later.
>
> In case of the Error, round about 600 columns (counted over all
> inserts) are waiting for its commitment.
>
> Step 4
> We are confused.
> We need to use commitment control, because if one insert, update or
> delete fails, or if an error in the data input stream occurs, we have
> to rollback.
>
> > Toby,
> >
> > You will have to give us more information.
> > can you show us the relevant code ?
> > But in general you can't put 650 columns into 200 columns ? How is
> > that supposed to work ?
> >
> > Dave
> > On Fri, 2004-08-20 at 10:20, Tobias Zielke wrote:
> > > Hi,
> > >
> > > We have a Problem with postgresql 7.4.3 and jdbc
> > > ...
> > > Thnx
> > > Woolve73
> > > Toby


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: andreas(dot)percher(at)automedia(dot)de
Cc: pg(at)fastcrypt(dot)com, pgsql-jdbc(at)postgresql(dot)org, tobias(dot)zielke(at)automedia(dot)de
Subject: Re: Columns out of range-error
Date: 2004-08-20 23:10:04
Message-ID: 412684CC.3070002@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Andreas Percher wrote:
>>First of all, do not use begin, use setAutoCommit(false);
>
> Silly question:
> Where ?
> How ?
>
> I don't get any acces to the postgresDB, only the JDBC-Conection.

It's a method on the JDBC Connection object:
java.sql.Connection.setAutoCommit()

>>I still need to see the loop that you are inserting the data in?
>
> This is what Woolve73 will send to you, i guess.

It'd be useful if you could send it to the list too..

-O


From: "Andreas Percher" <andreas(dot)percher(at)automedia(dot)de>
To: "'Oliver Jowett'" <oliver(at)opencloud(dot)com>
Cc: <pg(at)fastcrypt(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>, <tobias(dot)zielke(at)automedia(dot)de>
Subject: Re: Columns out of range-error
Date: 2004-08-23 07:45:48
Message-ID: 000001c488e5$35767320$1600a8c0@developer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc


...SaveCar...
434 Statement st = db.query(sel);
435 ResultSet rs = st.getResultSet();
436 if (rs!=null && rs.next()) {
437 bOK = updateRecord(rs.getString(0));
438 } else {
439 bOK = insertRecord();
...

OHHHH GOOOOOD
What a silly Idiot I am ???

rs.getString(0)

0 ?

0 !!!!!!

SORRY !!!
Thank you for all Your help !!!!!