aspose file tools*
The moose likes JDBC and the fly likes Speed Up JDBC Process with Oracle and Sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Speed Up JDBC Process with Oracle and Sybase" Watch "Speed Up JDBC Process with Oracle and Sybase" New topic
Author

Speed Up JDBC Process with Oracle and Sybase

Alan Kwok
Greenhorn

Joined: Mar 14, 2002
Posts: 7
Hello All,

I have encountered the following problem which I hope y'all good folks could help me out on. I have recently written a JDBC program that will call a stored procedure (via CallableStatement) in Oracle, return some data into the program, then pass all these data into a stored procedure in Sybase. The stored procedure in Sybase will return some values on which the program validates and then calls another stored procedure in Oracle to update several tables in the database. My program works so far but it is taking a long time to perform one single operation, I'm just wondering if there is a way I can speed up this process without doing anything in the backend like creating indexes on the Sybase database or so.


// Create connect for Oracle database
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
conOracle = DriverManager.getConnection("jdbc racle:thin:@13.123.2.21:1521:tstoracle1","testuser","testuser");

// Create connection for Sybase database
Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
conSybase = DriverManager.getConnection("jdbc:sybase:Tds:13.123.1.143:4100/tstsybase1","testuser","testuser");


I have quoted the code I used to establish connections to the databases, please let me know if you would require more information. Thank you very much in advance.

Regards... Alan
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

Alan,
Welcome to Javaranch!

I would suspect that most of the time is being taken up in the stored procedures themselves or the network. You can test this by putting some log statements in your Java code.

It is unlikely that you will be able to get a significant performance boost without touching something on the database.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Alan Kwok
Greenhorn

Joined: Mar 14, 2002
Posts: 7
Thank you very much Jeanne. I have followed your advice and have tracked down the problem which resides on the Sybase stored procedure itself. I will explore more on how to streamline the stored procedure. Thanks again!

Alan
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Speed Up JDBC Process with Oracle and Sybase