org.d2rq.db.types
Class SQLBinary

java.lang.Object
  extended by org.d2rq.db.types.DataType
      extended by org.d2rq.db.types.SQLBinary

public class SQLBinary
extends DataType


Nested Class Summary
 
Nested classes/interfaces inherited from class org.d2rq.db.types.DataType
DataType.GenericType
 
Field Summary
 
Fields inherited from class org.d2rq.db.types.DataType
log
 
Constructor Summary
SQLBinary(String name, boolean supportsDistinct)
           
 
Method Summary
static boolean isHexString(String s)
           
 boolean isIRISafe()
           
 String rdfType()
          Return the URI of an appropriate RDF datatype for a SQL data type.
 boolean supportsDistinct()
           
 String toSQLLiteral(String value, Vendor vendor)
          Creates a SQL literal for the given value, suitable for comparison to a column of this indicated type.
 String value(ResultSet resultSet, int column)
          Retrieves a string value in preferred format (canonical form of the closest XSD type) from a SQL ResultSet.
 
Methods inherited from class org.d2rq.db.types.DataType
equals, hashCode, isUnsupported, name, toString, valueRegex
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLBinary

public SQLBinary(String name,
                 boolean supportsDistinct)
Method Detail

isIRISafe

public boolean isIRISafe()
Overrides:
isIRISafe in class DataType

supportsDistinct

public boolean supportsDistinct()
Overrides:
supportsDistinct in class DataType
Returns:
true if this column can be used in SELECT DISTINCT queries

rdfType

public String rdfType()
Description copied from class: DataType
Return the URI of an appropriate RDF datatype for a SQL data type. null indicates a known SQL type that cannot be mapped to RDF.

Overrides:
rdfType in class DataType
Returns:
RDF datatype URI: http://www.w3.org/2001/XMLSchema#string etc.

value

public String value(ResultSet resultSet,
                    int column)
             throws SQLException
Description copied from class: DataType
Retrieves a string value in preferred format (canonical form of the closest XSD type) from a SQL ResultSet.

Overrides:
value in class DataType
Parameters:
resultSet - Result of a SELECT query
column - The column index to retrieve; leftmost columns is 1
Returns:
String representation, or null if SQL result was null or is not representable in the XSD type
Throws:
SQLException

toSQLLiteral

public String toSQLLiteral(String value,
                           Vendor vendor)
Description copied from class: DataType
Creates a SQL literal for the given value, suitable for comparison to a column of this indicated type. If the value is not suitable for the column type (e.g., not a number for a SQLExactNumeric), NULL is returned.

Overrides:
toSQLLiteral in class DataType
Parameters:
value - A value
vendor - A vendor instance responsible for quoting/escaping
Returns:
A quoted and escaped SQL literal, suitable for comparison to a column

isHexString

public static boolean isHexString(String s)