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)
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)