Обсуждение: JDBC DatabaseMetaData problem

Поиск
Список
Период
Сортировка

JDBC DatabaseMetaData problem

От
BCH)姜亦敏
Дата:
Hello,
I have the following problem working with DatabaseMetaData. There is a
database with table and the attribute of 'cont'  is  character. Database cluster was
initialized with appropriate ru_RU.KOI8-R locale. All the databases were
created with utf-8 encoding.
 
I use PostgreSQL-8.2compiled from source, JDBC driver from
 on Linux, J2SDK 1.4.2_12.
update scheduleconttbl set cont ='\xf0\x9f\x99\x8f'
where logindaytime = '20120406142138813';
 
 
 
[28/03/2012 13:55:39:906 +0900] 2012-03-28 13:55:39,905 [com.fujitsu.fasol.intrapartner.common.action.BaseAction]-[ERROR] システムエラーが発生しました:
org.postgresql.util.PSQLException: Invalid character data was found.  This is most likely caused by stored data containing characters that are invalid for the character set the database was created in.  The most common example of this is storing 8bit data in a SQL_ASCII database.
at org.postgresql.core.Encoding.decodeUTF8(Encoding.java:299)
at org.postgresql.core.Encoding.decode(Encoding.java:186)
at org.postgresql.core.Encoding.decode(Encoding.java:206)
at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getString(AbstractJdbc1ResultSet.java:222)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:133)
at com.fujitsu.fasol.intrapartner.common.IntranetResultSet.init(Unknown Source)
at com.fujitsu.fasol.intrapartner.common.IntranetResultSet.<init>(Unknown Source)
at com.fujitsu.fasol.intrapartner.user.schedule.dao.YoteiDao.yoteiSelectP50SQL6(Unknown Source)
at com.fujitsu.fasol.intrapartner.user.schedule.action.Yotei50InitAction.getResultBean(Unknown Source)
at com.fujitsu.fasol.intrapartner.user.schedule.action.Yotei50InitAction.process(Unknown Source)
at com.fujitsu.fasol.intrapartner.common.action.BaseAction.execute(Unknown Source)
at com.fujitsu.fasol.intrapartner.common.IntranetRequestProcessor.processActionPerform(Unknown Source)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:599)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:267)
at com.fujitsu.fasol.intrapartner.common.SetCharacterEncodingFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:389)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:267)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:418)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:292)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2539)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:255)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardHost.invoke(StandardHost.java:1002)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:336)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:161)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:648)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:447)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:917)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
atjava.lang.Thread.run(Thread.java:534)
 
 
 I will appreciate any help with this.

Thank you.


Sincerely yours,
Jiang

Re: JDBC DatabaseMetaData problem

От
dmp
Дата:
BCH)姜亦敏 wrote:
> Hello,
> I have the following problem working with DatabaseMetaData. There is a
> database with table and the attribute of 'cont' is character. Database
> cluster was
> initialized with appropriate ru_RU.KOI8-R locale. All the databases were
> created with utf-8 encoding.
> I use PostgreSQL-8.2compiled from source, JDBC driver from
> on Linux, J2SDK 1.4.2_12.
> update scheduleconttbl set cont ='\xf0\x9f\x99\x8f'
> where logindaytime = '20120406142138813';
> ~
 > ~
> ~
> I will appreciate any help with this.
>
> Thank you.
>
>
> Sincerely yours,
> Jiang

Hello,

I just tried this same update on a table with char type with the input
indicated and it works fine on PostgreSQL 9.0.1 with jdbc-9.0-901.jdbc3.

Perhaps you need to update to a newer version of the database if you are
used the recommended supported version and correlated jdbc has indicated
at http://jdbc.postgresql.org/download.html

Version 8.2 Build 512 and JDBC2 8.2-512 JDBC2 which I think supports
JRE 1.4.

danap.




Re: JDBC DatabaseMetaData problem

От
Dave Cramer
Дата:
Why are you still using 8.2 ?
Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Fri, Apr 6, 2012 at 5:05 PM, dmp <danap@ttc-cmc.net> wrote:
> BCH)姜亦敏 wrote:
>>
>> Hello,
>> I have the following problem working with DatabaseMetaData. There is a
>> database with table and the attribute of 'cont' is character. Database
>> cluster was
>> initialized with appropriate ru_RU.KOI8-R locale. All the databases were
>> created with utf-8 encoding.
>> I use PostgreSQL-8.2compiled from source, JDBC driver from
>> on Linux, J2SDK 1.4.2_12.
>> update scheduleconttbl set cont ='\xf0\x9f\x99\x8f'
>> where logindaytime = '20120406142138813';
>> ~
>
>> ~
>
>> ~
>> I will appreciate any help with this.
>>
>> Thank you.
>>
>>
>> Sincerely yours,
>> Jiang
>
>
> Hello,
>
> I just tried this same update on a table with char type with the input
> indicated and it works fine on PostgreSQL 9.0.1 with jdbc-9.0-901.jdbc3.
>
> Perhaps you need to update to a newer version of the database if you are
> used the recommended supported version and correlated jdbc has indicated
> at http://jdbc.postgresql.org/download.html
>
> Version 8.2 Build 512 and JDBC2 8.2-512 JDBC2 which I think supports
> JRE 1.4.
>
> danap.
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc