我把Oracle查询结果赋值给Int型变量,但是编译时,却无法识别,这时为何? 在线等急 
程序代码如下:      int thjx; 
     int mesjx; 
     int netjx; 
String shoppingjxSql="select * from tb_shopping_score where phonenum='"+mobile_customer_phonenum+"'"; 
         rs = dbconn.executeQuery(shoppingjxSql); 
         while(rs.next()) 
         {  
thjx=Integer.parseInt(rs.getString("th_score"));//获得剩余通话积分 
          mesjx=Integer.parseInt(rs.getString("mes_score"));//获得剩余短信积分 
           netjx=Integer.parseInt(rs.getString("net_score"));//获得剩余梦网积分 

 <td width="60" > 
        <%=thjx%> 
        </td> 
         
        <td width="60"><%=mesjx %> 
        </td> 
        <td width="60"><%=netjx %> 
        </td>    
这里面thjx,mesjx,netjx三变量都未被识别,何解? 

解决方案 »

  1.   

    看不出什么问题,最好先对int变量初始化看看吧
      

  2.   

    int thjx; 
        int mesjx; 
        int netjx; 
    加public属性
      

  3.   

    先初始化一下试试看"
    rs.getInt("th_score")可以直接用;
    我自己写的一个简单的select操作你可以看看:
    http://blog.oracle.com.cn/index.php/76292/viewspace-30567.html
      

  4.   

    用getint32,別用getstring。楼主再試下