Re: retrieve data from the db2400
- From: Dieter Bender <dieter.bender@xxxxxxxxxxx>
- Date: Sat, 24 Mar 2007 10:31:18 +0100
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
.
- References:
- retrieve data from the db2400
- From: savita
- retrieve data from the db2400
- Prev by Date: retrieve data from the db2400
- Next by Date: Re: retrieve data from the db2400
- Previous by thread: retrieve data from the db2400
- Next by thread: Re: retrieve data from the db2400
- Index(es):
Relevant Pages
|
|