01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.result;
07:
08: import java.io.IOException;
09:
10: import org.h2.value.Transfer;
11:
12: /**
13: * A result set column of a remote result.
14: */
15: public class ResultColumn {
16: String alias;
17: String schemaName;
18: String tableName;
19: String columnName;
20: int columnType;
21: long precision;
22: int scale;
23: int displaySize;
24: boolean autoIncrement;
25: int nullable;
26:
27: ResultColumn(Transfer in) throws IOException {
28: alias = in.readString();
29: schemaName = in.readString();
30: tableName = in.readString();
31: columnName = in.readString();
32: columnType = in.readInt();
33: precision = in.readLong();
34: scale = in.readInt();
35: displaySize = in.readInt();
36: autoIncrement = in.readBoolean();
37: nullable = in.readInt();
38: }
39:
40: public static void writeColumn(Transfer out,
41: ResultInterface result, int i) throws IOException {
42: out.writeString(result.getAlias(i));
43: out.writeString(result.getSchemaName(i));
44: out.writeString(result.getTableName(i));
45: out.writeString(result.getColumnName(i));
46: out.writeInt(result.getColumnType(i));
47: out.writeLong(result.getColumnPrecision(i));
48: out.writeInt(result.getColumnScale(i));
49: out.writeInt(result.getDisplaySize(i));
50: out.writeBoolean(result.isAutoIncrement(i));
51: out.writeInt(result.getNullable(i));
52: }
53: }
|