1 28 29 30 package com.caucho.management.j2ee; 31 32 import com.caucho.sql.DBPool; 33 34 import javax.management.MalformedObjectNameException ; 35 import javax.management.ObjectName ; 36 import java.util.Hashtable ; 37 38 41 public class JDBCDataSource extends J2EEManagedObject { 42 private final DBPool _dbPool; 43 44 public JDBCDataSource(DBPool dbPool) 45 { 46 _dbPool = dbPool; 47 } 48 49 protected String getName() 50 { 51 return _dbPool.getName(); 52 } 53 54 protected ObjectName createObjectName(Hashtable <String , String > properties) 55 throws MalformedObjectNameException 56 { 57 properties.put("JDBCResource", quote(_dbPool.getName())); 58 return super.createObjectName(properties); 59 } 60 61 65 public String getJdbcDriver() 66 { 67 String [] names = queryObjectNames("j2eeType", "JDBCDriver", 68 "JDBCDataSource", getName()); 69 70 return names.length > 0 ? names[0] : null; 71 } 72 } 73 | Popular Tags |