getChars problem
Hi all, I'm having an issue extracting the first 11 characters from a 14 character string (read in from a DB2 database) using the getChars method. Here's the code:
String s = (rs.getString("partition_name"));
System.out.println("original string: " + s);
int start = 1;
int end = 11;
char newpart[] =newchar[end - start];
s.getChars(start, end, newpart, 0);
System.out.println("new string: " + newpart);
And this is the output:
original string: TB_1538418432_384
new string: [C@533760a8
The output I'm expecting is:
new string: TB_1538418432_
(i.e. the first 11 characters of a 14 character string).
I'm suspecting this is something to do with a mismatch between a database (DB2) that deals in one type of Unicode characters, and a system (UNIX) that deals with another.
However, if anyone can see a flaw in the code, please let me know - otherwise, if it looks OK and anyone thinks this is something to do with incompatible Unicode types, any advice on how to get around that would be hugely welcomed!
TIA.

