Package net.lr.tutorial.karaf.db.command

Examples of net.lr.tutorial.karaf.db.command.ShellTable


            throw new RuntimeException("No DataSource selected");
        }
        Connection con = dataSource.getConnection();
        DatabaseMetaData metaData = con.getMetaData();
        ResultSet rs = metaData.getTables(null, null, null, null);
        ShellTable table = printResult(rs);
        rs.close();
        return table;
    }
View Full Code Here


        Connection con = dataSource.getConnection();
        Statement stmt = null;
        try {
            stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery(sql);
            ShellTable table = printResult(rs);
            rs.close();
            return table;
        } catch (Exception e) {
            throw e;
        } finally {
View Full Code Here

            }
        }
    }

    private ShellTable printResult(ResultSet rs) throws SQLException {
        ShellTable table = new ShellTable();
        ResultSetMetaData meta = rs.getMetaData();
        for (int c = 1; c <= meta.getColumnCount(); c++) {
            table.header.add(meta.getColumnLabel(c));
        }
        while (rs.next()) {
            List<String> row = table.addRow();
            for (int c = 1; c <= meta.getColumnCount(); c++) {
                row.add(rs.getString(c));
            }
        }
        return table;
View Full Code Here

            throw new RuntimeException("No DataSource selected");
        }
        Connection con = dataSource.getConnection();
        DatabaseMetaData metaData = con.getMetaData();
        ResultSet rs = metaData.getTables(null, null, null, null);
        ShellTable table = printResult(rs);
        rs.close();
        return table;
    }
View Full Code Here

        Connection con = dataSource.getConnection();
        Statement stmt = null;
        try {
            stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery(sql);
            ShellTable table = printResult(rs);
            rs.close();
            return table;
        } catch (Exception e) {
            throw e;
        } finally {
View Full Code Here

            }
        }
    }

    private ShellTable printResult(ResultSet rs) throws SQLException {
        ShellTable table = new ShellTable();
        ResultSetMetaData meta = rs.getMetaData();
        for (int c = 1; c <= meta.getColumnCount(); c++) {
            table.header.add(meta.getColumnLabel(c));
        }
        while (rs.next()) {
            List<String> row = table.addRow();
            for (int c = 1; c <= meta.getColumnCount(); c++) {
                row.add(rs.getString(c));
            }
        }
        return table;
View Full Code Here

            throw new RuntimeException("No DataSource selected");
        }
        Connection con = dataSource.getConnection();
        DatabaseMetaData metaData = con.getMetaData();
        ResultSet rs = metaData.getTables(null, null, null, null);
        ShellTable table = printResult(rs);
        rs.close();
        return table;
    }
View Full Code Here

        Connection con = dataSource.getConnection();
        Statement stmt = null;
        try {
            stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery(sql);
            ShellTable table = printResult(rs);
            rs.close();
            return table;
        } catch (Exception e) {
            throw e;
        } finally {
View Full Code Here

            }
        }
    }

    private ShellTable printResult(ResultSet rs) throws SQLException {
        ShellTable table = new ShellTable();
        ResultSetMetaData meta = rs.getMetaData();
        for (int c = 1; c <= meta.getColumnCount(); c++) {
            table.header.add(meta.getColumnLabel(c));
        }
        while (rs.next()) {
            List<String> row = table.addRow();
            for (int c = 1; c <= meta.getColumnCount(); c++) {
                row.add(rs.getString(c));
            }
        }
        return table;
View Full Code Here

TOP

Related Classes of net.lr.tutorial.karaf.db.command.ShellTable

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.