1 9 package org.jboss.portal.setup.impl.config; 10 11 import org.jboss.portal.setup.config.DbAccessConfig; 12 import org.jboss.portal.setup.DatabaseVendorType; 13 import org.jboss.portal.setup.PortalSetupException; 14 15 23 public class DbAccessConfigImpl extends ConfigurationImpl implements DbAccessConfig 24 { 25 private String m_driverClassName = "org.hsqldb.jdbcDriver"; private String m_connUrl = "jdbc:hsqldb:test"; private String m_userName = "sa"; 28 private String m_password = ""; 29 private String m_dataSourceName = null; 30 private DatabaseVendorType m_vendor = null; 31 private String m_vendorName = "hsqldb"; 32 33 34 40 public String getDriverClassName() 41 { 42 return m_driverClassName; 43 } 44 45 49 public void setDriverClassName(String driverClassName) 50 { 51 m_driverClassName = driverClassName; 52 } 53 54 58 public String getConnUrl() 59 { 60 return m_connUrl; 61 } 62 63 67 public void setConnUrl(String connUrl) 68 { 69 m_connUrl = connUrl; 70 } 71 72 73 77 public String getUserName() 78 { 79 return m_userName; 80 } 81 82 86 public void setUserName(String userName) 87 { 88 m_userName = userName; 89 } 90 91 95 public String getPassword() 96 { 97 return m_password; 98 } 99 100 104 public void setPassword(String password) 105 { 106 m_password = password; 108 } 109 110 114 public String getDataSourceName() 115 { 116 return m_dataSourceName; 117 } 118 119 123 public void setDataSourceName(String dsName) 124 { 125 m_dataSourceName = dsName; 126 } 127 128 132 public void setDbVendorName(String vendorName) throws PortalSetupException 133 { 134 m_vendorName = vendorName; 135 setDbVendor(vendorName); 136 } 137 138 144 public String getDbVendorName() 145 { 146 return m_vendorName; 147 } 148 149 154 public DatabaseVendorType getDbVendorType() throws PortalSetupException 155 { 156 if (m_vendor == null) 157 { 158 setDbVendor(m_vendorName); 159 } 160 return m_vendor; 161 } 162 163 168 public void setDbVendor(String vendor) throws PortalSetupException 169 { 170 m_vendor = DatabaseVendorType.parseVendorName(vendor, false); 171 } 172 } 173 | Popular Tags |