• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

20,000 ~ 30,000 rows Insert

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...
DB: oracle 8.1.6
server: Apache(?) + tomcat(4.0.2)
data: 000@111@aaa@bbb@ccc ~~~ : 20 ~ 30 col
i insert and delete 20000~30000 rows data everyday.
the run time is usual 5 minutes.
i wants reduce time....
while (stringLine != null) {
StringTokenizer st = new StringTokenizer(stringLine);
for (int i =1; i<= j; i++) { // j = 20 ~ 30
pstmt.setString(i,st.nextToken("@"));
}
pstmt.executeUpdate();
stringLine = br.readLine();
}
thank
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you using PreparedStatments, this kind of optimisation is already done. But probably you should try to replace the StringTokenizer ( see tip).
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
since data supplied is very little about the delimited string.
What I guess is you might be reading from a file a delimited string which you are updating to database. JSP/Java is used as a application in between the backend and file.
Sysbase got an application called "BCP" which do the bulk upload to backend with delimited and fixed files. similar application is also provided by oracle please check up the oracle Manuel for details. Which reduces the uploading time.
Regards
arun
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BCP equivalent tool in oracle is sql*loader/sqlldr
 
Hirosue Ryoko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You...
but...
this program operates from the web env.
so i can't used sqlldr(sqlloader).
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have used BCP to similar stuff as web application. I guess there is a way out for sql loader too.
-arun
 
Hirosue Ryoko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
i use to sqlldr from local test env.
but,
the app server is not the install
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic