Problems with returning a variable from a JavaBean to a JSP page
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Iain_Kerr
Posted On:   Tuesday, August 13, 2002 08:56 AM


I have written a java bean to perform queries. I am
trying to return the ResultSet variable back to the main JSP page but I get the following error

			
Incompatible type for declaration. Can't convert java.lang.String to java.sql.ResultSet. ResultSet SQLResult = mybeanidy.getSQLQuery();

Any Clues as to what Im doind wrong?

Heres the tag I use

			
<%ResultSet SQLResult = mybeanidy.getSQLQuery();%>


The getSQLQuery returns a value of type java.sql.ResultSet

Re: Problems with returning a variable from a JavaBean to a JSP page

Posted By:   Erik_Runia  
Posted On:   Tuesday, August 13, 2002 12:59 PM

Hello, you need to cast it into its original type, like so:




<%
ResultSet SQLResult = (ResultSet) mybeanidy.getSQLQuery();
%>


Hope this helps,


Erik

About | Sitemap | Contact