Re: ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-09 Thread Antonio Gallardo
Thomas Dudziak dijo:
> Could you check this with the Postgres folks
> (http://www.postgresql.org/lists.html) ? Perhaps it is best to post a bug
> report there and wait for one of the developers to answer the report.

Thanks for the tip.

I already contacted people on the jdbc list, they send me to the general
list and I suspect they will send me to the bug list.

What a burucratic is the postgreSQL community! I cant believe it. It is
worse than a corporation when you jump from one extension to another
trying to solve your problem. :-(

Anyway I will try to fill all the requirements to got the right people and
try to solve it. ;-)

Best Regards,

Antonio Gallardo.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-09 Thread Thomas Dudziak
Could you check this with the Postgres folks
(http://www.postgresql.org/lists.html) ? Perhaps it is best to post a bug
report there and wait for one of the developers to answer the report.

Tom


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-09 Thread Antonio Gallardo
Good news: This is not a OJB bug, it is a Postgres bug!

Steps to reproduce:

1. create a database using UNICODE (UTF-8):

createdb -E UNICODE mydbname.

2. create a table with some varchar inside, we will query on this field.

CREATE TABLE auth_role
  (
rol_id  int4  not null default
nextval('auth_rol_rol_id_seq'),
rol_namevarchar(50)   unique not null,
rol_enable  boolean   default true,

primary key(rol_id)
  );

INSERT INTO auth_role(rol_name,rol_enable) VALUES ('admin',true);
INSERT INTO auth_role(rol_name,rol_enable) VALUES ('zorro',true);

3. run psql and write:

SELECT * FROM AUTH_ROLE WHERE ROL_NAME LIKE 'z%';

4. You got the error!

ERROR: Invalid UNICODE character sequence found (0xc000)

The problem is related to the string 'z%'.

If you replace the string with 'a%' or za% or any other sequence that does
not contain 'z%" then you don't get the bug.

After all you was right, this is not a OJB related bug! :-D

Since we can also reproduce it using psql. I hoped it was my fault, but
looks like a postgresql bug. :-(

Please confirm the bug.

Best Regards,

Antonio Gallardo

> in psql the "SELECT version();" returns:
>
> PostgreSQL 7.3.4-RH on i386-redhat-linux-gnu, compiled by GCC
> i386-redhat-linux-gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-09 Thread Thomas Dudziak
On Fri, 9 Jan 2004, Antonio Gallardo wrote:

> Please note I can use áéíóú without problem my problem is with the normal
> "z" in lower or upper case.

Your problem is not with the z (which is 007a in unicode). AFAIK unicode
sequence c000 is not a normal character but somewhere between Hangul and
the surrogates (you can view the code charts at 
http://www.unicode.org/charts/).
 
> > You could also use P6Spy to see what the offending SQL was.
> 
> Hmm. I don't know how to use it. :-(

See this FAQ entry:

http://db.apache.org/ojb/faq.html#How%20can%20I%20trace%20and/or%20profile%20SQL%20statements%20executed%20by%20OJB?

Tom



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-09 Thread Antonio Gallardo
Thomas Dudziak dijo:
> Well I'm no expert when it comes to PostgresSQL, but there seems to be
> some problem between PostgresSQL and Java when using unicode. See here:
>
> http://linux.kieser.net/java_pg_unicode.html

Thanks for the link.
>
> Also, PostgresSQL must be compiled with --enable-multibyte.

Of course it is.

>
> Have you tried to specify the charSet in the jdbc url like this :
>
> jdbc:postgresql://[host]/[dbname]?charSet=UNICODE

Yes, I already added this in my repository.xml and don't help.

Please note I can use áéíóú without problem my problem is with the normal
"z" in lower or upper case.

AFAIK, this is not a problem in the postgres.

> BTW this problem does not seem to exist with older (6.5) jdbc drivers.

Not sure. My postgreSQL database is 7.3.4 and was installed from a rpm.
Note we are able to create the database without any problem. We can also
insert fields with "z" and search any string without "z". This is why I
guess the problem is in OJB and not in the driver.

> You could also use P6Spy to see what the offending SQL was.

Hmm. I don't know how to use it. :-(

Best Regards,

Antonio Gallardo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-09 Thread Thomas Dudziak
Well I'm no expert when it comes to PostgresSQL, but there seems to be
some problem between PostgresSQL and Java when using unicode. See here:

http://linux.kieser.net/java_pg_unicode.html

Also, PostgresSQL must be compiled with --enable-multibyte.

Have you tried to specify the charSet in the jdbc url like this :

jdbc:postgresql://[host]/[dbname]?charSet=UNICODE 

BTW this problem does not seem to exist with older (6.5) jdbc drivers.

You could also use P6Spy to see what the offending SQL was.

Tom



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ERROR: Invalid UNICODE character sequence found (0xc000)

2004-01-08 Thread Antonio Gallardo
Hi:

I am getting this error while quering a simple table in a PostgreSQL
database.  Interesting enough the error does not happen when we access the
database using other JDBC application.

The database was coded using:

createdb -E UNICODE myDBname

If I sent in the following code the variable filtro with "z" or "Z" it
throws an exception.

The problem occurs at this line:

Iterator qIter = broker.getIteratorByQuery(query);

The Java code is:

public void getList(Auth_userList bean, String filtro) throws Exception {
  PersistenceBroker broker = null;

  try {
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
// Define criterio
Criteria criterio = new Criteria();
if (filtro.length() > 0)
  criterio.addLike(FILTRO, filtro + "*");
criterio.addNotEqualTo(FILTRO, "admin");
criterio.addOrderBy(FILTRO, true);

Query query = new QueryByCriteria(Auth_user.class, criterio);
Iterator qIter = broker.getIteratorByQuery(query);

while (qIter.hasNext()) {
  Auth_user temp = new Auth_user();
  PropertyUtils.copyProperties((Object)temp, (Object)qIter.next());
  bean.add(temp);
}
  } catch (Exception e) {
throw e;
  } finally {
if (broker != null && !broker.isClosed()) {
  broker.close();
}
  }
}

Here is the full exception:

Note: The same apply for the drivers:

pg73jdbc.jar
pg74jdbc.jar
pg74.1jdbc.jar

Please explain.

Best Regards,

Antonio Gallardo

at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
Source)
at org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
Source)
at org.apache.ojb.broker.accesslayer.RsIterator.(Unknown Source)
at
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown
Source)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unknown
Source)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknown
Source)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorByQuery(Unknown
Source)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getIteratorByQuery(Unknown
Source)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getIteratorByQuery(Unknown
Source)
at test.miclassAuth_userHandler.getList(Auth_userHandler.java:81)

..

Caused by: java.sql.SQLException: ERROR:  Invalid UNICODE character
sequence found (0xc000)

at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at
org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:153)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]