e248. creating a mysql table to store java types.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 26 行
TXT
26 行
This example creates a MySQL table called mysql_all_table to store Java types.
try {
Statement stmt = connection.createStatement();
String sql = "CREATE TABLE mysql_all_table("
+ "col_boolean BOOL, " // boolean
+ "col_byte TINYINT, " // byte
+ "col_short SMALLINT, " // short
+ "col_int INTEGER, " // int
+ "col_long BIGINT, " // long
+ "col_float FLOAT, " // float
+ "col_double DOUBLE PRECISION, " // double
+ "col_bigdecimal DECIMAL(13,0), " // BigDecimal
+ "col_string VARCHAR(254), " // String
+ "col_date DATE, " // Date
+ "col_time TIME, " // Time
+ "col_timestamp TIMESTAMP, " // Timestamp
+ "col_asciistream TEXT, " // AsciiStream (< 2^16 bytes)
+ "col_binarystream LONGBLOB, " // BinaryStream (< 2^32 bytes)
+ "col_blob BLOB)"; // Blob (< 2^16 bytes)
stmt.executeUpdate(sql);
} catch (SQLException e) {
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?