Esempio n. 1
0
 protected void showStatementState(String when, Statement s) throws SQLException {
   super.showStatementState(when, s);
   System.out.println("  getResultSetHoldability() " + rsHoldability(s.getResultSetHoldability()));
   if (s instanceof PreparedStatement) {
     PreparedStatement ps = (PreparedStatement) s;
     ParameterMetaData psmd = ps.getParameterMetaData();
     System.out.println("  Parameter Count " + psmd.getParameterCount());
     for (int i = 1; i <= psmd.getParameterCount(); i++) {
       System.out.println("    " + i + " type " + psmd.getParameterType(i));
     }
   }
 }
Esempio n. 2
0
  public void checkConnection(String dsName, Connection conn) throws SQLException {

    System.out.println("Running JDBC 3.0 connection checks on " + dsName);

    System.out.println(
        "  holdability     " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));

    // check it's a 3.0 connection object
    try {
      conn.releaseSavepoint(conn.setSavepoint());
      System.out.println("JDBC 3.0 savepoint OK");
    } catch (SQLException sqle) {
      // we expect savepoints exceptions because either
      // it's a global transaction, or it's in auto commit mode.
      System.out.println("JDBC 3.0 savepoint " + sqle.toString());
    }

    super.checkConnection(dsName, conn);
  }
Esempio n. 3
0
  protected void checkConnectionPreClose(String dsName, Connection conn) throws SQLException {

    conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);

    super.checkConnectionPreClose(dsName, conn);
  }
Esempio n. 4
0
  protected void showXAException(String tag, XAException xae) {

    super.showXAException(tag, xae);
    Throwable t = xae.getCause();
    if (t instanceof SQLException) JDBCDisplayUtil.ShowSQLException(System.out, (SQLException) t);
  }