Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How JSP diplay Chinese

Status
Not open for further replies.

neltan

Programmer
Nov 4, 2002
82
AU
Hi,
I've difficult in displaying Chinese on JSP. Can somebody help? My project has stucked for long long time :(

Thank you!

======================================================================

public String getChinese(String col_name) throws Exception{
try{
byte[] str_bytes = new byte[200];
InputStream str_stream = rs.getBinaryStream(col_name);
if(str_stream != null)
{
str_stream.read(str_bytes);
}
return String(str_bytes);

}catch(Exception e){Debug.println("Error in getChinese().");Debug.println(123);return "Error in getting Chinese";}
}

========================================================================

java.lang.NullPointerException
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.Connection.ExecSQL(Connection.java:381)
at org.postgresql.Connection.getSQLType(Connection.java:1111)
at org.postgresql.Connection.getPGType(Connection.java:1176)
at org.postgresql.Field.getPGType(Field.java:93)
at org.postgresql.jdbc2.ResultSet.getBytes(ResultSet.java:332)
at org.postgresql.jdbc2.ResultSet.getBinaryStream(ResultSet.java:526)
at org.postgresql.jdbc2.ResultSet.getBinaryStream(ResultSet.java:638)
at appl_user.rs_Bean.getChinese(rs_Bean.java:63)
at org.apache.jsp.JSP1_jsp._jspService(JSP1_jsp.java:86)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top