• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help in connection performance...

 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
In my application the scenario is ..
1: Parsing of Xls file which retrieves the values from Xls and set them to the Bean.
2: After parsing , each record is sent to validation with the records present in another table if the data is validated it is inserted to the new table .
3: So each time i insert the record , connection is opened and closed..the process take time ...due to that it says time out on web ..
4: File is having 4000 records..so need a optimum solution

Can anybody tell me the possible solution so that i can handle this..

Thanks in advance..

Regards
raza!
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use 1 connection for validating and inserting instead of 4000?
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i use stored procedure to write comma delimited string to table ?
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to write comma delimited data to a column and then need to left join with other table ..
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using a PreparedStatement, use a single Connection and insert the records in batches (see the API for PreparedStatement addBatch method)
4000 isn't a huge number of inserts.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using EJB to insert the records rather than prepared statement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic