ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/branches/aglappe-jung/testClusterConnection.java
Revision: 15
Committed: Mon Mar 6 08:25:22 2006 UTC (18 years, 6 months ago) by duarte
Original Path: trunk/tools/testClusterConnection.java
File size: 1079 byte(s)
Log Message:
Initial commit of the ClusterConnection class + small test class to test it out.

Line File contents
1 //package clusterconnection;
2 import java.sql.*;
3
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","asu","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(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 }

Properties

Name Value
svn:executable *