Example usage for java.sql Types TIMESTAMP

List of usage examples for java.sql Types TIMESTAMP

Introduction

In this page you can find the example usage for java.sql Types TIMESTAMP.

Prototype

int TIMESTAMP

To view the source code for java.sql Types TIMESTAMP.

Click Source Link

Document

The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type TIMESTAMP.

Usage

From source file:org.eclipse.ecr.core.storage.sql.jdbc.dialect.DialectOracle.java

@Override
public JDBCInfo getJDBCTypeAndString(ColumnType type) {
    switch (type.spec) {
    case STRING:/*from   w w w  . j a  v  a2s. c  om*/
        if (type.isUnconstrained()) {
            return jdbcInfo("NVARCHAR2(2000)", Types.VARCHAR);
        } else if (type.isClob() || type.length > 2000) {
            return jdbcInfo("NCLOB", Types.CLOB);
        } else {
            return jdbcInfo("NVARCHAR2(%d)", type.length, Types.VARCHAR);
        }
    case BOOLEAN:
        return jdbcInfo("NUMBER(1,0)", Types.BIT);
    case LONG:
        return jdbcInfo("NUMBER(19,0)", Types.BIGINT);
    case DOUBLE:
        return jdbcInfo("DOUBLE PRECISION", Types.DOUBLE);
    case TIMESTAMP:
        return jdbcInfo("TIMESTAMP", Types.TIMESTAMP);
    case BLOBID:
        return jdbcInfo("VARCHAR2(40)", Types.VARCHAR);
    // -----
    case NODEID:
    case NODEIDFK:
    case NODEIDFKNP:
    case NODEIDFKMUL:
    case NODEIDFKNULL:
    case NODEIDPK:
    case NODEVAL:
        return jdbcInfo("VARCHAR2(36)", Types.VARCHAR);
    case SYSNAME:
    case SYSNAMEARRAY:
        return jdbcInfo("VARCHAR2(250)", Types.VARCHAR);
    case TINYINT:
        return jdbcInfo("NUMBER(3,0)", Types.TINYINT);
    case INTEGER:
        return jdbcInfo("NUMBER(10,0)", Types.INTEGER);
    case FTINDEXED:
        return jdbcInfo("CLOB", Types.CLOB);
    case FTSTORED:
        return jdbcInfo("NCLOB", Types.CLOB);
    case CLUSTERNODE:
        return jdbcInfo("NUMBER(10,0)", Types.INTEGER);
    case CLUSTERFRAGS:
        return jdbcInfo("VARCHAR2(4000)", Types.VARCHAR);
    }
    throw new AssertionError(type);
}

From source file:org.nuxeo.ecm.core.storage.sql.db.dialect.DialectOracle.java

@Override
public JDBCInfo getJDBCTypeAndString(ColumnType type) {
    switch (type) {
    case VARCHAR:
        return jdbcInfo("NVARCHAR2(2000)", Types.VARCHAR);
    case CLOB://from  ww  w.ja  v a 2s.c  o  m
        return jdbcInfo("NCLOB", Types.CLOB);
    case BOOLEAN:
        return jdbcInfo("NUMBER(1,0)", Types.BIT);
    case LONG:
        return jdbcInfo("NUMBER(19,0)", Types.BIGINT);
    case DOUBLE:
        return jdbcInfo("DOUBLE PRECISION", Types.DOUBLE);
    case TIMESTAMP:
        return jdbcInfo("TIMESTAMP", Types.TIMESTAMP);
    case BLOBID:
        return jdbcInfo("VARCHAR2(40)", Types.VARCHAR);
    // -----
    case NODEID:
    case NODEIDFK:
    case NODEIDFKNP:
    case NODEIDFKMUL:
    case NODEIDFKNULL:
    case NODEVAL:
        return jdbcInfo("VARCHAR2(36)", Types.VARCHAR);
    case SYSNAME:
        return jdbcInfo("VARCHAR2(250)", Types.VARCHAR);
    case TINYINT:
        return jdbcInfo("NUMBER(3,0)", Types.TINYINT);
    case INTEGER:
        return jdbcInfo("NUMBER(10,0)", Types.INTEGER);
    case FTINDEXED:
        return jdbcInfo("CLOB", Types.CLOB);
    case FTSTORED:
        return jdbcInfo("NCLOB", Types.CLOB);
    case CLUSTERNODE:
        return jdbcInfo("NUMBER(10,0)", Types.INTEGER);
    case CLUSTERFRAGS:
        return jdbcInfo("VARCHAR2(4000)", Types.VARCHAR);
    }
    throw new AssertionError(type);
}

