× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi
This is what i do,
i use ibatis to run sql query, this is all on AS400
<select id="getTC1100"
resultClass="com.myclass.TC1100"
parameterClass="java.math.BigDecimal">
SELECT * FROM TC1100 WHERE T100GSEQ = #value#
</select>

This will return a List<TC1100>
which i loop through
TransactionRecord [] transactionRecords = new TransactionRecord[list.size()];
for(int i =0, size = list.size();i < size; i++)
{
TC1100 tc1100New = list.get(i);
TransactionRecord transactionRecord = new TransactionRecord();
transactionRecord.setTransactionData(new String(tc1100New.getTRANSACTION_DATA().getBytes("UTF-8")));
transactionRecords[i]= transactionRecord;
}
syncLotInfo.setTransactionRecords(transactionRecords);
// create XML file using castor
Writer writer = new FileWriter(file);
Marshaller.marshal(syncLotInfo, writer);

// this file has proper encoding


// then i call web service
ExecutePortTypeBindingStub stub = new ExecutePortTypeBindingStub(new URL(endPoint), null);

stub.syncLotInfo(syncLotInfo);


and in my web service i do

Writer writer = new FileWriter(file);
Marshaller.marshal(syncLotInfo, writer);
// this xml file in web service does not have proper japanese characters
List<TransactionRecord> list = syncLotInfo.getTransactionRecord();

for(TransactionRecord tran:list)
{
// insert here in database.also has ???????
}


A$HI$H


--- On Thu, 10/30/08, Thorbjørn Ravn Andersen <ravn@xxxxxxxxxx> wrote:

From: Thorbjørn Ravn Andersen <ravn@xxxxxxxxxx>
Subject: Re: Read Japanese characters using JDBC
To: "Java Programming on and around the iSeries / AS400" <java400-l@xxxxxxxxxxxx>
Date: Thursday, October 30, 2008, 3:18 AM
Ashish Kulkarni skrev:
Hi
I have this java program running on AS400, when i try
to run this program on i PC and put it in debug, i get ?????
for Japanese data, i am using eclipse for java program
development
I run this java program native on AS400, and use tool
box JDBC driver along with ibatis to read data from tables
I create a java object and then call a web service as
this java object as input.
When i create XML file from the java object, it has
correct japanese characters, but when i check this java
object in web service it has ??????? as data.



Sounds like a character encoding issue. How do you flatten
your
objects? Code please.
--
This is the Java Programming on and around the iSeries /
AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.