Search in sources :

Example 11 with DBColumn

use of fr.lirmm.graphik.graal.store.rdbms.util.DBColumn in project graal by graphik-team.

the class ResultSet2DBTableConverter method convert.

// /////////////////////////////////////////////////////////////////////////
// PUBLIC METHODS
// /////////////////////////////////////////////////////////////////////////
@Override
public DBTable convert(ResultSet result) throws ConversionException {
    try {
        String tableName = result.getString("TABLE_NAME");
        List<DBColumn> cols = this.driver.getColumns(tableName);
        if (!this.driver.isCaseSensitive()) {
            tableName = tableName.toUpperCase();
        }
        return new DBTable(tableName, cols);
    } catch (SQLException e) {
        throw new ConversionException(e);
    }
}
Also used : ConversionException(fr.lirmm.graphik.util.stream.converter.ConversionException) DBTable(fr.lirmm.graphik.graal.store.rdbms.util.DBTable) SQLException(java.sql.SQLException) DBColumn(fr.lirmm.graphik.graal.store.rdbms.util.DBColumn)

Aggregations

DBColumn (fr.lirmm.graphik.graal.store.rdbms.util.DBColumn)11 DBTable (fr.lirmm.graphik.graal.store.rdbms.util.DBTable)7 Term (fr.lirmm.graphik.graal.api.core.Term)5 SQLQuery (fr.lirmm.graphik.graal.store.rdbms.util.SQLQuery)5 AtomSetException (fr.lirmm.graphik.graal.api.core.AtomSetException)4 SQLException (java.sql.SQLException)4 TreeMap (java.util.TreeMap)3 ArrayList (java.util.ArrayList)2 Atom (fr.lirmm.graphik.graal.api.core.Atom)1 AtomSet (fr.lirmm.graphik.graal.api.core.AtomSet)1 UnsupportedAtomTypeException (fr.lirmm.graphik.graal.api.core.UnsupportedAtomTypeException)1 IteratorException (fr.lirmm.graphik.util.stream.IteratorException)1 ConversionException (fr.lirmm.graphik.util.stream.converter.ConversionException)1 DatabaseMetaData (java.sql.DatabaseMetaData)1 ResultSet (java.sql.ResultSet)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1