adapt app-import to new AccountStore package
[cdmlib-apps.git] / cdm-pesi / src / test / java / eu / etaxonomy / cdm / io / common / TestConnection.java
1 package eu.etaxonomy.cdm.io.common;
2
3 import java.sql.Connection;
4
5 import eu.etaxonomy.cdm.config.AccountStore;
6
7 public class TestConnection {
8
9
10 public static void main(String[] args){
11
12 System.out.println("start");
13 Source source = new Source(Source.SQL_SERVER_2008, "localhost", "PESI_v12", true);
14 // Source source = new Source(Source.SQL_SERVER_2008, "(local)", "PESI_v12", "SELECT DISTINCT AreaId FROM Area");
15
16 // Source source = new Source(Source.SQL_SERVER_2008, "PESIIMPORT3", "PESI_v122", "SELECT DISTINCT AreaId FROM Area");
17 // Source source = new Source(Source.SQL_SERVER_2008, "LENOVO-T61", "globis", "SELECT DISTINCT AreaId FROM Area");
18 String user = "pesiexport";
19 source.setUsername(user);
20 String pwd = AccountStore.readOrStorePassword("SQL Server 2008", "localhost", user, null);
21 source.setPassword(pwd);
22 System.out.println("connect");
23 Connection con = source.getConnection();
24 System.out.println(con);
25 }
26 }