1 14 15 package org.quickserver.util.xmlreader; 16 17 import org.quickserver.net.server.QuickServer; 18 24 public class DatabaseConnectionConfig implements java.io.Serializable { 25 private String id = ""; 26 private String driver = ""; 27 private String url = ""; 28 private String username = ""; 29 private String password = ""; 30 31 35 public String getId() { 36 return id; 37 } 38 43 public void setId(String id) { 44 if(id!=null) 45 this.id = id; 46 } 47 48 52 public String getDriver() { 53 return driver; 54 } 55 60 public void setDriver(String driver) { 61 if(driver!=null) 62 this.driver = driver; 63 } 64 65 69 public String getUrl() { 70 return url; 71 } 72 77 public void setUrl(String url) { 78 if(url!=null) 79 this.url = url; 80 } 81 82 86 public String getUsername() { 87 return username; 88 } 89 94 public void setUsername(String username) { 95 if(username!=null) 96 this.username = username; 97 } 98 99 103 public String getPassword() { 104 return password; 105 } 106 111 public void setPassword(String password) { 112 if(password!=null) 113 this.password = password; 114 } 115 116 120 public String toXML(String pad) { 121 if(pad==null) pad=""; 122 StringBuffer sb = new StringBuffer (); 123 sb.append(pad+"<database-connection>\n"); 124 sb.append(pad+"\t<id>"+getId()+"</id>\n"); 125 sb.append(pad+"\t<driver>"+getDriver()+"</driver>\n"); 126 sb.append(pad+"\t<url>"+getUrl()+"</url>\n"); 127 sb.append(pad+"\t<username>"+getUsername()+"</username>\n"); 128 sb.append(pad+"\t<password>"+getPassword()+"</password>\n"); 129 sb.append(pad+"</database-connection>\n"); 130 return sb.toString(); 131 } 132 } 133 | Popular Tags |