RecordSets, getString and charSets

Started by Rosa Maria Carro Salasover 25 years ago4 messagesgeneral
Jump to latest
#1Rosa Maria Carro Salas
rosa.carro@ii.uam.es

Hello,

I have a problem with recordsets and charsets.

I have inserted some data into a postgresql database including spanish
characters. When I execute pgsql and I run some select queries, I get
the data in the right way, with the spanish characters I inserted.

But when I execute the same queries from a Java program using a JDBC
connection, I obtain different (non-spanish) characters after calling
the getString method to get the data from the recordSet.

I have tried different ways of getting the data from the recordSet, such
as inserting the data into a stream (calling the getAsciiStream,
getUnicodeStream and getBinaryStream methods) and converting the data
into bite[] and then to String, but the same happens.

Does anybody knows what can I do to solve this problem?

Thanks and regards,
Rosa M. Carro

#2Albert REINER
areiner@tph.tuwien.ac.at
In reply to: Rosa Maria Carro Salas (#1)
Re: RecordSets, getString and charSets

Are you sure your Java program is started with the same locale settings?

On Thu, Jan 11, 2001 at 06:11:20PM +0100, Rosa Maria Carro Salas wrote:

Hello,

I have a problem with recordsets and charsets.

I have inserted some data into a postgresql database including spanish
characters. When I execute pgsql and I run some select queries, I get
the data in the right way, with the spanish characters I inserted.

But when I execute the same queries from a Java program using a JDBC
connection, I obtain different (non-spanish) characters after calling
the getString method to get the data from the recordSet.

I have tried different ways of getting the data from the recordSet, such
as inserting the data into a stream (calling the getAsciiStream,
getUnicodeStream and getBinaryStream methods) and converting the data
into bite[] and then to String, but the same happens.

Does anybody knows what can I do to solve this problem?

Thanks and regards,
Rosa M. Carro

--

--------------------------------------------------------------------------
Albert Reiner <areiner@tph.tuwien.ac.at>
Deutsch * English * Esperanto * Latine
--------------------------------------------------------------------------

#3Rosa Maria Carro Salas
rosa.carro@ii.uam.es
In reply to: Rosa Maria Carro Salas (#1)
Re: RecordSets, getString and charSets

Where can I find the postgresql settings and the locale settings?
How can I modify them?
Thanks,
Rosa M. Carro

Albert Reiner wrote:

Show quoted text

Are you sure your Java program is started with the same locale settings?

On Thu, Jan 11, 2001 at 06:11:20PM +0100, Rosa Maria Carro Salas wrote:

Hello,

I have a problem with recordsets and charsets.

I have inserted some data into a postgresql database including spanish
characters. When I execute pgsql and I run some select queries, I get
the data in the right way, with the spanish characters I inserted.

But when I execute the same queries from a Java program using a JDBC
connection, I obtain different (non-spanish) characters after calling
the getString method to get the data from the recordSet.

I have tried different ways of getting the data from the recordSet, such
as inserting the data into a stream (calling the getAsciiStream,
getUnicodeStream and getBinaryStream methods) and converting the data
into bite[] and then to String, but the same happens.

Does anybody knows what can I do to solve this problem?

Thanks and regards,
Rosa M. Carro

--

--------------------------------------------------------------------------
Albert Reiner <areiner@tph.tuwien.ac.at>
Deutsch * English * Esperanto * Latine
--------------------------------------------------------------------------

#4Rosa Maria Carro Salas
rosa.carro@ii.uam.es
In reply to: Rosa Maria Carro Salas (#1)
Re: RecordSets, getString and charSets

Yes, I am.

Albert Reiner wrote:

Are you sure your Java program is started with the same locale settings?

On Thu, Jan 11, 2001 at 06:11:20PM +0100, Rosa Maria Carro Salas wrote:

Hello,

I have a problem with recordsets and charsets.

I have inserted some data into a postgresql database including spanish
characters. When I execute pgsql and I run some select queries, I get
the data in the right way, with the spanish characters I inserted.

But when I execute the same queries from a Java program using a JDBC
connection, I obtain different (non-spanish) characters after calling
the getString method to get the data from the recordSet.

I have tried different ways of getting the data from the recordSet, such
as inserting the data into a stream (calling the getAsciiStream,
getUnicodeStream and getBinaryStream methods) and converting the data
into bite[] and then to String, but the same happens.

Does anybody knows what can I do to solve this problem?

Thanks and regards,
Rosa M. Carro

--

--------------------------------------------------------------------------
Albert Reiner <areiner@tph.tuwien.ac.at>
Deutsch * English * Esperanto * Latine
--------------------------------------------------------------------------

--
Rosa Maria Carro Salas
E.T.S. Informatica (office B-318) e-mail: Rosa.Carro@ii.uam.es
Universidad Autonoma de Madrid phone: +34 1 348 2276
Cantoblanco 28049, Madrid (Spain) fax: +34 1 348 2235