View Javadoc

1   package a;
2   
3   import java.sql.*;
4   import net.sf.jour.rt.agent.*;
5   
6   public class DBClientExample {
7       String connectionUrl;
8   
9       public DBClientExample() {
10          connectionUrl = "jdbc:subprotocol:subname";
11      }
12  
13      public void execUpdate(String sql) throws Throwable {
14          if (Elog.ON) {
15              Elog.logEvent(new ProfilerEvent(0, null, new MapedEventID(1)));
16          }
17  
18          try {
19              Connection conn = DriverManager.getConnection(connectionUrl);
20              Statement stmt = conn.createStatement();
21              stmt.close();
22              conn.close();
23  
24              if (Elog.ON) {
25                  Elog.logEvent(new ProfilerEvent(1, null, new MapedEventID(1)));
26              }
27  
28          } catch (Throwable throwable1) {
29  
30              if (Elog.ON) {
31                  Elog.logEvent(new ProfilerEvent(1, throwable1, new MapedEventID(1)));
32              }
33  
34              throw throwable1;
35          }
36      }
37  }