Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
Number of rows affected by sql:update
Eman Adenola
Greenhorn
Posts: 27
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am trying to get the number of rows affected by an <sql:update> but it returns an exception
I have the following code
<sql:update dataSource="${datasource}" var="updatereserved"> UPDATE Books SET Reserved = ? WHERE ISBN = ? <sql:param value="Y"/> <sql:param value="${param['ISBN']}"/> </sql:update> <c:if test='${updatereserved.rowCount > 0}'> <font color="green"> Book reserved <br/> You now have ${bookRes} reserved </font> </c:if>
Except it returns an exception saying
javax.el.PropertyNotFoundException: Property 'rowCount' not found on type java.lang.Integer
Any ideas? Thanks
Muhammad Saifuddin
Ranch Hand
Posts: 1325
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<sql:update dataSource="${datasource}" var="updatereserved">
var = updatereserved variable is store the count of affected rows.
Saifuddin..
[Blog]
[Linkedin]
How To Ask Questions On JavaRanch
My OpenSource
Eman Adenola
Greenhorn
Posts: 27
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, yeah but the problem is when i do
updatereserved.rowCount i get an exception, are you suggesting I use the updatereserved variable directly?
Sean Clark
Rancher
Posts: 377
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hey,
As the error says:
javax.el.PropertyNotFoundException: Property 'rowCount' not found on type java.lang.Integer
The object is an integer, so therefore it doesn't have a method called
getRowCount()
.
Sean
I love this place!
Eman Adenola
Greenhorn
Posts: 27
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
oh...yeah..I
I was thinking it returned an object like how a query does..will try it thanks.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JSP + JSTL + SQL
Redirct page in Tilse with JSTL
Problem of insert data into database
jdbc connection in jsp
JSP DataBase Connection
More...