This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes oracle SQL Execution Time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "oracle SQL Execution Time" Watch "oracle SQL Execution Time" New topic
Author

oracle SQL Execution Time

Wilson Tsing Yi
Greenhorn

Joined: Jul 12, 2004
Posts: 2
Dear Expert,

May I know how to limit the SQL execution time when after connection has obtained in a java program ?

Thanks

wilson
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63232
    
  69

"GDWilson",

We're pleased to have you here with us here on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Hi Wilson,

If I understand your question (and I'm not sure I do) then you can set the query timeout provided by java.sql.Statement. A SQLException is thrown if the timeout period expires.

A word of caution, however: Once you've submitted your query to the database via JDBC you have no control over how long it actually takes to execute. Just because you time out the query at the Java end doesn't mean that it will stop running on the database.

My advice is to make sure you write efficient SQL queries and try to run them independently on the DB before running them through Java so you can be confident that they won't run for ages. If you run them first on the DB directly you can kill them more easily if they're wrong.

Hope this helps.

Regards

Jules
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: oracle SQL Execution Time
 
It's not a secret anymore!