Project

General

Profile

Download (2.28 KB) Statistics
| Branch: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.app.pesi;
11

    
12
import org.apache.log4j.Logger;
13

    
14
import eu.etaxonomy.cdm.app.common.ImportUtils;
15
import eu.etaxonomy.cdm.common.AccountStore;
16
import eu.etaxonomy.cdm.io.common.Source;
17

    
18
/**
19
 * @author a.babadshanjan
20
 * @created 12.05.2009
21
 */
22
public class FaunaEuropaeaSources {
23
	@SuppressWarnings("unused")
24
	private static final Logger logger = Logger.getLogger(FaunaEuropaeaSources.class);
25
	
26
	public static Source faunEu(){
27
		//	Fauna Europaea
28
		
29
		String dbms = Source.SQL_SERVER_2008;
30
           
31
		String strServer = "BGBM42";               // "192.168.1.36";
32
            
33
		String strDB = "FaunEu";
34
		int port = 1433;
35
		String userName = "WebUser";
36
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
37
	}
38
	
39
	public static Source faunaEu_1_3(){
40
		//	Fauna Europaea
41
		
42
		String dbms = Source.SQL_SERVER_2008;
43
           
44
		String strServer = "BGBM42";               // "192.168.1.36";
45
            
46
		String strDB = "FaunaEu_1_3";
47
		int port = 1433;
48
		String userName = "WebUser";
49
		return  ImportUtils.makeSource(dbms, strServer, strDB, port, userName, null);
50
	}
51
	
52
	
53
	public static Source PESI_ERMS(){
54
		//	BerlinModel - Pesi-ERMS
55
		String dbms = Source.SQL_SERVER_2008;
56
		String strServer = "BGBM42";
57
		String strDB = "ERMS";
58
		int port = 1433;
59
		String userName = "WebUser";
60
		return  makeSource(dbms, strServer, strDB, port, userName, null);
61
	}
62
	
63
	
64
	/**
65
	 * Initializes the source.
66
	 * @param dbms
67
	 * @param strServer
68
	 * @param strDB
69
	 * @param port
70
	 * @param userName
71
	 * @param pwd
72
	 * @return the source
73
	 */
74
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
75
		//establish connection
76
		Source source = null;
77
		source = new Source(dbms, strServer, strDB);
78
		source.setPort(port);
79
			
80
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
81
		source.setUserAndPwd(userName, pwd);
82
		// write pwd to account store
83
		return source;
84
	}
85

    
86
	
87
}
(4-4/6)