Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot Resolve Symbol: variable rs

843836Aug 27 2003 — edited Aug 27 2003
Hi..!
I'm making a jsp that access a database...
This is my code:
<html>
<%@page import="java.sql.*" %>
<%@page import="javax.sql.*"%>
<%@page import="java.io.*"  %>

<%
         try{        
        
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                Connection cn=DriverManager.getConnection("jdbc:microsoft:sqlserver://192.168.0.8:1433;databasename=my_db;user=<my_user>;password=<my_passwd>");
                Statement st=cn.createStatement();
        
                ResultSet rs=st.executeQuery("SELECT * FROM tbl_bancos where id_bancos='" + request.getParameter("idbanco") + "");
                
        }catch (Exception e){System.err.println(e.getMessage());}
%>
<more_html>
....
</more_html>
//Here is my problem:
The Name of the bank is: <%=rs.getString("nombre_banco")%>
I'm getting the following error on the last line:
cannot resolve symbol [javac] symbol : variable rs

And I don't understand why, 'cause already declared the rs variable...
any help would be appreciated...thanks in advance..
regards,
-eduardo s.m.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2003
Added on Aug 27 2003
4 comments
175 views