From source file:com.sangupta.fileanalysis.db.DBResultViewer.java

/**
 * View resutls of a {@link ResultSet}./*from  w w w.jav a2s  .  c o m*/
 * 
 * @param resultSet
 * @throws SQLException 
 */
public void viewResult(ResultSet resultSet) throws SQLException {
    if (resultSet == null) {
        // nothing to do
        return;
    }

    // collect the meta
    ResultSetMetaData meta = resultSet.getMetaData();

    final int numColumns = meta.getColumnCount();
    final int[] displaySizes = new int[numColumns + 1];
    final int[] colType = new int[numColumns + 1];

    for (int index = 1; index <= numColumns; index++) {
        colType[index] = meta.getColumnType(index);
        displaySizes[index] = getColumnSize(meta.getTableName(index), meta.getColumnName(index),
                colType[index]);
    }

    // display the header row
    for (int index = 1; index <= numColumns; index++) {
        center(meta.getColumnLabel(index), displaySizes[index]);
    }
    System.out.println("|");
    for (int index = 1; index <= numColumns; index++) {
        System.out.print("+" + StringUtils.repeat('-', displaySizes[index] + 2));
    }
    System.out.println("+");

    // start iterating over the result set
    int rowsDisplayed = 0;
    int numRecords = 0;
    while (resultSet.next()) {
        // read and display the value
        rowsDisplayed++;
        numRecords++;

        for (int index = 1; index <= numColumns; index++) {
            switch (colType[index]) {
            case Types.DECIMAL:
            case Types.DOUBLE:
            case Types.REAL:
                format(resultSet.getDouble(index), displaySizes[index]);
                continue;

            case Types.INTEGER:
            case Types.SMALLINT:
                format(resultSet.getInt(index), displaySizes[index]);
                continue;

            case Types.VARCHAR:
                format(resultSet.getString(index), displaySizes[index], false);
                continue;

            case Types.TIMESTAMP:
                format(resultSet.getTimestamp(index), displaySizes[index]);
                continue;

            case Types.BIGINT:
                format(resultSet.getBigDecimal(index), displaySizes[index]);
                continue;
            }
        }

        // terminator for row and new line
        System.out.println("|");

        // check for rows displayed
        if (rowsDisplayed == 20) {
            // ask the user if more data needs to be displayed
            String cont = ConsoleUtils.readLine("Type \"it\" for more: ", true);
            if (!"it".equalsIgnoreCase(cont)) {
                break;
            }

            // continue;
            rowsDisplayed = 0;
            continue;
        }
    }

    System.out.println("\nTotal number of records found: " + numRecords);
}

From source file:net.sf.farrago.namespace.sfdc.SfdcUdx.java

