4 Replies Latest reply on Sep 14, 2012 10:44 AM by sfcoy

    setting UTF-8 encoding for JBOSS AS 7 Connection Pool

    smswamy

      Hi,

           We have some chinese characters in DB. 

           If I use normal JDBC connection I am able to see the characters proper.

           If I use oracle JDBC Connection Pool in JBOSS AS 7.1.1 Final, I am not able to get those characters. For those characters it is displaying as "?"

       

                          <connection-property name="char.encoding">

                              UTF-8

                          </connection-property>

       

      I added the above property, still its showing the same "?"..

       

      Please let me know what other property I need to set for Connection Pool.

      Thanks

        • 1. Re: setting UTF-8 encoding for JBOSS AS 7 Connection Pool
          nickarls

          On the same host? Do you have a NLS_LANG setting? What does "select * from NLS_SESSION_PARAMETERS;" show on a jdbc connection and what does it show on a connection from the pool?

          • 2. Re: setting UTF-8 encoding for JBOSS AS 7 Connection Pool
            jaikiran

            And when you say "it's still showing the same ?" What exactly do you mean by "it" and where is it "showing"? Are you talking about the data in the database or some log files or some web page?

            • 3. Re: setting UTF-8 encoding for JBOSS AS 7 Connection Pool
              smswamy

              Sorry, for all, its my mistake. I was looking from the console of eclipse. It was always showing as ???. I debugged the data, when the data is retrieved in the result set it was coming as proper with UTF-8 encoding. After that while writting into eclipse console it was creating issue. I made it to write into a file with UTF -8 encoding and things are fine.

               

              I removed the connection-property in the jboss standalone.xml and still things are coming up fine. Is JBOSS AS 7.1 default support UTF-8 encoding ?

               

              I checked the parameters in NLS_SESSION_PARAMETERS and it was proper setting for UTF-8.

               

              Still not sure how to set the UTF-8 encoding for the eclipse console. Thanks.

              • 4. Re: setting UTF-8 encoding for JBOSS AS 7 Connection Pool
                sfcoy

                SMS JBOSS wrote:

                 

                ...

                 

                Still not sure how to set the UTF-8 encoding for the eclipse console. Thanks.

                 

                Preferences -> General -> Workspace

                 

                Look for "Text file encoding" at the bottom.