> I am new to database and its concepts and I have few
> questions in implemeting my program. I have a program
> which reads an ascii file and updates into the
> corresponding table in the database. This works fine.
> Now I need to use threads ( i use java) where each
> thread reads one Ascii file( I have synchronized the
> reading of the ascii file) and updates into the
> database concurrently. Is there any methods or
> statements I need to add into the program or Is there
> anything I need to set in sapdb when I use thread.
> What state do I need to set the conn.autocommit? Also
> the Ascii files are independent of each other. 

- use one Connection per thread (the user must have been created as NOT EXCLUSIVE). 
Only one .execute () can be active on a Connection so you wouldn't gain much if there 
is only one Connection

- if you want to maximize performance: 
  * set autocommit to false (but do an explicit 
    Connection.commit () every few hundred INSERTs
  * use PrepapredStatements and addBatch, executeBatch

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to