public static void query(String query, String types, PreparedStatement resultInserter) throws SQLException {
    SoapBindingStub binding = (SoapBindingStub) FarragoUdrRuntime.getDataServerRuntimeSupport(null);

    try {/*from   w w w .  j  a  v  a2s . c o  m*/
        QueryOptions qo = new QueryOptions();
        int batchsize = 500;
        qo.setBatchSize(new Integer(batchsize));
        binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "QueryOptions", qo);

        String objName = query;
        int fromIdx = query.lastIndexOf(" from");
        if (fromIdx > 0) {
            objName = query.substring(fromIdx + 6);
        }

        // strip off quotes for boolean values
        query = stripQuotes(query, objName);
        log.info("SFDC Query: " + query);

        QueryResult qr = binding.query(query);
        if (qr.isDone()) {
            if (qr.getRecords() != null) {
                log.info(SfdcResource.instance().RetrievedAllRecordsMsg
                        .str(Integer.toString(qr.getRecords().length), objName));
            }
        } else {
            if (qr.getRecords() != null) {
                log.info(SfdcResource.instance().RetrievingRecordsMsg
                        .str(Integer.toString(qr.getRecords().length), objName));
            }
        }
        SObject[] records = qr.getRecords();
        String[] metadataType = types.split(",");

        // query is of following format:
        // "select col1,col2,... from"
        String cols = query.substring(7);
        fromIdx = cols.lastIndexOf(" from");
        cols = cols.substring(0, fromIdx);
        cols = cols.trim();
        String[] columnValues = new String[metadataType.length];

        if (records != null) {
            boolean bContinue = true;
            while (bContinue) {
                // for each record returned in query,
                // get value of each field
                for (int i = 0; i < records.length; i++) {
                    MessageElement[] elements = records[i].get_any();
                    if (elements != null) {
                        for (int j = 0; j < elements.length; j++) {
                            MessageElement elt = elements[j];
                            String eltVal = elt.getValue();
                            columnValues[j] = (eltVal != null) ? eltVal : "null";

                            if (metadataType[j].indexOf("TIMESTAMP") != -1) {
                                // TIMESTAMP
                                if (eltVal != null) {
                                    String tstampstr = eltVal.replace("T", " ");
                                    tstampstr = tstampstr.substring(0, tstampstr.indexOf("."));
                                    java.sql.Timestamp tstamp = java.sql.Timestamp.valueOf(tstampstr);
                                    resultInserter.setTimestamp(j + 1, tstamp);
                                } else {
                                    resultInserter.setNull(j + 1, java.sql.Types.TIMESTAMP);
                                }
                            } else if (metadataType[j].indexOf("TIME") != -1) {
                                // TIME
                                if (eltVal != null) {
                                    String timestr = eltVal.substring(0, eltVal.indexOf("."));
                                    java.sql.Time time = java.sql.Time.valueOf(timestr);
                                    resultInserter.setTime(j + 1, time);
                                } else {
                                    resultInserter.setNull(j + 1, java.sql.Types.TIME);
                                }
                            } else if (metadataType[j].indexOf("DATE") != -1) {
                                // DATE
                                if (eltVal != null) {
                                    java.sql.Date dt = java.sql.Date.valueOf(eltVal);
                                    resultInserter.setDate(j + 1, dt);
                                } else {
                                    resultInserter.setNull(j + 1, java.sql.Types.DATE);
                                }
                            } else if (metadataType[j].indexOf("INTEGER") != -1) {
                                // INTEGER
                                if (eltVal != null) {
                                    int iValue = 0;
                                    iValue = Integer.parseInt(eltVal);
                                    resultInserter.setInt(j + 1, iValue);
                                } else {
                                    resultInserter.setNull(j + 1, java.sql.Types.INTEGER);
                                }
                            } else if (metadataType[j].indexOf("DOUBLE") != -1) {
                                // DOUBLE
                                if (eltVal != null) {
                                    resultInserter.setDouble(j + 1, Double.parseDouble(eltVal));
                                } else {
                                    resultInserter.setNull(j + 1, java.sql.Types.DOUBLE);
                                }
                            } else if (eltVal != null) {
                                // VARCHAR - default
                                int rightParen = metadataType[j].indexOf(")");
                                int prec = Integer.parseInt(metadataType[j].substring(8, rightParen));
                                if (eltVal.length() > prec) {
                                    eltVal = eltVal.substring(0, prec);
                                    columnValues[j] = eltVal;
                                }
                                resultInserter.setString(j + 1, eltVal);
                            } else {
                                resultInserter.setNull(j + 1, java.sql.Types.VARCHAR);
                            }
                        }
                        resultInserter.executeUpdate();
                    }
                }
                if (qr.isDone()) {
                    bContinue = false;
                } else {
                    boolean relogin = true;
                    int retryCnt = 0;
                    while (relogin) {
                        try {
                            qr = binding.queryMore(qr.getQueryLocator());
                            relogin = false;
                        } catch (AxisFault a) {
                            if (a.getFaultString().contains("Invalid Session ID") && (retryCnt < RETRY_CNT)) {
                                relogin = true;
                                retryCnt++;
                                binding = (SoapBindingStub) FarragoUdrRuntime
                                        .getDataServerRuntimeSupport(binding);
                            } else {
                                throw a;
                            }
                        }
                    }
                    records = qr.getRecords();
                    if (qr.isDone()) {
                        if (qr.getRecords() != null) {
                            log.info(SfdcResource.instance().RetrievedAllRecordsMsg
                                    .str(Integer.toString(qr.getRecords().length), objName));
                        }
                    } else {
                        if (qr.getRecords() != null) {
                            log.info(SfdcResource.instance().RetrievingRecordsMsg
                                    .str(Integer.toString(qr.getRecords().length), objName));
                        }
                    }
                }
            }
        }
    } catch (AxisFault ae) {
        SQLException retryExcn = new SQLException(ae.getFaultString(), null, 460150);
        Exception chainedEx = FarragoResource.instance().RetryableFailure.ex(retryExcn);
        throw SfdcResource.instance().BindingCallException.ex(ae.getFaultString(), chainedEx);
    } catch (RemoteException re) {
        SQLException retryExcn = new SQLException(re.getMessage(), null, 460150);
        Exception chainedEx = FarragoResource.instance().RetryableFailure.ex(retryExcn);
        throw SfdcResource.instance().BindingCallException.ex(re.getMessage(), chainedEx);
    }
}

