1 30 31 32 package org.hsqldb.jdbc; 33 34 import java.util.Hashtable ; 35 36 import javax.naming.Context ; 37 import javax.naming.Name ; 38 import javax.naming.Reference ; 39 import javax.naming.spi.ObjectFactory ; 40 41 43 50 public class jdbcDataSourceFactory implements ObjectFactory { 51 52 68 public Object getObjectInstance(Object obj, Name name, Context nameCtx, 69 Hashtable environment) throws Exception { 70 71 String dsClass = "org.hsqldb.jdbc.jdbcDataSource"; 72 Reference ref = (Reference ) obj; 73 74 if (ref.getClassName().equals(dsClass)) { 75 jdbcDataSource ds = new jdbcDataSource(); 76 77 ds.setDatabase((String ) ref.get("database").getContent()); 78 ds.setUser((String ) ref.get("user").getContent()); 79 ds.setPassword((String ) ref.get("password").getContent()); 80 81 return ds; 82 } else { 83 return null; 84 } 85 } 86 } 87 | Popular Tags |