Click here to Skip to main content
13,588,811 members
Rate this:
 
Please Sign up or sign in to vote.
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.

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 4-Dec-12 8:15am
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.180615.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100