ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/trunk/testClusterConnection.java
Revision: 202
Committed: Thu Jun 21 17:18:11 2007 UTC (17 years, 4 months ago) by duarte
File size: 1128 byte(s)
Log Message:
MySQLConnection now throwing SQLException on connect
Many files changed following this: all calling classes now re-throwing or catching the SQLException
Line User Rev File contents
1 duarte 15 import java.sql.*;
2    
3 stehr 24 import tools.ClusterConnection;
4 duarte 15
5     public class testClusterConnection {
6    
7     /**
8     * @param args
9     */
10     /**
11     * @param args
12 duarte 202 * @throws SQLException
13 duarte 15 */
14 duarte 202 public static void main(String[] args) throws SQLException {
15 duarte 15 int asuId=30;
16     //ClusterConnection conn=new ClusterConnection();
17 duarte 36 ClusterConnection conn=new ClusterConnection("pdbgraph","duarte","nieve");
18 duarte 15 System.out.println(conn.db);
19     try {
20     //System.out.println(conn.getHost4Idx(asuId));
21     Statement S;
22     ResultSet R;
23     //S = conn.createNConStatement("asu",asuId);
24 duarte 36 S=conn.createStatement("asu",asuId);
25 duarte 15 System.out.println(conn.host);
26     R=S.executeQuery("SELECT asu_id,accession_code FROM asu_list WHERE asu_id="+asuId+";");
27     System.out.println("asu_id\taccession_code");
28     System.out.println("Fetch size is="+R.getFetchSize());
29     while (R.next()){
30     System.out.println(R.getInt(1)+"\t"+R.getString(2));
31     }
32     R.close();
33     S.close();
34     }
35     catch (SQLException e) {
36     e.printStackTrace();
37     }
38     conn.close();
39     /*
40     try {
41     Runtime.getRuntime().exec("touch jose");
42     }
43     catch(IOException e){
44     e.printStackTrace();
45     }
46     */
47     }
48    
49     }

Properties

Name Value
svn:executable *