Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | 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
	
40
	
41
	public static Source PESI_ERMS(){
42
		//	BerlinModel - Pesi-ERMS
43
		String dbms = Source.SQL_SERVER_2008;
44
		String strServer = "BGBM42";
45
		String strDB = "ERMS";
46
		int port = 1433;
47
		String userName = "WebUser";
48
		return  makeSource(dbms, strServer, strDB, port, userName, null);
49
	}
50
	
51
	
52
	/**
53
	 * Initializes the source.
54
	 * @param dbms
55
	 * @param strServer
56
	 * @param strDB
57
	 * @param port
58
	 * @param userName
59
	 * @param pwd
60
	 * @return the source
61
	 */
62
	private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
63
		//establish connection
64
		Source source = null;
65
		source = new Source(dbms, strServer, strDB);
66
		source.setPort(port);
67
			
68
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
69
		source.setUserAndPwd(userName, pwd);
70
		// write pwd to account store
71
		return source;
72
	}
73

    
74
	
75
}
(4-4/6)