i m running mysql 5.5 with mysql 5.1.18 connector. a simple query of style
<0> 编码>从我的桌子(aaa , bbb ,...)和b=1栏()。
在java申请中执行。 查询结果为25千分之八。 阅读时的成绩
while(rs.next())
{
MyObject c= new MyObject();
c.setA(rs.getString("A"));
c.setB(rs.getString("B"));
c.setC(rs.getString("C"));
...
}
a 以下例外情形通常在第一 lo期间,但从未在同一行:
java.lang.NullPointerException
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5720)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5570)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5610)
i 研究了ResultSetImpl.java:5720的源代码,并参看:
switch (metadata.getSQLType())
元数据
Field metadata = this.fields[internalColumnIndex];
and getSQLType is a logic-less getter returning an int. what s interesting, is that the same metadata object is called numerous times several lines above with other getters, and throws no exceptions.
btw, there is no problem with the query above while ran directly within mysql. application runs in aws.
any ideas how to solve this? thanks.