1 |
import java.sql.*; |
2 |
|
3 |
import tools.ClusterConnection; |
4 |
|
5 |
public class testClusterConnection { |
6 |
|
7 |
/** |
8 |
* @param args |
9 |
*/ |
10 |
/** |
11 |
* @param args |
12 |
*/ |
13 |
public static void main(String[] args) { |
14 |
int asuId=30; |
15 |
//ClusterConnection conn=new ClusterConnection(); |
16 |
ClusterConnection conn=new ClusterConnection("pdbgraph","duarte","nieve"); |
17 |
System.out.println(conn.db); |
18 |
try { |
19 |
//System.out.println(conn.getHost4Idx(asuId)); |
20 |
Statement S; |
21 |
ResultSet R; |
22 |
//S = conn.createNConStatement("asu",asuId); |
23 |
S=conn.createStatement("asu",asuId); |
24 |
System.out.println(conn.host); |
25 |
R=S.executeQuery("SELECT asu_id,accession_code FROM asu_list WHERE asu_id="+asuId+";"); |
26 |
System.out.println("asu_id\taccession_code"); |
27 |
System.out.println("Fetch size is="+R.getFetchSize()); |
28 |
while (R.next()){ |
29 |
System.out.println(R.getInt(1)+"\t"+R.getString(2)); |
30 |
} |
31 |
R.close(); |
32 |
S.close(); |
33 |
} |
34 |
catch (SQLException e) { |
35 |
e.printStackTrace(); |
36 |
} |
37 |
conn.close(); |
38 |
/* |
39 |
try { |
40 |
Runtime.getRuntime().exec("touch jose"); |
41 |
} |
42 |
catch(IOException e){ |
43 |
e.printStackTrace(); |
44 |
} |
45 |
*/ |
46 |
} |
47 |
|
48 |
} |