logo       

Re: Big problem inserting Russian characters into Postgres: msg#00127

Subject: Re: Big problem inserting Russian characters into Postgres
Edd,

Check the notes at http://lab.applinet.nl/postgresql-jdbc/#reading

for encoding issues

Dave
On Thu, 2002-05-30 at 12:53, Edd Stanley wrote:
> I have never had a problem that has kept me stumped for so long. All I
> need to do is to simply use my Java application to insert and select
> Russian characters into the Postgres database. Every time I try to
> insert the Unicode characters into the DB, the table seems to only be
> populated with "??????" question mark characters. I am pretty sure that
> the database itself is configured correctly because I can insert Russian
> characters at the SQL command prompt. The database has been "configured"
> with its encoding as Unicode and it says this when I do "\encoding"
>  
> Here is what I do and all I come up with is question marks:
>  
>  
> String URL =
> ("jdbc:postgresql://192.168.0.5:5432/russ?encoding=UNICODE");
> try {
>       new org.postgresql.Driver();
>       db = DriverManager.getConnection(URL, user, pwd);
>     }
> catch (Exception e) { System.out.println("Couldn't connect to the
> database: " +e); }
> }
>  
> String rus_word = "\u0424\u042F\u041B\u0414\u0416\u0436\u0434\u043B";
> //or
> String rus_word = "Ложка";
> String insert_stmt = ("INSERT INTO rus (russian) VALUES('" + rus_word +
> "')"); //Column type for "Russian" is text
>     try {
>       statement = db.createStatement();
>       statement.execute(insert_stmt);
>     }
>     catch (Exception e) {
>::.
>     }
>  
> Shouldn't this be a very simple thing to do as to insert
> multibyte-characters into the database table? What am I forgetting?
>  
> I am running Postgres version 7.2.1, JDK 1.3 using the Postgres JDBC 2.
>  
>  
> Thanks,
> Edd Stanley
> eddstanley @ mindspring . com
>  




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe