Examples of ShellTable


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

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

        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

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

            }
        }
    }

    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

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

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

        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

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

            }
        }
    }

    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

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

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

        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

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

            }
        }
    }

    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

Examples of org.apache.karaf.shell.support.table.ShellTable

        FrameworkStartLevel fsl = this.bundleContext.getBundle(0).adapt(FrameworkStartLevel.class);
        if (fsl != null) {
            System.out.println("START LEVEL " + fsl.getStartLevel() + " , List Threshold: " + bundleLevelThreshold);
        }

        ShellTable table = new ShellTable();
        table.column("ID").alignRight();
        table.column("State");
        table.column("Lvl").alignRight();
        table.column("Version");
        table.column(getNameHeader());
       
        for (Bundle bundle : bundles) {
            BundleInfo info = this.bundleService.getInfo(bundle);
            if (info.getStartLevel() >= bundleLevelThreshold) {
                String name = getNameToShow(info) + printFragments(info) + printHosts(info);
                String version = info.getVersion();
                table.addRow().addContent(info.getBundleId(), getStateString(info.getState()),
                        info.getStartLevel(), version, name);
            }
        }
        table.print(System.out, !noFormat);
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.