aspose file tools*
The moose likes JSP and the fly likes 20,000 ~ 30,000 rows Insert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "20,000 ~ 30,000 rows Insert" Watch "20,000 ~ 30,000 rows Insert" New topic
Author

20,000 ~ 30,000 rows Insert

Hirosue Ryoko
Greenhorn

Joined: May 30, 2002
Posts: 3
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

Joined: Jul 12, 2002
Posts: 12
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

Joined: Nov 28, 2001
Posts: 233
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


Sharing is learning
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
BCP equivalent tool in oracle is sql*loader/sqlldr
Hirosue Ryoko
Greenhorn

Joined: May 30, 2002
Posts: 3
Thank You...
but...
this program operates from the web env.
so i can't used sqlldr(sqlloader).
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
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

Joined: May 30, 2002
Posts: 3
Hi!
i use to sqlldr from local test env.
but,
the app server is not the install
 
wood burning stoves
 
subject: 20,000 ~ 30,000 rows Insert