Search in sources :

Example 1 with JDBCWrapperDriver

use of com.teradata.jaqy.JDBCWrapperDriver in project jaqy by Teradata.

the class DriverCommand method listDrivers.

private void listDrivers(JaqyInterpreter interpreter) throws SQLException {
    PropertyTable pt = new PropertyTable(new String[] { "Driver", "Version", "Compliant" });
    for (Driver driver : DriverManagerUtils.getDrivers()) {
        String name;
        if (driver instanceof JDBCWrapperDriver) {
            name = ((JDBCWrapperDriver) driver).getInternalDriver().getClass().getCanonicalName();
        } else {
            name = driver.getClass().getCanonicalName();
        }
        String version = "";
        if (driver.getMajorVersion() < 10)
            version = " ";
        version += driver.getMajorVersion() + "." + driver.getMinorVersion();
        String jdbcCompliant = driver.jdbcCompliant() ? "T" : "F";
        pt.addRow(new String[] { name, version, jdbcCompliant });
    }
    interpreter.print(pt);
}
Also used : PropertyTable(com.teradata.jaqy.PropertyTable) JDBCWrapperDriver(com.teradata.jaqy.JDBCWrapperDriver) JDBCWrapperDriver(com.teradata.jaqy.JDBCWrapperDriver) Driver(java.sql.Driver)

Aggregations

JDBCWrapperDriver (com.teradata.jaqy.JDBCWrapperDriver)1 PropertyTable (com.teradata.jaqy.PropertyTable)1 Driver (java.sql.Driver)1