Re: JDBC Driver Munging My Text?

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Hunter Hillegas'" <lists(at)lastonepicked(dot)com>, "'Postgre JDBC'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC Driver Munging My Text?
Date: 2001-12-21 01:19:10
Message-ID: 006501c189bd$7f00aee0$c201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hunter,

I was unable to replicate the problem. Would it be possible for you to
send a small piece of code that does replicate it?

Here is the code I tried with

PreparedStatement pstmt = con.prepareStatement("insert into
testcomma (id,info,info2,num) values
(nextval('testcomma_id_seq'),?,?,?)");
pstmt.setString(1,"hello, how are you");
pstmt.setString(2,"how are you, today");
pstmt.setInt(3,1);
pstmt.execute()

My table looks like this

create table testcomma (id serial,info text, info2 text,num int);

Dave

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Hunter Hillegas
Sent: Thursday, December 20, 2001 2:38 PM
To: Postgre JDBC
Subject: FW: [JDBC] JDBC Driver Munging My Text?

Forgot to add the list...

------ Forwarded Message
From: Hunter Hillegas <lists(at)lastonepicked(dot)com>
Date: Thu, 20 Dec 2001 09:54:41 -0800
To: <Dave(at)micro-automation(dot)net>
Subject: Re: [JDBC] JDBC Driver Munging My Text?

Sure...

The Java code is like this:

pst = con.prepareStatement("insert into news (rec_num, title, body,
lead_in, location, source, display_order, date_of_entry, entered_by,
active_status) values (nextval('news_seq'), ?, ?, ?, ?, ?, ?, ?, ?,
?)");

The news table looks like this:

CREATE TABLE news (
rec_num integer NOT NULL PRIMARY KEY,
title varchar(255),
body text,
lead_in text,
location varchar(255),
source varchar(255),
display_order integer,
date_of_entry date,
entered_by integer REFERENCES users,
active_status boolean
);

> From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
> Organization: Micro Automation Inc
> Reply-To: <Dave(at)micro-automation(dot)net>
> Date: Thu, 20 Dec 2001 12:52:08 -0500
> To: "'Hunter Hillegas'" <lists(at)lastonepicked(dot)com>, "'PostgreSQL'"
> <pgsql-general(at)postgresql(dot)org>, "'Postgre JDBC'"
> <pgsql-jdbc(at)postgresql(dot)org>
> Subject: RE: [JDBC] JDBC Driver Munging My Text?
>
> Hunter,
>
> Can you provide the insert statement that inserts this
>
> Dave
>
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Hunter Hillegas
> Sent: Thursday, December 20, 2001 11:45 AM
> To: PostgreSQL; Postgre JDBC
> Subject: [JDBC] JDBC Driver Munging My Text?
>
>
> We are seeing some strange behavior in our system that uses Postgres
> 7.1.3 and JDBC. System: Red Hat Linux 7.1/Intel.
>
> Basically what we are seeing is that text stored in a VARCHAR is
> entered like this: "hello, how are you" is stored like this: "hello
> ,how are you". Notice the space and comma being transposed...
>
> The plot thickens...
>
> This is on a new server. The old server, also running 7.1.3, though
> built quite a long time ago, does not exhibit this behavior.
>
> Any ideas? Known bug? Strange config? It is possible that I built the
> JDBC driver on the old machine and just copied it to the new
> machine... I can't remember but it shouldn't matter, should it?
>
> Thanks,
> Hunter
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

------ End of Forwarded Message

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message kmitl 2001-12-21 01:44:42 can not install jdbc
Previous Message Hunter Hillegas 2001-12-20 19:38:28 FW: JDBC Driver Munging My Text?