Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

20,000 ~ 30,000 rows Insert

 
Hirosue Ryoko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Horst Naujoks
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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).
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi!
i use to sqlldr from local test env.
but,
the app server is not the install
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic