Hitachi

Hitachi Advanced Database Application Development Guide


8.8.5 getColumnDisplaySize(int column)

Organization of this subsection

(1) Function

This method acquires a specified column's maximum width (in characters).

(2) Format

public synchronized int getColumnDisplaySize(int column) throws SQLException

(3) Arguments

int column

Specifies a column number (where the first column is 1).

(4) Return value

The method returns the maximum width in characters. The following table shows the return values of the getColumnDisplaySize method.

Table 8‒78: Return values of the getColumnDisplaySize method

Column's data type (HADB data type)

Return value (maximum number of characters)

BIGINT

20

INTEGER#2

11

SMALLINT#3

6

DOUBLE PRECISION

FLOAT

23

REAL

13

DECIMAL(m,n)

NUMERIC(m,n)

m + 2

CHAR(n)

VARCHAR(n)

n

STRING

32,000,000

DATE

10

TIME(p)

p = 0: 8

p > 0: 8 + (p + 1)

TIMESTAMP(p) WITHOUT TIME ZONE

p = 0: 19

p > 0: 19 + (p + 1)

TIMESTAMP(p) WITH TIME ZONE

p = 0: 25

p > 0: 25 + (p + 1)

BINARY(n)

VARBINARY(n)

n × 2

ROW

row-length#1

BOOLEAN

5

UUID

36

#1

Sum of the data lengths of all columns. For details about how to obtain a column's data length, see the topic List of data types in the manual HADB SQL Reference.

#2

If the integer data type format is in legacy format, 20 is returned.

#3

If the integer data type format is in legacy format, 11 is returned.

(5) Exceptions

If the specified column value is 0 or less, or is greater than the number of columns in the table, the JDBC driver throws an SQLException.