From source file:com.google.visualization.datasource.util.SqlDataSourceHelperTest.java

/**
 * Sets the information of the table columns: labels and types. Creates empty
 * list for the table rows as well.//  w  ww  .ja v a  2  s.c  o  m
 *
 * This method is called before a test is executed.
 */
@Override
protected void setUp() {
    labels = Lists.newArrayList("ID", "Fname", "Lname", "Gender", "Salary", "IsMarried", "StartDate",
            "TimeStamp", "Time");
    // Use the JDBC type constants as defined in java.sql.Types.
    types = Lists.newArrayList(Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.CHAR, Types.INTEGER,
            Types.BOOLEAN, Types.DATE, Types.TIMESTAMP, Types.TIME);
    rows = Lists.newArrayList();
}

From source file:com.fns.grivet.repo.JdbcEntityRepository.java

@Override
public List<EntityAttributeValue> findByCreatedTime(Integer cid, LocalDateTime createdTimeStart,
        LocalDateTime createdTimeEnd) {
    String sql = QueryBuilder.newInstance().appendCreatedTimeRange().build();
    log.trace(String.format("JdbcEntityRepository.findByCreatedTime[sql=%s]", sql));
    return mapRows(jdbcTemplate.query(sql, new SqlRowSetResultSetExtractor(),
            new SqlParameterValue(Types.INTEGER, cid),
            new SqlParameterValue(Types.TIMESTAMP, Timestamp.valueOf(createdTimeStart)),
            new SqlParameterValue(Types.TIMESTAMP, Timestamp.valueOf(createdTimeEnd))));
}

From source file:org.apache.ddlutils.platform.sybase.SybasePlatform.java

/**
 * Creates a new platform instance./*from w  w w. j a va2 s . c  o m*/
 */
public SybasePlatform() {
    PlatformInfo info = getPlatformInfo();

    info.setMaxIdentifierLength(28);
    info.setNullAsDefaultValueRequired(true);
    info.setIdentityColumnAutomaticallyRequired(true);
    info.setMultipleIdentityColumnsSupported(false);
    info.setPrimaryKeyColumnsHaveToBeRequired(true);
    info.setCommentPrefix("/*");
    info.setCommentSuffix("*/");

    info.addNativeTypeMapping(Types.ARRAY, "IMAGE");
    // BIGINT is mapped back in the model reader
    info.addNativeTypeMapping(Types.BIGINT, "DECIMAL(19,0)");
    // we're not using the native BIT type because it is rather limited (cannot be NULL, cannot be indexed)
    info.addNativeTypeMapping(Types.BIT, "SMALLINT", Types.SMALLINT);
    info.addNativeTypeMapping(Types.BLOB, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.BOOLEAN, "SMALLINT", Types.SMALLINT);
    info.addNativeTypeMapping(Types.CLOB, "TEXT", Types.LONGVARCHAR);
    info.addNativeTypeMapping(Types.DATALINK, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DATE, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.DISTINCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DOUBLE, "DOUBLE PRECISION");
    info.addNativeTypeMapping(Types.FLOAT, "DOUBLE PRECISION", Types.DOUBLE);
    info.addNativeTypeMapping(Types.INTEGER, "INT");
    info.addNativeTypeMapping(Types.JAVA_OBJECT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.LONGVARBINARY, "IMAGE");
    info.addNativeTypeMapping(Types.LONGVARCHAR, "TEXT");
    info.addNativeTypeMapping(Types.NULL, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.OTHER, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.REF, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.STRUCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.TIME, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.TIMESTAMP, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.TINYINT, "SMALLINT", Types.SMALLINT);

    info.setDefaultSize(Types.BINARY, 254);
    info.setDefaultSize(Types.VARBINARY, 254);
    info.setDefaultSize(Types.CHAR, 254);
    info.setDefaultSize(Types.VARCHAR, 254);

    setSqlBuilder(new SybaseBuilder(this));
    setModelReader(new SybaseModelReader(this));
}

