java.sql.ResultSet.getString()给分 

解决方案 »

  1.   

    getString 可访问大部分的类型,
    public String getString(int columnIndex)
                     throws SQLException
    Gets the value of the designated column in the current row of this ResultSet object as a 
    String in the Java programming language.
      

  2.   

    如果字段是NULL,那么可能会有NullPointerException
      

  3.   

    我觉得是那样的,因为好多例子实现你说的功能都用了ResultSetMetaData类,这个类中有专门的方法去判断字段的类型,然后再根据类型去写对应的访问方法
      

  4.   

    要么不检查用getstring方法,到外面应用的时候在转,要么已经知道类型,用适当的.
    要么用想ge_yc的方法.