Hi All,
i am writing an application in which i am creating web services. i am creating an operation(method) which retrieves database table values from database table in resultset. Hence we can't return resultset value directly in web services. i am creating a class which holds the values from resultset. instead of resultset i am returni...
I have a method in dao class called "getDetails". In this method, I union the two select statments from two tables with almost same field called "main shop" & "sub shops" and put those queries to preparedstatement. Then I put the preparedStatement to resultSet.
This "getDetials" method return "details" and I'll use it into another metho...
Dear All,
I have one query that returns string value, my query is
select case when (select count (distinct style_packing_spec_id) from packing_spec_uses_pack p,style_pack sp where sp.style_pack_id=p.style_pack_id and sp.style_id=1701) != (select count (distinct style_packing_spec_id) from style_packing_spec where style_id=1701) then 'D...
Having rs, an instance of java.sql.ResultSet, how to check that it contains a column named "theColumn"?
...
I have a sql query fired in my model class which returns a table of user data. Now i need to display the result on my view page (JSP). I don't want to fire the sql from JSP page. How do i pass of the result set to JSP? do i need to construct a collection set and pass it on to the JSP or is there any better way to do it?
Thanks,
-Vijay
...
I'd like to pass out a result set from a function that executes a query and closes the connection.
But the ResultSet gets invalidated as soon as its parent Connection is closed and throws "java.sql.SQLException: Operation not allowed after ResultSet closed". How to avoid this?
...
i have a mysql result set like bellow
id name
---------------------
1 abc
1 abc
2 xyz
2 xyz
3 pqr
now i need to modify the result set so that it would be like as follows:
id name
---------------------
1 abc-1
1 abc-2
2 xyz-1
2 xyz-2
3 pqr
...
Resultset rs=stmt.executeQuery("select count(*) from feedsca group by score order by score");
Using the above java code above, am retrieving the counts of rows from the table named feedsCA.
While trying to retrieving the counts using rs.getInt(1),rs.getInt(2),rs.getInt(3), I end with an error saying as below,
Exception in thread "mai...