From source file:com.vecna.dbDiff.builder.RelationalDatabaseBuilderTest.java

/**
 * Test {@link RelationalDatabaseBuilderImpl#createRelationalDatabase(CatalogSchema)).
 * @throws Exception//  w w w .j  a  v  a  2 s  . c o  m
 */
public void testCreateRelationalDatabase() throws Exception {
    RelationalDatabase database = getDatabase();

    assertEquals("wrong number of tables", 2, database.getTables().size());

    RelationalTable personTable = database.getTableByName("PERSON");
    assertNotNull("table PERSON not found", personTable);

    List<Column> cols = new ArrayList<>(personTable.getColumns());
    assertEquals("wrong number of columns", 3, cols.size());
    assertEquals("wrong column", "ID", cols.get(0).getName());
    assertEquals("wrong column", Boolean.FALSE, cols.get(0).getIsNullable());
    assertEquals("wrong column", Types.BIGINT, cols.get(0).getType());

    assertEquals("wrong column", "NAME", cols.get(1).getName());
    assertEquals("wrong column", Boolean.FALSE, cols.get(1).getIsNullable());
    assertEquals("wrong column", Types.VARCHAR, cols.get(1).getType());

    assertEquals("wrong column", "DOB", cols.get(2).getName());
    assertEquals("wrong column", Boolean.FALSE, cols.get(2).getIsNullable());
    assertEquals("wrong column", Types.TIMESTAMP, cols.get(2).getType());

    assertEquals("wrong number PK columns", Arrays.asList("ID"), personTable.getPkColumns());

    assertEquals("wrong number of indices", 2, personTable.getIndices().size());

    RelationalIndex nameDOB = getIndex(personTable, "NAME", "DOB");
    assertEquals("NAME_DOB_IDX", nameDOB.getName());

    getIndex(personTable, "ID");

    RelationalTable joinTable = database.getTableByName("PERSON_RELATIVES");

    cols = new ArrayList<>(joinTable.getColumns());
    assertEquals("wrong number of columns", 3, cols.size());

    assertEquals("wrong column", "PERSON_ID", cols.get(0).getName());
    assertEquals("wrong column", Boolean.FALSE, cols.get(0).getIsNullable());
    assertEquals("wrong column", Types.BIGINT, cols.get(0).getType());

    assertEquals("wrong column", "RELATIVE_ID", cols.get(1).getName());
    assertEquals("wrong column", Boolean.FALSE, cols.get(1).getIsNullable());
    assertEquals("wrong column", Types.BIGINT, cols.get(1).getType());

    assertEquals("wrong column", "RELATIONSHIP", cols.get(2).getName());
    assertEquals("wrong column", Boolean.TRUE, cols.get(2).getIsNullable());
    assertEquals("wrong column", Types.VARCHAR, cols.get(2).getType());

    assertEquals("wrong PK columns", Arrays.asList("PERSON_ID", "RELATIVE_ID"), joinTable.getPkColumns());

    getIndex(joinTable, "PERSON_ID", "RELATIVE_ID");

    ForeignKey fkPerson = getForeignKey(joinTable, "FK_PERSON");
    assertEquals("PERSON_ID", fkPerson.getFkColumn());
    assertEquals("PERSON_RELATIVES", fkPerson.getFkTable());

    assertEquals("ID", fkPerson.getPkColumn());
    assertEquals("PERSON", fkPerson.getPkTable());

    ForeignKey fkRelative = getForeignKey(joinTable, "FK_RELATIVE");
    assertEquals("RELATIVE_ID", fkRelative.getFkColumn());
    assertEquals("PERSON_RELATIVES", fkRelative.getFkTable());

    assertEquals("ID", fkRelative.getPkColumn());
    assertEquals("PERSON", fkRelative.getPkTable());
}

