Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, The problem is Code is working when
rs.getString<br />
(1) is integer number, but in my case it's a varchar primary key , how to fix this.

Java
function getId(id){
    var f=document.form;
    f.method="post";
    f.action='SelectBank1.jsp?id='+id;
    f.submit();
}

<%
Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select IdwhichIsVarchar, description from  SomeDataBase where IS_VISIBLE = 1 order by description  ");
%>

<%
while(rs.next()){
%>
<tr><td><%=rs.getString(2)%></td>

<td><input type="button" name="edit" value="Edit" style="background-color:green;font-weight:bold;color:white;" onclick="getId(<%=rs.getString(1)%>);" ></td>
</tr>
<%
}
%>
Posted
Updated 4-Dec-12 8:52am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900