Subject Re: prepared insert
Author pmoon7@yahoo.com
if(driverNameWrite=="JDBC")
{ Class.forName("interbase.interclient.Driver");
String urlPath =
GenMain.class.getResource("GenMain.class").getFile();
int trailPathLength = urlPath.length() -
"cls/Generic/GenMain.class".length();
String path = urlPath.substring(1, trailPathLength);

String URL = "jdbc:interbase://localhost/"+path+"IBExport.gdb";
ibDataSource.setSweepOnConnect(false);
connectionWrite =
ibDataSource.getConnection("sysdba","masterkey");
connectionWrite.setAutoCommit(false);
}

Thanks for the response! The above codes is how I made the
connection. Everything seem to be in order. My last option may be to
go with delphi.


--- In ib-support@y..., "Leyne, Sean" <InterbaseSupport@a...> wrote:
> I can think of a couple of reasons of the top of my head...
>
> 1) Your default commit mode could be "auto-commit", which means that
> each iteration of the loop was starting/committing a transaction.
>
>
> 2) The database access method you are using is just "sucking wind",
what
> are you using to connect to the database?
>
>
> 3) You are performing your test using a table which you deleted all
the
> rows, just prior to executing the test. Try executing "SELECT *
from
> table" before running the test, this will force a garbage collection
to
> be performed - this will be the 'fairest' test situation.
>
>
> 4) Your test resulted in the sweep process starting, which held up
the
> test until it was completed.
>
>
> I know that using Delphi/BDE you should be able to insert 100
records in
> a table in < 1 sec., so something is obviously wrong with your test.
>
>
> Sean
>
> -----Original Message-----
> From: pmoon7@y... [mailto:pmoon7@y...]
> Sent: Friday, June 01, 2001 3:17 PM
> To: ib-support@y...
> Subject: [ib-support] prepared insert
>
> System.gc();
> prepStmtInsert = genSql.setPrepStmtValue(prepStmtInsert,
fileRow);
> for (int cc=0; cc<100; cc++)
> {
> int intXX = prepStmtInsert.executeUpdate();
> }
>
> I wrote the above preparedStatement in java to insert 100 records
into
> IB5.6. It took 250 seconds to update. In MS Access using OBDC, the
> same insert of 100 records took 80 seconds. Index was turned off
and
> I am using JDBC to IB5.6, seems like it should beat MS Access. I
must
> be doing something wrong. Appreciate any help...thanks