Re: Java and oracle 8i

From: Peter Sylvester <peters_at_mitre.org>
Date: Tue, 20 Mar 2001 08:20:56 -0500
Message-ID: <3AB75938.6C74046A_at_mitre.org>


I would expect that it should work as written, but I would tend to move the prepareStatement() out of the loop and reuse it. May see better performance this way too.

-Peter

Thomas Durlach wrote:
>
> essentially its just this......(took out alot of code) ......stmt is a
> prepared statement....and one is the sql query string...the sql is
> correct.... (and record size is 1124)...gets up to 525 and pukes.....i have
> tried alo of combos (setting autocommit off, doing commits maunally, etc). i
> even tried opening a new connection after the 500th record....but i still
> get that tns data channel error.......? Only other thing i can think
> of....is this right -> using the jdbc:oracle:thin?
>
> try
> {
> connection = dbControl.openConnection(connection, importName);
>
> for(int x=0; x<records.size(); x++)
> {
> .......
>
> stmt = null;
> stmt = connection.prepareStatement(one);
> stmt.executeUpdate();
> stmt.close();
>
> }
>
> }
>
> catch (SQLException de)
> {
> System.out.println("unable to insert beacuse: " + de);
>
> }
Received on Tue Mar 20 2001 - 14:20:56 CET

Original text of this message