FileDocCategorySizeDatePackage
JDBCDataSourceMdl.javaAPI DocGlassfish v2 API6000Fri May 04 22:24:16 BST 2007com.sun.enterprise.management.model

JDBCDataSourceMdl

public class JDBCDataSourceMdl extends J2EEManagedObjectMdl

Fields Summary
private static String
MANAGED_OBJECT_TYPE
private String
jdbcDataSourceName
private String
driverName
private boolean
debug
private String
username
private String
password
private String
url
private String[]
propNames
private String[]
propValues
Constructors Summary
public JDBCDataSourceMdl(String dataSourceJndiName, String dataSourceName, String url, String username, String password, String[] propNames, String[] propValues)

    
        
                             
                              
                             
                              
                              
        super(dataSourceJndiName,false,false,false);
        this.jdbcDataSourceName = dataSourceName;
        this.url = url;
        this.username = username;
        this.password = password;
        this.propNames = propNames;
        this.propValues = propValues;
    
public JDBCDataSourceMdl(String dataSourceJndiName, String serverName, String dataSourceName, String url, String username, String password, String[] propNames, String[] propValues)

        super(dataSourceJndiName,serverName,false,false,false);
        this.jdbcDataSourceName = dataSourceName;
        this.url = url;
        this.username = username;
        this.password = password;
        this.propNames = propNames;
        this.propValues = propValues;
    
Methods Summary
public java.lang.StringgetJDBC()
Accessor method for the parent key

		return getname(); //matches name of JDBCResource in this impl
    
public java.lang.Stringgetj2eeType()
The type of the J2EEManagedObject as specified by JSR77. The class that implements a specific type must override this method and return the appropriate type string.

        return MANAGED_OBJECT_TYPE;
    
public java.lang.StringgetjdbcDataSourceName()

        return jdbcDataSourceName;
    
public java.lang.StringgetjdbcDriver()

        if (driverName == null) {
            Set s;
        	try {
            	//System.out.println("getjdbcDriver: jdbcDataSourceName = " + jdbcDataSourceName);
            	java.sql.Driver drv = java.sql.DriverManager.getDriver(jdbcDataSourceName);
            	//System.out.println("java.sql.Driver = " + drv.getClass().getName());
				s = findNames("j2eeType=JDBCDriver,name="+drv.getClass().getName());
        	} catch(java.sql.SQLException e) {
                //XADataSource
                s = findNames("j2eeType=JDBCDriver,name="+jdbcDataSourceName);
        	}

        	Object [] objs = s.toArray();
        	if (objs.length > 0) {
        		String name = ((ObjectName)objs[0]).toString();
        		driverName = name;
        	}
        }
        return driverName;
    
public java.lang.Stringgetpassword()

        return password;
    
public java.lang.String[]getpropNames()

        return propNames;
    
public java.lang.String[]getpropValues()

        return propValues;
    
public java.lang.Stringgeturl()

        return url;
    
public java.lang.Stringgetusername()

        return username;