|
Hi Tahir ,
First of all I thank you a lot for so much of support and
pointer you have given to me ,
The problem is I think not of database driver , which you
will unserstand from the flow of data from first point to last point I am
attaching in the doc.
There is somthing with POI,
becasue I happen to get the samed data entered into
database once using both text and xls upload it happned when
I used in my text parser
csvReader_ = new BufferedReader(new
InputStreamReader(new FileInputStream(filename)));
instead of
//csvReader_ = new BufferedReader(new InputStreamReader(new
FileInputStream(filename),"ISO-8859-1"));
In this case the data entered into database was
same for both xls parser and text parser
Thanks
Regrads
Birendar S Waldiya
From: Tahir Akhtar [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 09, 2006 2:28 PM To: 'Birendar Waldiya' Subject: RE: Major Problem With POI Excel reader: Urgent Help Needed Birendar, This now proves that
your problem is not related to POI in anyway. You application successfully gets
the data from POI in Java’s default encoding i-e UTF-16.
Perhaps your database
driver is expecting a different encoding by default. You will have to check
documentation of database and the driver you are using to see whether and how it
supports the required encoding. I feel that most modern databases and drivers
will have no problem in handling your characters if configured correctly.
Is your text based application is using the same database and drivers? Is
anything different in the way connection/statements are created
etc. You must now focus on
the database and database connectivity to resolve your
problem. Regards, Tahir
Akhtar From: Birendar
Waldiya [mailto:[EMAIL PROTECTED] Hi Tahir,
My eclipse is running
on WINDOWS and the webserver i am using is TOMACT on
local , where in the unix mean that my WebSpeher server
which is running on UNIX platfrom , I did simple thing now
: removed all my customed encoding : with my xls parser
DID System.out of
the queries generated , on my Eclipse they are correctly generated and when i
copy it into my text file still remain
ok, Manually copying and
executing : 1. I executed the query
in my UTF-8
database where the data get inserted as
"¿¿¿¿"
2. I executed this
query inot my database which is NOT UTF-8 the
data is inserted correctly."ŠšŽž" By Application
: 1. in my
UTF-8
database where the data get inserted as
"¿¿¿¿"
2. In my the
data inserted by my applications executes by self inserts
it " `a}~" thanks
regrads
Birendar S Waldiya
From: Tahir
Akhtar [mailto:[EMAIL PROTECTED] Hi
Birendar, You are getting it
correct on eclipse console but not unix console. Are you running eclipse on unix
or windows? By unix console do you mean that your web-app-server running on unix
server. What happens if you directly put data on database from eclipse i-e
run the app direct from eclipse without deploying to wep-app-server etc.
I recommend: remove all
custom handling of encoding and comparing the eclipse and unix output. If you
are getting something different on both instances then you have almost nabbed
the problem. P.S Java handles all
the string internally as UTF-16 so I think JDBC drivers would expect the same
encoding by default. They would translate as necessary for target database. Also
note that it is quiet possible that the particular encoding supported by your db
does not support the characters in question. Regards, Tahir From: Birendar
Waldiya [mailto:[EMAIL PROTECTED] Hi Tahir,
I have done all the
activities , the character on my eclipse console are printed as such, however in
unix console they look differ for xls uplaod. The
"cell.setEncoding(HSSFCell.ENCODING_COMPRESSED_UNICODE); " one i did
as a last resort though i knew this is not right to do it here. still in
a *HOPE* if it works From the code you might
have seen that I have tried to chage the encoding to ISO-8859-1 , UTF-8 extra
etc etc Let me tell
you what all I have done 1. First I tried to
simply read the string cell as its avaliable into a string then try using
String.getBytes("encoding") -values tries are
"ISO-8859-1,ISO-8859-10,ISO-8859-13,UTF-8 " - this didnt worked
. 2. Then I tried to
chage the encodign of the xls file while saving : as western (ISO) , then
tried to save it as "UNICODE", then I tried to save it as "UTF-8" it didnt
worked 3. Then I tried to
change the NLS_LANG parameter it didnt worked , 4. Then I tried to
insert this data in a different databse that is UTF-8 , with
String.getByets("UTF-8") this case works .. but my databse is right
now not set to UTF-8 5. Finally I tried
cell.setEncoding(HSSFCell.ENCODING_COMPRESSED_UNICODE);
cell.setEncoding(HSSFCell.ENCODING_UTF_16); this dosnt works
The greatest problem
is with text uplaod it working fine for thease mentioned character , which
let me puzzled a lot . BTW can you
please send the URL fro downloading poi jar ? If any one in forun had
ever faced this problem please guide me . Thanks
Regards
Birendar S
Waldiya From: Tahir
Akhtar [mailto:[EMAIL PROTECTED] Hi
Birendar, As I told you before, I
do not have any experience of using exotic character sets. Here are my best
guesses however:
Looking at the
archives, I would guess that encoding of source excel file would be set
depending on the default encoding on the system where file was created.
I hope someone with
more experience with encoding and poi would be able to give you better
pointers Regards, Tahir From: Birendar
Waldiya [mailto:[EMAIL PROTECTED] Hi Tahir,
Thank you for your response in
regards to the problem I have posted to forum,
The details of probelms are as
foollow : I am trying to read data from - 1. Text File : Using a text file
parser that reads data from
FileStreamReader 2. XLS file : This reads the
data from InputStream loade to the
POIFSFileSystem When using text uplaod : this
workign very fine and no problem with the characetr mentioned
Š, š, Ž, ž
they go file and look fine in
database, But when I am using the xls
uplaod the aboce characters does not get dispaled correctly.
I have tried to chage the
cell encoding , tried to chage the string by String.getBytes("encoding") ,
tried to save xls file as UNICODE, UTF-8, Defualt ISO and all short of
things i can thing but thease characetr doent get reflected into datase
correctly. What can be done for
getting charcters correctly?, My FRD is full of mention of thease
charactrer they are not at all bother abot other characetr and they
will test onlt tease characetr . Attaching the code
that reads data from xls file Your help and guidance will
be of great use for me Thanks a lot agian , leaset
you replied . regards
Birendar S
Waldiya Birendar, -- -- -- -- -- -- |
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
