Project

General

Profile

Download (1.08 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.common;
11

    
12
import eu.etaxonomy.cdm.config.AccountStore;
13
import eu.etaxonomy.cdm.io.common.Source;
14

    
15

    
16
/**
17
 * @author a.babadshanjan
18
 * @since 12.05.2009
19
 *
20
 */
21
public class ImportUtils {
22

    
23
	/**
24
	 * Initializes the source.
25
	 * @param dbms
26
	 * @param strServer
27
	 * @param strDB
28
	 * @param port
29
	 * @param userName
30
	 * @param pwd
31
	 * @return the source
32
	 */
33
	public static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
34
		//establish connection
35
		Source source = null;
36
		source = new Source(dbms, strServer, strDB);
37
		source.setPort(port);
38

    
39
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
40
		source.setUserAndPwd(userName, pwd);
41
		// write pwd to account store
42
		return source;
43
	}
44

    
45

    
46

    
47

    
48

    
49
}
(2-2/3)