1
|
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.app.common;
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
|
15
|
import eu.etaxonomy.cdm.common.AccountStore;
|
16
|
import eu.etaxonomy.cdm.io.common.Source;
|
17
|
|
18
|
|
19
|
public class BerlinModelSources {
|
20
|
@SuppressWarnings("unused")
|
21
|
private static final Logger logger = Logger.getLogger(BerlinModelSources.class);
|
22
|
|
23
|
public static Source EDIT_Diptera(){
|
24
|
// BerlinModel - EDIT_Diptera
|
25
|
String dbms = Source.SQL_SERVER_2008;
|
26
|
String strServer = "BGBM42";
|
27
|
String strDB = "EDIT_Diptera";
|
28
|
int port = 1433;
|
29
|
String userName = "webUser";
|
30
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
31
|
}
|
32
|
|
33
|
public static Source euroMed_local_lenovo(){
|
34
|
// BerlinModel - Euro+Med
|
35
|
String dbms = Source.SQL_SERVER_2005;
|
36
|
String strServer = "LENOVO-T61";
|
37
|
String strDB = "euroMed";
|
38
|
int port = 1433;
|
39
|
String userName = "webUser";
|
40
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
41
|
}
|
42
|
|
43
|
public static Source euroMed(){
|
44
|
// BerlinModel - Euro+Med
|
45
|
String dbms = Source.SQL_SERVER_2008;
|
46
|
String strServer = "BGBM42";
|
47
|
String strDB = "EuroPlusMed_00_Edit";
|
48
|
int port = 1433;
|
49
|
String userName = "webUser";
|
50
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
51
|
}
|
52
|
|
53
|
|
54
|
public static Source PESI3_euroMed(){
|
55
|
// BerlinModel - Euro+Med
|
56
|
String dbms = Source.SQL_SERVER_2008;
|
57
|
String strServer = "PESIIMPORT3";
|
58
|
String strDB = "EuroPlusMed_01";
|
59
|
int port = 1433;
|
60
|
String userName = "pesiexport";
|
61
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
62
|
}
|
63
|
|
64
|
|
65
|
|
66
|
|
67
|
public static Source PESI_ERMS(){
|
68
|
// BerlinModel - Pesi-ERMS
|
69
|
String dbms = Source.SQL_SERVER_2005;
|
70
|
String strServer = "SQL2000Intern\\SQL2005";
|
71
|
String strDB = "BM_ERMS";
|
72
|
int port = 1433;
|
73
|
String userName = "WebUser";
|
74
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
75
|
}
|
76
|
|
77
|
/**
|
78
|
* Initializes the source.
|
79
|
* @param dbms
|
80
|
* @param strServer
|
81
|
* @param strDB
|
82
|
* @param port
|
83
|
* @param userName
|
84
|
* @param pwd
|
85
|
* @return the source
|
86
|
*/
|
87
|
private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
|
88
|
//establish connection
|
89
|
Source source = null;
|
90
|
source = new Source(dbms, strServer, strDB);
|
91
|
source.setPort(port);
|
92
|
|
93
|
pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
|
94
|
source.setUserAndPwd(userName, pwd);
|
95
|
// write pwd to account store
|
96
|
return source;
|
97
|
}
|
98
|
|
99
|
}
|