Java Code Examples for javax.sql.rowset.CachedRowSet#size()
The following examples show how to use
javax.sql.rowset.CachedRowSet#size() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonCachedRowSetTests.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 2
Source File: CommonCachedRowSetTests.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 3
Source File: CommonCachedRowSetTests.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 4
Source File: CommonCachedRowSetTests.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 5
Source File: CommonCachedRowSetTests.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 6
Source File: CommonCachedRowSetTests.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 7
Source File: CommonCachedRowSetTests.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 8
Source File: CommonCachedRowSetTests.java From hottub with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 9
Source File: CommonCachedRowSetTests.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private void compareRowSets(CachedRowSet crs, CachedRowSet crs1) throws Exception { int rows = crs.size(); assertTrue(rows == crs1.size()); ResultSetMetaData rsmd = crs.getMetaData(); compareMetaData(rsmd, crs1.getMetaData()); int cols = rsmd.getColumnCount(); for (int row = 1; row <= rows; row++) { crs.absolute((row)); crs1.absolute(row); for (int col = 1; col <= cols; col++) { compareColumnValue(JDBCType.valueOf(rsmd.getColumnType(col)), crs, crs1, col); } } }
Example 10
Source File: Query.java From mat-calcite-plugin with Apache License 2.0 | 4 votes |
@Override public IResult execute(IProgressListener listener) throws Exception { Connection con = null; Statement st = null; ResultSet rs = null; try { con = CalciteDataSource.getConnection(snapshot); st = con.createStatement(); rs = st.executeQuery(sql); RowSetFactory rowSetFactory = RowSetProvider.newFactory(); CachedRowSet rowSet = rowSetFactory.createCachedRowSet(); rowSet.populate(rs); ResultSetMetaData md = rowSet.getMetaData(); if (md.getColumnCount() == 1 && "PLAN".equals(md.getColumnName(1)) && rowSet.size() == 1 && EXPLAIN_PLAN.matcher(sql).find()) { rowSet.absolute(1); String plan = rowSet.getString(1); System.out.println("plan = " + plan); { Matcher ind = RENAME_INDEX.matcher(plan); StringBuffer sb = new StringBuffer(); while (ind.find()) { String className = ind.group(1).replace(", ", ".") + ind.group(2); ind.appendReplacement(sb, "GetObjectIdsByClass (class=" + className + ")"); } ind.appendTail(sb); plan = sb.toString(); } plan = RENAME_JOIN.matcher(plan).replaceAll("HashJoin "); plan = RENAME_CALC.matcher(plan).replaceAll("View "); plan = TRIM_ENUMERABLE.matcher(plan).replaceAll("$1 "); return new TextResult(plan, false); } return new RowSetTable(rowSet); } finally { CalciteDataSource.close(rs, st, con); } }