15 * You should have received a copy of the GNU General Public License |
15 * You should have received a copy of the GNU General Public License |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ |
17 */ |
18 package info.globalcode.sql.dk.configuration; |
18 package info.globalcode.sql.dk.configuration; |
19 |
19 |
|
20 import static info.globalcode.sql.dk.Constants.XMLNS_CONFIGURATION; |
20 import info.globalcode.sql.dk.DatabaseConnection; |
21 import info.globalcode.sql.dk.DatabaseConnection; |
|
22 import java.sql.SQLException; |
21 import javax.xml.bind.annotation.XmlElement; |
23 import javax.xml.bind.annotation.XmlElement; |
22 import javax.xml.bind.annotation.XmlTransient; |
|
23 |
24 |
24 /** |
25 /** |
25 * |
26 * |
26 * @author Ing. František Kučera (frantovo.cz) |
27 * @author Ing. František Kučera (frantovo.cz) |
27 */ |
28 */ |
30 private String name; |
31 private String name; |
31 private String url; |
32 private String url; |
32 private String userName; |
33 private String userName; |
33 private String password; |
34 private String password; |
34 |
35 |
35 @XmlElement(name = "name") |
36 @XmlElement(name = "name", namespace = XMLNS_CONFIGURATION) |
36 @Override |
37 @Override |
37 public String getName() { |
38 public String getName() { |
38 return name; |
39 return name; |
39 } |
40 } |
40 |
41 |
41 public void setName(String name) { |
42 public void setName(String name) { |
42 this.name = name; |
43 this.name = name; |
43 } |
44 } |
44 |
45 |
45 @XmlElement(name = "url") |
46 @XmlElement(name = "url", namespace = XMLNS_CONFIGURATION) |
46 public String getUrl() { |
47 public String getUrl() { |
47 return url; |
48 return url; |
48 } |
49 } |
49 |
50 |
50 public void setUrl(String url) { |
51 public void setUrl(String url) { |
51 this.url = url; |
52 this.url = url; |
52 } |
53 } |
53 |
54 |
54 @XmlElement(name = "userName") |
55 @XmlElement(name = "userName", namespace = XMLNS_CONFIGURATION) |
55 public String getUserName() { |
56 public String getUserName() { |
56 return userName; |
57 return userName; |
57 } |
58 } |
58 |
59 |
59 public void setUserName(String userName) { |
60 public void setUserName(String userName) { |
60 this.userName = userName; |
61 this.userName = userName; |
61 } |
62 } |
62 |
63 |
63 @XmlElement(name = "password") |
64 @XmlElement(name = "password", namespace = XMLNS_CONFIGURATION) |
64 public String getPassword() { |
65 public String getPassword() { |
65 return password; |
66 return password; |
66 } |
67 } |
67 |
68 |
68 public void setPassword(String password) { |
69 public void setPassword(String password) { |
69 this.password = password; |
70 this.password = password; |
70 } |
71 } |
71 |
72 |
72 @XmlTransient |
73 public DatabaseConnection connect() throws SQLException { |
73 public DatabaseConnection connect() { |
|
74 return new DatabaseConnection(this); |
74 return new DatabaseConnection(this); |
75 } |
75 } |
76 } |
76 } |