dataSource.setDescription((String) ref.get("description").getContent()); String s = (String) ref.get("loginTimeout").getContent(); dataSource.setLoginTimeout(Integer.parseInt(s)); return dataSource;
/** * Creates a new object using the specified location or reference * information. * * @param obj the reference (this factory only supports objects of type * javax.naming.Reference) * @param name unused * @param nameCtx unused * @param environment unused * @return the new JdbcDataSource, or null if the reference class name is * not JdbcDataSource. */ //## Java 1.4 begin ## public synchronized Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception { if (trace.debug()) { trace.debug("getObjectInstance obj=" + obj + " name=" + name + " nameCtx=" + nameCtx + " environment=" + environment); } Reference ref = (Reference) obj; if (ref.getClassName().equals(JdbcDataSource.class.getName())) { JdbcDataSource dataSource = new JdbcDataSource(); dataSource.setURL((String) ref.get("url").getContent()); dataSource.setUser((String) ref.get("user").getContent()); dataSource.setPassword((String) ref.get("password").getContent()); String s = (String) ref.get("loginTimeout").getContent(); dataSource.setLoginTimeout(Integer.parseInt(s)); return dataSource; } return null; } //## Java 1.4 end ##
dataSource.setDescription((String) ref.get("description").getContent()); String s = (String) ref.get("loginTimeout").getContent(); dataSource.setLoginTimeout(Integer.parseInt(s)); return dataSource;
dataSource.setDescription((String) ref.get("description").getContent()); String s = (String) ref.get("loginTimeout").getContent(); dataSource.setLoginTimeout(Integer.parseInt(s)); return dataSource;
dataSource.setPassword(""); dataSource.setLoginTimeout(Ints.checkedCast(config.getMaxConnectionWait().roundTo(SECONDS)));
dataSource.setPassword(""); dataSource.setLoginTimeout(Ints.checkedCast(config.getMaxConnectionWait().roundTo(SECONDS)));