KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > h2 > result > ResultColumn


1 /*
2  * Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
3  * Initial Developer: H2 Group
4  */

5 package org.h2.result;
6
7 import java.io.IOException JavaDoc;
8
9 import org.h2.value.Transfer;
10
11 /**
12  * @author Thomas
13  */

14 public class ResultColumn {
15     String JavaDoc alias;
16     String JavaDoc schemaName;
17     String JavaDoc tableName;
18     String JavaDoc columnName;
19     int columnType;
20     long precision;
21     int scale;
22     int displaySize;
23     boolean autoIncrement;
24     int nullable;
25
26     ResultColumn(Transfer in) throws IOException JavaDoc {
27         alias = in.readString();
28         schemaName = in.readString();
29         tableName = in.readString();
30         columnName = in.readString();
31         columnType = in.readInt();
32         precision = in.readLong();
33         scale = in.readInt();
34         displaySize = in.readInt();
35         autoIncrement = in.readBoolean();
36         nullable = in.readInt();
37     }
38
39     public static void writeColumn(Transfer out, ResultInterface result, int i) throws IOException JavaDoc {
40         out.writeString(result.getAlias(i));
41         out.writeString(result.getSchemaName(i));
42         out.writeString(result.getTableName(i));
43         out.writeString(result.getColumnName(i));
44         out.writeInt(result.getColumnType(i));
45         out.writeLong(result.getColumnPrecision(i));
46         out.writeInt(result.getColumnScale(i));
47         out.writeInt(result.getDisplaySize(i));
48         out.writeBoolean(result.isAutoIncrement(i));
49         out.writeInt(result.getNullable(i));
50     }
51 }
52
Popular Tags