From source file:org.apache.tika.parser.jdbc.JDBCTableReader.java

private void handleCell(ResultSetMetaData rsmd, int i, ContentHandler handler, ParseContext context)
        throws SQLException, IOException, SAXException {
    switch (rsmd.getColumnType(i)) {
    case Types.BLOB:
        handleBlob(tableName, rsmd.getColumnName(i), rows, results, i, handler, context);
        break;/* w  w w.ja v a2 s.  c  o  m*/
    case Types.CLOB:
        handleClob(tableName, rsmd.getColumnName(i), rows, results, i, handler, context);
        break;
    case Types.BOOLEAN:
        handleBoolean(results, i, handler);
        break;
    case Types.DATE:
        handleDate(results, i, handler);
        break;
    case Types.TIMESTAMP:
        handleTimeStamp(results, i, handler);
        break;
    case Types.INTEGER:
        handleInteger(results, i, handler);
        break;
    case Types.FLOAT:
        //this is necessary to handle rounding issues in presentation
        //Should we just use getString(i)?
        float f = results.getFloat(i);
        if (!results.wasNull()) {
            addAllCharacters(Float.toString(f), handler);
        }
        break;
    case Types.DOUBLE:
        double d = results.getDouble(i);
        if (!results.wasNull()) {
            addAllCharacters(Double.toString(d), handler);
        }
        break;
    default:
        String s = results.getString(i);
        if (!results.wasNull()) {
            addAllCharacters(s, handler);
        }
        break;
    }
}

From source file:org.apache.ddlutils.platform.mssql.MSSqlPlatform.java

/**
 * Creates a new platform instance.//from ww w  . ja  v a  2  s.c o m
 */
public MSSqlPlatform() {
    PlatformInfo info = getPlatformInfo();

    info.setMaxIdentifierLength(128);
    info.setPrimaryKeyColumnAutomaticallyRequired(true);
    info.setIdentityColumnAutomaticallyRequired(true);
    info.setMultipleIdentityColumnsSupported(false);
    info.setSupportedOnUpdateActions(
            new CascadeActionEnum[] { CascadeActionEnum.CASCADE, CascadeActionEnum.NONE });
    info.addEquivalentOnUpdateActions(CascadeActionEnum.NONE, CascadeActionEnum.RESTRICT);
    info.setSupportedOnDeleteActions(
            new CascadeActionEnum[] { CascadeActionEnum.CASCADE, CascadeActionEnum.NONE });
    info.addEquivalentOnDeleteActions(CascadeActionEnum.NONE, CascadeActionEnum.RESTRICT);

    info.addNativeTypeMapping(Types.ARRAY, "IMAGE", Types.LONGVARBINARY);
    // BIGINT will be mapped back to BIGINT by the model reader 
    info.addNativeTypeMapping(Types.BIGINT, "DECIMAL(19,0)");
    info.addNativeTypeMapping(Types.BLOB, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.BOOLEAN, "BIT", Types.BIT);
    info.addNativeTypeMapping(Types.CLOB, "TEXT", Types.LONGVARCHAR);
    info.addNativeTypeMapping(Types.DATALINK, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DATE, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.DISTINCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.DOUBLE, "FLOAT", Types.FLOAT);
    info.addNativeTypeMapping(Types.INTEGER, "INT");
    info.addNativeTypeMapping(Types.JAVA_OBJECT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.LONGVARBINARY, "IMAGE");
    info.addNativeTypeMapping(Types.LONGVARCHAR, "TEXT");
    info.addNativeTypeMapping(Types.NULL, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.OTHER, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.REF, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.STRUCT, "IMAGE", Types.LONGVARBINARY);
    info.addNativeTypeMapping(Types.TIME, "DATETIME", Types.TIMESTAMP);
    info.addNativeTypeMapping(Types.TIMESTAMP, "DATETIME");
    info.addNativeTypeMapping(Types.TINYINT, "SMALLINT", Types.SMALLINT);

    info.setDefaultSize(Types.CHAR, 254);
    info.setDefaultSize(Types.VARCHAR, 254);
    info.setDefaultSize(Types.BINARY, 254);
    info.setDefaultSize(Types.VARBINARY, 254);

    setSqlBuilder(new MSSqlBuilder(this));
    setModelReader(new MSSqlModelReader(this));
}