boolean insertManyUnregisteredQuery(Connection c, String sql, Iterable<Object[]> list) throws PalantirSqlException { return basicSql.insertMany( c, SQLString.getUnregisteredQuery(sql), Iterables.toArray(list, Object[].class)); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLongUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getUnregisteredQuery(sql), vs, null, true); }
/** * Returns true if at least one row comes back for the provided Otherwise, returns false. * * @param c * @param sql * @param vs * @return * @throws PalantirSqlException */ boolean selectExistsUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectExistsInternal(c, SQLString.getUnregisteredQuery(sql), vs); }
void updateManyUnregisteredQuery(Connection c, String sql, Iterable<Object[]> list) throws PalantirSqlException { basicSql.updateMany( c, SQLString.getUnregisteredQuery(sql), Iterables.toArray(list, Object[].class)); }
int insertOneCountRowsUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { return basicSql.insertOneCountRowsInternal(c, SQLString.getUnregisteredQuery(sql), vs); }
int executeUnregisteredQueryCountRows(Connection c, String sql, Object... vs) throws PalantirSqlException { return executeCountRows(c, SQLString.getUnregisteredQuery(sql), vs); }
int updateCountRowsUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { return basicSql.updateCountRowsInternal(c, SQLString.getUnregisteredQuery(sql), vs); }
/** * Returns the integer value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the first field is null, then 0 will be returned. */ int selectIntegerUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectIntegerInternal(c, SQLString.getUnregisteredQuery(sql), vs); }
boolean updateUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { basicSql.updateInternal(c, SQLString.getUnregisteredQuery(sql), vs, AutoClose.TRUE); return true; }
void executeUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { basicSql.execute(c, SQLString.getUnregisteredQuery(sql), vs, AutoClose.TRUE); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefaultUnregisteredQuery(Connection c, String sql, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal( c, SQLString.getUnregisteredQuery(sql), vs, defaultVal, false); }
AgnosticLightResultSet selectLightResultSetUnregisteredQueryWithFetchSize(Connection c, String sql, @Nullable Integer fetchSize, Object... vs) { return basicSql.selectLightResultSetSpecifyingDBType( c, SQLString.getUnregisteredQuery(sql), vs, DBType.getTypeFromConnection(c), fetchSize); } AgnosticLightResultSet selectLightResultSet(Connection c, String key, Object... vs)
AgnosticResultSet selectResultSetUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectResultSetSpecifyingDBType( c, SQLString.getUnregisteredQuery(sql), vs, DBType.getTypeFromConnection(c)); }
private void executeSqlQuery(BasicSQL basicSql) throws SQLException { Connection conn = createMockConnection(); basicSql.execute( conn, SQLString.getUnregisteredQuery("SELECT 1 FROM a.b;"), new Object[0], BasicSQL.AutoClose.FALSE); }
public AgnosticLightResultSet fromResultSet(PreparedStatement preparedStatement, ResultSet resultSet, DBType dbType, String queryString) { FinalSQLString sqlString = SQLString.getUnregisteredQuery(queryString); String timingModule = "visitResultSet"; ResultSetMetaData metaData = ResultSets.getMetaData(resultSet); SqlTimer sqlTimer = getSqlTimer(); ResourceCreationLocation creationException = new ResourceCreationLocation("This is where the ResultsSet was created"); //$NON-NLS-1$ return new AgnosticLightResultSetImpl( resultSet, dbType, metaData, preparedStatement, timingModule, sqlString, sqlTimer, creationException); } }
boolean updateUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { basicSql.updateInternal(c, SQLString.getUnregisteredQuery(sql), vs, AutoClose.TRUE); return true; }
boolean insertManyUnregisteredQuery(Connection c, String sql, Iterable<Object[]> list) throws PalantirSqlException { return basicSql.insertMany( c, SQLString.getUnregisteredQuery(sql), Iterables.toArray(list, Object[].class)); }
int updateCountRowsUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { return basicSql.updateCountRowsInternal(c, SQLString.getUnregisteredQuery(sql), vs); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLongUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getUnregisteredQuery(sql), vs, null, true); }
void executeUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException { basicSql.execute(c, SQLString.getUnregisteredQuery(sql), vs, AutoClose.TRUE); }