I have something like this in my sql query
private static final String QUERY_PHYSICIAN_INFO= "SELECT * FROM PHYSICIAN_INFO WHERE ? = ?";
but following is not working..
Connection conn = null;
PreparedStatement stmt = null;
String logintype;
if(isInteger(id))
{
logintype="BADGEID";
}else{
logintype="ID";
}
stmt=conn.prepareStatement(QUERY_PHYSICIAN_INFO);
stmt.setString(1, logintype);
stmt.setString(2, id);
ResultSet rs = stmt.executeQuery();
Physician phs = null;
Is there any special reason for this? Thanks in advance.