Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Sabine Dinis Blochberger" Subject: Re: Java Database connect Message-ID: <6PCdnXNrv4-597zUnZ2dnUVZ8v6dnZ2d@novis.pt> X-Comment-To: comp.lang.java.databases Newsgroups: comp.lang.java.databases In-Reply-To: References: Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 56 Date: Wed, 27 Apr 2011 15:23:16 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303917796 96.60.20.240 (Wed, 27 Apr 2011 10:23:16 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:23:16 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.databases:359 To: comp.lang.java.databases Yogi wrote: > On Nov 17, 5:30 pm, Sabine Dinis Blochberger > wrote: > > Yogi wrote: > > > On Nov 17, 2:30 pm, Sabine Dinis Blochberger > > > wrote: > > > > Yogi wrote: > > > > > I am new to java and db connection pooling. I tried using Apache's > > > > > DBCP for connection pool for my web application. Was trying to do > > > > > similar thing for a standalone server (not a web based). I tried > > > > > using DBCP but i am getting strange results. In my string variables, > > > > > i am getting "???" as output whereas for int variables i am getting > > > > > correct values when i m trying to read from database. > > > > > > Make sure you use the correct encoding when connecting to the databse, > > > > for example, UTF-8. Refer to the manual of the database and JDBC driver > > > > for specifics. > > > > This could be only a display problem then - on your other environment > > you don't have the correct locales installed. > > > > I am using Eclipse to execute my program and getting "???" in > Eclipse's console. One of my friend suggested to check for dependent > jars while using Apache's DBCP. But what I am bothered about is, if > dependent jars are not available, it should not give me correct values > for integer placeholders as well. Any comments? If you were missing libraries, you would get an Exception telling you so. Ok, from the Javadocs [0]: "public void print(String s) Prints a string. If the argument is null then the string "null" is printed. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method. Parameters: s - The String to be printed" Instead of using System.out.println, use a logging facility? Or set your environments default character encoding to UTF-8 [1]? [0] [1] --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24