@@ -0,0 +1,2284 @@
+/************************************************************************%0A* Title: DeployPoolDataSource.java %0A*%0A* Description: This Program registers a given Pool Connection DataSource%0A*                      with the given JNDI Name registry%0A*%0A* An example of running this program:%0A*%0A* java DeployPoolDataSource CPDS c:%5Ctemp or java DeployPoolDataSource %0A*%0A*************************************************************************/%0A%0Aimport javax.naming.*;%0A%0Apublic class DeployPoolDataSource %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String cpdsname;%0A%09%09String pathname;%0A%09%09%0A%09%09if (args.length == 0)%0A%09%09%7B%0A%09%09%09cpdsname = %22CPDS%22;%0A%09%09%09pathname = %22c:%5C%5Ctemp%22;%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09        if (args.length != 2)%0A%09%09  %7B%0A%09%09    System.out.println(%0A%09%09      %22Usage: RegisterCPDS %3Cname of Datasource%3E %3CName Registry location%3E%22);%0A%09%09    return;%0A%09%09  %7D%0A%09%09  cpdsname = args%5B0%5D;%0A%09%09  pathname = args%5B1%5D;%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(%22%3E%3E%3ERegister DataSource %22 + cpdsname + %22 in %22 + pathname);%0A%09%09%0A%09%09try %7B%0A%09%09%09System.setProperty(Context.INITIAL_CONTEXT_FACTORY,%0A%09%09%09%09%09%22com.sun.jndi.fscontext.RefFSContextFactory%22);%0A%09%09%09System.setProperty(Context.PROVIDER_URL, %22file:%22 + pathname);%0A%09%09%09registerDataSource(cpdsname, new InitialContext());%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09System.out.println(%22Problem with registration%22);%0A%09%09%09e.printStackTrace();%0A%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(%22%3E%3E%3EDone Register%22);%0A%09%7D%0A%09%0A%09private static void registerDataSource(String DSName, Context ctx)%0A%09%7B%0A%09%09// Create a UniJDBCConnectionPoolDataSource Object cpds and Set Its Properties%0A%09%09com.rs.u2.jdbcx.UniJDBCConnectionPoolDataSource cpds = new com.rs.u2.jdbcx.UniJDBCConnectionPoolDataSource();%0A%09%09cpds.setServerHost(%22localhost%22);%0A%09%09cpds.setAccount(%22HS.SALES%22);%0A%09%09cpds.setUser(%22username%22);%0A%09%09cpds.setPassword(%22password%22);%0A%09%09cpds.setUniJDBCCPMMaxConnections(-1);%0A%09%09cpds.setUniJDBCCPMInitPoolSize(0);%0A%09%09cpds.setUniJDBCCPMMinPoolSize(2);%0A%09%09cpds.setUniJDBCCPMMaxPoolSize(8);%0A%09%09cpds.setUniJDBCCPMServiceInterval(100);%0A%09%09cpds.setUniJDBCCPMMinAgeLimit(7200);%0A%09%09cpds.setUniJDBCCPMMinAgeLimit(3600);%0A%09%09%0A%09%09// Register UniJDBCConnectionPoolDataSource Object with Naming Service That Uses JNDI API%0A%09%09try %7B%0A%09%09%09ctx.bind(DSName, cpds);%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09System.out.println(%22Problem with registering the DataSource%22);%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Create DeployPoolDataSource.java