2 Replies Latest reply on Dec 7, 2004 11:34 AM by Scott Stark

    Adding additional properties to postgres-ds.xml

    beyarecords Novice

      Hi,
      I have specified my postgres-ds.xml file as so:

      <datasources>
       <local-tx-datasource>
       <connection-url>jdbc:postgresql://localhost:5432/test?ssl=true</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>*</user-name>
       <password>*</password>
       <max-pool-size>10</max-pool-size>
      
       <metadata>
       <type-mapping>PostgreSQL 7.2</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      


      and I need to add the additional properties, which in java would say:


      String url = "jdbc:postgresql://localhost/test";
      Properties props = new Properties();
      props.setProperty("user","*");
      props.setProperty("password","*");
      props.setProperty("ssl","true");
      props.setProperty("javax.net.ssl.trustStore", cacert);
      props.setProperty("javax.net.ssl.trustStorePassword","changeit");
      
      Connection conn = DriverManager.getConnection(url, props);
      


      So, in my xml file I need to say something like:

       <javax.net.ssl.trustStore>/library/java/home/lib/security/cacert</javax.net.ssl.trustStore>
       <javax.net.ssl.trustStorePassword>changeit</javax.net.ssl.trustStorePassword>
      


      Can this be done?

      many thanks

      Andrew