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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -