(no commit message)
[cdmlib.git] / cdmlib-io / src / main / java / eu / etaxonomy / cdm / io / berlinModel / test / BerlinModelSources.java
1 package eu.etaxonomy.cdm.io.berlinModel.test;
2
3 import org.apache.log4j.Logger;
4
5 import eu.etaxonomy.cdm.io.source.Source;
6
7 public class BerlinModelSources {
8 private static Logger logger = Logger.getLogger(BerlinModelSources.class);
9
10 public static Source euroMed(){
11 // BerlinModel - Euro+Med
12 String dbms = "SQLServer";
13 String strServer = "BGBM111";
14 String strDB = "EuroPlusMed_00_Edit";
15 int port = 1247;
16 String userName = "webUser";
17 String pwd = "";
18 return makeSource(dbms, strServer, strDB, port, userName, pwd);
19 }
20
21 public static Source editWP6(){
22 // BerlinModel - EditWp6
23 String dbms = "SQLServer";
24 String strServer = "BGBM111";
25 String strDB = "EditWP6";
26 int port = 1247;
27 String userName = "webUser";
28 String pwd = "";
29 return makeSource(dbms, strServer, strDB, port, userName, pwd);
30 }
31
32
33
34 /**
35 * initializes source
36 * @return true, if connection establisehd
37 */
38 private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd){
39 //establish connection
40 try {
41 Source source = new Source(dbms, strServer, strDB);
42 source.setPort(port);
43 source.setUserAndPwd(userName, pwd);
44 return source;
45 } catch (Exception e) {
46 logger.error(e);
47 return null;
48 }
49 }
50 }