0 Replies Latest reply on Aug 5, 2002 3:44 AM by tsangcn

    How to pass an Properties object to get a connection in JBos

    tsangcn

      I have been using Firebird database with UTF8 encoding. In normal JDBC coding, I need to the code the following in order to get a connection object

      Properties props = new Properties();
      props.put("user", "sysdba");
      props.put("password", "masterkey");
      props.put("charSet", "UTF8");
      Class.forName("interbase.interclient.Driver");
      String url = "jdbc:interbase://localhost//home/databases/sample.gdb";
      Connection conn = DriverManager.getConnection(url, props);

      In JBoss 2.4.4, I can define a connection pool with the following in jboss.jcml


      org.hsqldb.jdbcDriver, interbase.interclient.Driver



      SampleDS
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
      charSet=UTF8;user=sysdba;password=masterkey
      jdbc:interbase://localhost//home/databases/sample.gdb
      <!-- sysdba -->
      <!-- masterkey -->
      .....


      Then, it is OK. I can read and write charcters to Firebird in UTF8.

      But when I upgraded to JBoss 2.4.6, the UTF8 is displayed as garbage. To my findings, it seems that JBoss 2.4.6 must have the JDBCUser and Password attributes in jboss.jcml. But when I uncomment the two attributes, it seems that the charSet=UTF8 specify in the Properties attribute is not functioning.

      Why JBoss behave differently with the same jboss.jcml in JBoss 2.4.4 and JBoss 2.4.6? Is this a BUG in JBoss 2.4.6 or I have to make some changes in jboss.jcml in JBoss 2.4.6? If I have to made changes, which changes should I made?

      Then, I have try to upgrade to JBoss 3.0 using FirebirdSQL. I follows the instruction to do configuration. But I can only succeed in doing single byte characters. Those UTF8 characters stored in Firebird is displayed as garbage using the sample application when I used for JBoss 2.4.4.

      So, how to configure a firebird connection pool in JBoss 3.0 in order to support UTF8?

      Thanks a lot for help