sql - Query in java code is returning null values but its working fine on ODBC query tool -
with
select field2 table1
in odbc query tool list of required values, same query java code list of "null" values.
select field2 table1 field2 not null
didn't help.
field2 - varchar(255)
part of code:
connection conn = drivermanager.getconnection("jdbc:odbc:test"); statement statement = connection.createstatement(); resultset resultset = statement.exequtequery("select field2 table1"); while (resultset.next) system.out.println(resultset.getstring(1));
hm, solution of problem:
while (rs.next()) { system.out.println(ioutils.tostring(rs.getcharacterstream("field2"))); }
p.s. ioutils - class apache commons io p.s.s. .getbytes() - return me 255 symbols (there more symbols, used reader)
Comments
Post a Comment