Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Retrieve value from as400 though jsp

Reply
Thread Tools

Retrieve value from as400 though jsp

 
 
savita
Guest
Posts: n/a
 
      03-24-2007
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
92830


COde written in jsp as follows:


Class.forName("com.ibm.as400.access.AS400JDBCDrive r")
Connection
conn=DriverManager.getConnection("jdbc:as400:192.1 68.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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jsp and AS400 savita.raskar@gmail.com Java 0 03-17-2007 01:43 PM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
Re: AS400 And ADOx Cor Ligthert ASP .Net 0 09-14-2004 03:50 PM
asp.net oledb command parameter error calling an as400 program Manuel Arroba ASP .Net 0 06-28-2004 09:50 AM
DB_E_BADPROPERTYVALUE error when connecting to AS400 db2 udb =?Utf-8?B?RC5TYXJhdmFuYW4=?= ASP .Net 0 06-18-2004 10:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57