/** {@inheritDoc} */ public Property<?> mapRow(ResultSet rs, int row) throws SQLException { return super.map(rs); }
/** {@inheritDoc} */ @Override public Map<String, Property<?>> readAllProperties() { Map<String, Property<?>> properties = new LinkedHashMap<String, Property<?>>(); Connection sqlConn = null; PreparedStatement ps = null; ResultSet rs = null; try { sqlConn = getDataSource().getConnection(); ps = buildStatement(sqlConn, getQueryBuilder().getAllProperties()); rs = ps.executeQuery(); while (rs.next()) { Property<?> ap = JDBC_MAPPER.map(rs); properties.put(ap.getName(),ap); } } catch (SQLException sqlEX) { throw new PropertyAccessException("Cannot read properties within database, SQL ERROR", sqlEX); } finally { closeResultSet(rs); closeStatement(ps); closeConnection(sqlConn); } return properties; }
rs = ps.executeQuery(); while (rs.next()) { f.addProperty(JDBC_PROPERTY_MAPPER.map(rs));
rs = ps.executeQuery(); while (rs.next()) { f.addProperty(JDBC_PROPERTY_MAPPER.map(rs));
rs = ps.executeQuery(); while (rs.next()) { f.addProperty(JDBC_PROPERTY_MAPPER.map(rs));
/** {@inheritDoc} */ public Property<?> readProperty(String name) { Util.assertHasLength(name); Connection sqlConn = null; PreparedStatement ps = null; ResultSet rs = null; try { sqlConn = getDataSource().getConnection(); if (!existProperty(name)) { throw new PropertyNotFoundException(name); } // Returns features ps = buildStatement(sqlConn, getQueryBuilder().getProperty(), name); rs = ps.executeQuery(); rs.next(); return JDBC_MAPPER.map(rs); } catch (SQLException sqlEX) { throw new PropertyAccessException("Cannot check property existence, error related to database", sqlEX); } finally { closeResultSet(rs); closeStatement(ps); closeConnection(sqlConn); } }