public static DatabaseMetaData getMetaData(Connection c) throws PalantirSqlException { try { return c.getMetaData(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static boolean getAutoCommit(Connection c) throws PalantirSqlException { try { return c.getAutoCommit(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static long getLong(ResultSet rs, String idColName) { try { return rs.getLong(idColName); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static Timestamp getTimestamp(ResultSet rs, int col) throws PalantirSqlException { try { return rs.getTimestamp(col); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static Blob getBlob(ResultSet rs, int col) throws PalantirSqlException { try { return rs.getBlob(col); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setInt(PreparedStatement ps, int index, Integer obj) throws PalantirSqlException { try { ps.setInt(index, obj); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setShort(PreparedStatement ps, int index, Short obj) throws PalantirSqlException { try { ps.setShort(index, obj); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void rollback(Connection c) throws PalantirSqlException { try { c.rollback(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void commit(Connection c) throws PalantirSqlException { try { c.commit(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } } }
public static int getColumnCount(ResultSetMetaData metaData) throws PalantirSqlException { try { return metaData.getColumnCount(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setBinaryStream(PreparedStatement ps, int index, InputStream stream, int length) throws PalantirSqlException { try { ps.setBinaryStream(index, stream, length); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setByte(PreparedStatement ps, int index, Byte obj) throws PalantirSqlException { try { ps.setByte(index, obj); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setTimestamp(PreparedStatement ps, int index, Timestamp obj) throws PalantirSqlException { try { ps.setTimestamp(index, obj); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setNull(PreparedStatement ps, int index, int sqlType, String typeName) throws PalantirSqlException { try { ps.setNull(index, sqlType, typeName); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } } }
public static void setTransactionIsolation(Connection c, int level) throws PalantirSqlException { try { c.setTransactionIsolation(level); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static long length(Blob b) throws PalantirSqlException { try { return b.length(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static void setObject(PreparedStatement ps, int index, Object obj) throws PalantirSqlException { try { ps.setObject(index, obj); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
public static String getUrl(Connection c) throws PalantirSqlException { try { return c.getMetaData().getURL(); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }
static PalantirSqlException handleInterruptions(long startTime, ExecutionException ee) throws PalantirSqlException { SQLException e = getSQLException(ee.getCause()); return handleInterruptions(startTime, e); }
private void setOracleStructArray(Connection c, PreparedStatement ps, int paramIndex, ArrayHandler array) { Preconditions.checkArgument(DBType.getTypeFromConnection(c) == DBType.ORACLE); try { PreparedStatements.setObject(ps, paramIndex, array.toOracleArray(c)); } catch (SQLException e) { throw BasicSQL.handleInterruptions(0, e); } }