Click to See Complete Forum and Search --> : JSP SESSIONS
maklawski
April 17th, 2002, 10:13 AM
I am in the midst of a crash course in JSP, and I have created a form on a jsp page with drop-down menu selections. The user selections are used to build a query string, and i wish to display the results in a table within the jsp page. I am trying to set the user selections to session attributes, pass those attributes to a processevent.jsp page, and return a recordset back to the callingpage...can this be done???
Any help would be greatly appreciated!!!!
Thanks
Maklawski
[i]MakLawski[i]
Manish Malik
April 17th, 2002, 06:29 PM
I see no problem with the logic. Where are you finding trouble?
Manish
http://www.manishmalik.com
Discuss it all at the Developer Forum : http://www.codeguru.com/cgi-bin/bbs/wt/wwwthreads.pl?action=list&Board=devforum ...
maklawski
April 18th, 2002, 12:34 PM
My stumbling block today is the syntax in setting the session expression to a variable.
i.e.
This statement prints the value of "thename" onscreen
// Hello, <%= session.getAttribute( "theName" ) %>
I want to set the value of "mysql" to ss_sql and plug the query into my connection statement. but so far, i haven't seen any documentation for this, and haven't hit the right combination of syntax/luck.
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection com = DriverManager.getConnection("jdbc:odbc:myserver jsp downloads","myserver","myserver");
Statement st = com.createStatement();
//this is the problem statement
String ss_sql = (String) <%=session.getAttribute("mysql") %>
ResultSet os = st.executeQuery(ss_sql);
%>
thx for your response manish malik!
[i]MakLawski[i]
Manish Malik
April 18th, 2002, 06:06 PM
Replace
String ss_sql = (String) <%=session.getAttribute("mysql") %>
with
String ss_sql = (String) session.getAttribute("mysql")
and check.
Manish
http://www.manishmalik.com
Discuss it all at the Developer Forum : http://www.codeguru.com/cgi-bin/bbs/wt/wwwthreads.pl?action=list&Board=devforum ...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.