aspose file tools*
The moose likes JDBC and the fly likes Time complexity for jdbc connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Time complexity for jdbc connection" Watch "Time complexity for jdbc connection" New topic
Author

Time complexity for jdbc connection

kumarjit banerjee
Ranch Hand

Joined: Mar 27, 2011
Posts: 32

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.
 
 
subject: Time complexity for jdbc connection
 
Similar Threads
Threads and DB Access
commit and rollback question
taking user response in middle of server processing?
help with a shell script
issue when calling shell script from java