import groovy.sql.Sql
sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:XE", "user",
"pwd", "oracle.jdbc.driver.OracleDriver")
sql.eachRow("select * from someTable", {
println it
} ).setTimeout(15000) // set timeout for query to 15 seconds ??
Thanks!
--
View this message in context: http://old.nabble.com/SQL%2C-set-timeout-for-query-tp27227674p27227674.html
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Merlyn Albery-Speyer wrote:
>
> It doesn't appear so, no. You could setQueryTimeout if you can get
> access to the Statement.
>
I believe the correct way to do this is as follows:
sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:XE", "user",
"pwd", "oracle.jdbc.driver.OracleDriver")
sql.withStatement {
stmt -> stmt.queryTimeout = 10
}
sql.eachRow("select * from someTable", {
println it
} )
--
View this message in context: http://old.nabble.com/SQL%2C-set-timeout-for-query-tp27227674p27346658.html