Re: retrieve data from the db2400



Hi,
column must be character, so you must use getString
the output seems to be binary, looks like CCSID 65xxx (transparent data)
have alook at the driver properties, this could be changed there.

Dieter Bender

savita wrote:

Hello All,

I am new to jsp.

I have table F0006LZ in as400.This table has column MCMCU , which
contains following values

MCMCU

M1
92821
92822
92823
92824
92825
92826
92827
92828
92829

COde written in jsp as follows:


Class.forName("com.ibm.as400.access.AS400JDBCDriver")
Connection
conn=DriverManager.getConnection("jdbc:as400:192.168.0.10","xxx","xxx");
PreparedStatement stat=conn.prepareStatement("SELECT MCMCU FROM
HTPL.F0006LZ");
ResultSet rs=stat.executeQuery();
if(rs.next())
{
out.println(rs.getString("MCMCU"));
}



On the webpage I am getting the output
40404040404040404040D4F1

If I write the following code rs.getInt("MCMCU");

if(rs.next())
{
out.println(rs.getInt("MCMCU"));
}

The output is
Errorjava.sql.SQLException: Data type mismatch.

How do I access value from the COlumn MCMCU which consists of
character and integer value?
I new to as400, I do not know the column index of MCMCU

The query SELECT MCMCU FROM HTPL.F0006LZ works in as400.

Thanks

.



Relevant Pages

  • Re: retrieve data from the db2400
    ... I am new to jsp. ... I have table F0006LZ in as400.This table has column MCMCU, ... PreparedStatement stat=conn.prepareStatement("SELECT MCMCU FROM ... Toolbox jdbc driver translate EBCDIC characters to Unicode strings ...
    (comp.lang.java.databases)
  • Retrieve value from as400 though jsp
    ... I am new to jsp. ... I have table F0006LZ in as400.This table has column MCMCU, ... PreparedStatement stat=conn.prepareStatement("SELECT MCMCU FROM ... The query SELECT MCMCU FROM HTPL.F0006LZ works in as400. ...
    (comp.lang.java.programmer)
  • retrieve data from the db2400
    ... I am new to jsp. ... I have table F0006LZ in as400.This table has column MCMCU, ... PreparedStatement stat=conn.prepareStatement("SELECT MCMCU FROM ... The query SELECT MCMCU FROM HTPL.F0006LZ works in as400. ...
    (comp.lang.java.databases)