This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Time complexity for jdbc connection  RSS feed

 
Ranch Hand
Posts: 32
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was given a task to upload data into tables from files, call a pl/sql procedure, delete the records from the table. create a log file and a error file if any.
The file will come as
Header
Record:a1,a2,,,,,,,
Record:b1,b2,,,,,,,
Footer
Here the Record is the data I need to upload in the table.

I have implemented it in a java program. The java program will be invoked from a shell script. Upto this, it is fine and I am able to do the thing as expected. However the problem comes when there are more number of records. Also the time taken to connect to the database is considerable amount.

I am making the connection using the classes12.jar. For 4 records, the time taken for connection =2 secs(approx) and for processing = 2secs(approx), which mean half the time is taken for making the connection. Is there any way so the connection may be already available when the jvm is loaded when the shell script is run. Secondly, is there any way so that the performance may be improved. The insert I am using is of the form




As per my my understanding that, when control return from main, the jvm exits. In that case no objects could be present. But can there be any way round regarding the time taken to make the connection.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!