ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/branches/aglappe-jung/testClusterConnection.java
Revision: 202
Committed: Thu Jun 21 17:18:11 2007 UTC (17 years, 3 months ago) by duarte
Original Path: trunk/testClusterConnection.java
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 File contents
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 * @throws SQLException
13 */
14 public static void main(String[] args) throws SQLException {
15 int asuId=30;
16 //ClusterConnection conn=new ClusterConnection();
17 ClusterConnection conn=new ClusterConnection("pdbgraph","duarte","nieve");
18 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 S=conn.createStatement("asu",asuId);
25 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 *