Package javax.sql

Examples of javax.sql.RowSet


        return output;
    }

    public RowSet createShared() throws SQLException {
        // shallow copy
        RowSet result = null;
        try {
            result = (RowSet) super.clone();
        } catch (CloneNotSupportedException e) {
            // TODO add error message
            throw new SQLException();
View Full Code Here


        return output;
    }

    public RowSet createShared() throws SQLException {
        // shallow copy
        RowSet result = null;
        try {
            result = (RowSet) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new SQLException(e.getMessage());
        }
View Full Code Here

    this.pstmt = this.conn.prepareStatement(sql);
    this.pstmt.setString(1, "1");
    this.rs = this.pstmt.executeQuery();

    // create a CachedRowSet and populate it
    RowSet cachedRowSet = (RowSet) c.newInstance();
    // cachedRowSet.populate(rs);
    populate.invoke(cachedRowSet, new Object[] { this.rs });

    // scroll through CachedRowSet ...
    assertTrue(cachedRowSet.next());
    assertEquals("1", cachedRowSet.getString("ID"));
    assertEquals("test data stuff !", cachedRowSet.getString("datafield"));
    assertFalse(cachedRowSet.next());

  }
View Full Code Here

    this.pstmt = this.conn.prepareStatement(sql);
    this.pstmt.setString(1, "1");
    this.rs = this.pstmt.executeQuery();

    // create a CachedRowSet and populate it
    RowSet cachedRowSet = (RowSet) c.newInstance();
    // cachedRowSet.populate(rs);
    populate.invoke(cachedRowSet, new Object[] { this.rs });

    // scroll through CachedRowSet ...
    assertTrue(cachedRowSet.next());
    assertEquals("1", cachedRowSet.getString("ID"));
    assertEquals("test data stuff !", cachedRowSet.getString("datafield"));
    assertFalse(cachedRowSet.next());

  }
View Full Code Here

        return output;
    }

    public RowSet createShared() throws SQLException {
        // shallow copy
        RowSet result = null;
        try {
            result = (RowSet) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new SQLException(e.getMessage());
        }
View Full Code Here

        return output;
    }

    public RowSet createShared() throws SQLException {
        // shallow copy
        RowSet result = null;
        try {
            result = (RowSet) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new SQLException(e.getMessage());
        }
View Full Code Here

        if (rowset == null || !(rowset instanceof RowSet)) {
            // rowset.33=Not a rowset
            throw new SQLException(Messages.getString("rowset.33")); //$NON-NLS-1$
        }

        RowSet currentRs = (RowSet) rowset;
        if (currentRs.getMetaData() == null) {
            // rowset.32=The given rowset is empty
            throw new SQLException(Messages.getString("rowset.32")); //$NON-NLS-1$
        }

        int matchCol = -1;
        try {
            if (rowset.getMatchColumnIndexes() != null
                    && rowset.getMatchColumnIndexes().length > 0) {
                matchCol = rowset.getMatchColumnIndexes()[0];
                if (matchCol <= 0
                        || matchCol > currentRs.getMetaData().getColumnCount()) {
                    matchCol = -2;
                }
            }
        } catch (SQLException e) {
            try {
                if (rowset.getMatchColumnNames() != null
                        && rowset.getMatchColumnNames().length > 0) {
                    try {
                        matchCol = currentRs.findColumn(rowset
                                .getMatchColumnNames()[0]);
                    } catch (SQLException e1) {
                        matchCol = -3;
                    }
                }
View Full Code Here

        return output;
    }

    public RowSet createShared() throws SQLException {
        // shallow copy
        RowSet result = null;
        try {
            result = (RowSet) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new SQLException(e.getMessage());
        }
View Full Code Here

        if (rowset == null || !(rowset instanceof RowSet)) {
            // rowset.33=Not a rowset
            throw new SQLException(Messages.getString("rowset.33")); //$NON-NLS-1$
        }

        RowSet currentRs = (RowSet) rowset;
        if (currentRs.getMetaData() == null) {
            // rowset.32=The given rowset is empty
            throw new SQLException(Messages.getString("rowset.32")); //$NON-NLS-1$
        }

        int matchCol = -1;
        try {
            if (rowset.getMatchColumnIndexes() != null
                    && rowset.getMatchColumnIndexes().length > 0) {
                matchCol = rowset.getMatchColumnIndexes()[0];
                if (matchCol <= 0
                        || matchCol > currentRs.getMetaData().getColumnCount()) {
                    matchCol = -2;
                }
            }
        } catch (SQLException e) {
            try {
                if (rowset.getMatchColumnNames() != null
                        && rowset.getMatchColumnNames().length > 0) {
                    try {
                        matchCol = currentRs.findColumn(rowset
                                .getMatchColumnNames()[0]);
                    } catch (SQLException e1) {
                        matchCol = -3;
                    }
                }
View Full Code Here

        if (rowset == null || !(rowset instanceof RowSet)) {
            // rowset.33=Not a rowset
            throw new SQLException(Messages.getString("rowset.33")); //$NON-NLS-1$
        }

        RowSet currentRs = (RowSet) rowset;
        if (currentRs.getMetaData() == null) {
            // rowset.32=The given rowset is empty
            throw new SQLException(Messages.getString("rowset.32")); //$NON-NLS-1$
        }

        int matchCol = -1;
        try {
            if (rowset.getMatchColumnIndexes() != null
                    && rowset.getMatchColumnIndexes().length > 0) {
                matchCol = rowset.getMatchColumnIndexes()[0];
                if (matchCol <= 0
                        || matchCol > currentRs.getMetaData().getColumnCount()) {
                    matchCol = -2;
                }
            }
        } catch (SQLException e) {
            try {
                if (rowset.getMatchColumnNames() != null
                        && rowset.getMatchColumnNames().length > 0) {
                    try {
                        matchCol = currentRs.findColumn(rowset
                                .getMatchColumnNames()[0]);
                    } catch (SQLException e1) {
                        matchCol = -3;
                    }
                }
View Full Code Here

TOP

Related Classes of javax.sql.RowSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.