blob: f5465e4552e113a103d1ba79a5a3cf139167afcc [file] [log] [blame]
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
.. _`JDBC specification`:
.. _`Chapter 9: Mapping SQL and Java Types`:
.. _`JDBC Technology Guide: Getting Started`:
Database support
DdlUtils accesses databases via JDBC, esp. the metadata that JDBC provides, as well as by
accessing database specific tables and performing database specific SQL. The details of the
latter can be found in the support documentation for the individual databases.
The main source of information about JDBC is the `JDBC Specification`_, currently for JDBC
version 3. General information about the JDBC datatypes can also be found in
`Chapter 9: Mapping SQL and Java Types`_ of the
`JDBC Technology Guide: Getting Started`_. Please also note that some JDBC types are only
available in recent versions of the Java platform, e.g. the ``BOOLEAN`` type is only
available since J2SE version 1.4. These will be usable with DdlUtils only if you're running
the respective Java version or a newer one.
Here is a short summary of the information about the JDBC data types:
Represents an array
64 bit signed integer (-9223372036854775808 to 9223372036854775807)
Binary data, 254 bytes max
0 or 1
Binary data
Boolean type (``true``, ``false``) in Java 1.4 and above
Fixed length character data, 254 bytes of 8-bit characters max
Character data
References a file outside of the database but that is managed by it. Maps to ````.
Only available in Java 1.4 and above.
Year, month, day
Fixed point number, 15 bits for precision (total number of digits) and for scale (number of digits after the decimal point)
Represents a distinct value, totally database/JDBC driver dependent
Floating point number, 15 bits of mantissa (fractional part)
Floating point number, 15 bits of mantissa (fractional part)
32 bit signed integer (-2147483648 to 2147483647)
Represents an java object, usually a serialized one
Binary data, up to 1 GB
Character data, up to 1 GB (8-bit characters)
Is not specified in detail
Usually the same as ``DECIMAL``
Entirely database-specific type
Floating point number, 7 bits of mantissa (fractional part)
Represents a reference to an instance of a SQL structured type. Maps to ``java.sql.Ref``.
16 bit signed integer (-32768 to 32767)
Represents a structured type, usually created via CREATE TYPE. Maps to ``java.sql.Struct``.
Hours, minutes, seconds
Year, month, day, hours, minutes, seconds, nanoseconds
8 bit signed or unsigned integer, -128 to 127 (8 bit signed) or 0 to 254 (8 bit unsigned)
Binary data, up to 254 bytes
Character data, up to 254 bytes (8-bit characters)