private int getDataType ( Term term ) { /* * TODO: refactor! */ if ( term instanceof Function ) { Function f = ( Function ) term ; Predicate p = f . getFunctionSymbol ( ) ; if ( p instanceof DatatypePredicate ) { RDFDatatype type = ( ( DatatypePredicate ) p ) . getReturnedType ( ) ; return jdbcTypeMapper . getSQLType ( type ) ; } // return varchar for unknown return Types . VARCHAR ; } else if ( term instanceof Variable ) { throw new RuntimeException ( "Cannot return the SQL type for: " + term ) ; } /* * Boolean constant */ else if ( term . equals ( termFactory . getBooleanConstant ( false ) ) || term . equals ( termFactory . getBooleanConstant ( true ) ) ) { return Types . BOOLEAN ; } return Types . VARCHAR ; }
return the SQL data type