-
1. Re: Return result of Statement.execute(sqlstring)
shawkins Jan 23, 2013 4:15 PM (in response to jane_lj)1 of 1 people found this helpfulCheck the Javadoc for Statement.execute, it will return true if a result set is available. You should just be checking Statement.getUpdateCount()
Steve
-
2. Re: Return result of Statement.execute(sqlstring)
jane_lj Jan 23, 2013 4:28 PM (in response to shawkins)Can you send me a code example for override method UpdateExecution.getupdateCount() in teiid,maybe I'm wrong with this part?
Thanks.
-
3. Re: Return result of Statement.execute(sqlstring)
rareddy Jan 23, 2013 5:05 PM (in response to jane_lj)1 of 1 people found this helpfulJane,
What Steve said above is, when you execute a statement like "Statement.execute("udpate xxx set xxxxx")", it will only be returning the Statement.getUpdateCount(), which indicates how many records have been updated with your update statement.
However if you executed "statement.execute('select * from ....')", which does return a resultset, but you do not know whether you executed the first form above or the second from, the "statement.execute" itself "returns" a boolean. If that return is true, then you can call statement.getResultSet(), if false, then you can only call statement.getUpdateCount()
All this explained in the javadoc for the statement class.
Hope this helps.
Ramesh..
-
4. Re: Return result of Statement.execute(sqlstring)
jane_lj Jan 24, 2013 11:50 AM (in response to jane_lj)Thank you, Steven and Ramesh.