Java SQL Type createAllTypesTable(Connection conn)

Here you can find the source of createAllTypesTable(Connection conn)

Description

Following several methods are setup and tearDown methods for ALL_TYPES table.

License

Open Source License

Declaration

public static void createAllTypesTable(Connection conn) throws SQLException 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.sql.Connection;

import java.sql.SQLException;
import java.sql.Statement;

public class Main {
    /**//from   www  .  j a v a2s . c  o m
     * Following several methods are setup and tearDown methods for ALL_TYPES table.
     * ALL_TYPES tables contains columns for each data type available in Derby DB
     * This is required to test conversion between SQL -> JDBC -> Avro data types
     */
    public static void createAllTypesTable(Connection conn) throws SQLException {
        try (Statement statement = conn.createStatement()) {
            statement.execute(
                    "create table ALL_TYPES (SMALL_INT_COL smallint, INT_COL integer, BIG_INT_COL bigint, REAL_COL real, DOUBLE_COL double,"
                            + "DECIMAL_COL decimal(20,10), CHAR_COL char(4), VARCHAR_COL varchar(8), BLOB_COL blob(16), CLOB_COL clob(16), DATE_COL date,"
                            + "TIME_COL time, TIMESTAMP_COL timestamp, BOOLEAN_COL boolean)");
        }
    }
}

Related

  1. convertToProperty(Object value)
  2. convertToStream(final Object o)
  3. convertToString(int datatype)
  4. convertType(final int type)
  5. convertType(final int type, final String typeName)
  6. createArrTypSql(String[] arr)
  7. createSignature(Method m)
  8. createSqlDataType(@Nonnull final String javaDataType)
  9. createTable2()