Hi Friends,
I am having problem with the above code snippet. Initially it woked fine. But now it is giving an error of java.sql.SQLException: ORA-01722: invalid number.
How can I resolve the exception?
Thanks.
try
{ String ein=(String)session.getAttribute("EIN");
System.out.println("inside try block");
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbc:oracle:thin:@10.9.16.2:1521:TESTDB","HE","HE123");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select distinct REV_OWNER from FBD_USER_AUTHENTICATION where user_ein="+ein+"") ;
System.out.println("after executing the query");
while (rs.next())
{ j=j+1;%>
<tr><td align="center"><font size="default" color="indigo">
<%=rs.getInt("rev_owner")%></font></td>
<td align="center"><input type="checkbox" name="check" value="<%=rs.getInt("rev_owner")%>"></tr>
<%} %>
</table>
<table width="50%" align="center" border="1" rules=ALL>
<tr><td align="center"><input type="submit" name="b1" value="Delete" class="btn"></td></tr>
<input type="hidden" name="recordcount" value="<%=j%>">
</table>
</form>
<% if (!(con == null) || !con.isClosed())
{
con.close();
}
} catch (Exception e1) {
System.out.println("Error--->"+e1.toString());
out.println("Error Detected----->"+e1.toString());
if (!(con == null) || !con.isClosed())
{
con.close();
}
} %>