1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 package com.sun.star.sdbcx.comp.postgresql;
23 
24 import com.sun.star.lib.uno.helper.WeakBase;
25 import com.sun.star.sdbc.DataType;
26 import com.sun.star.sdbc.SQLException;
27 import com.sun.star.sdbc.XResultSetMetaData;
28 
29 public class PostgresqlResultSetMetaData extends WeakBase implements XResultSetMetaData {
30 
31     private XResultSetMetaData impl;
32 
PostgresqlResultSetMetaData(XResultSetMetaData impl)33     public PostgresqlResultSetMetaData(XResultSetMetaData impl) {
34         this.impl = impl;
35     }
36 
getCatalogName(int arg0)37     public String getCatalogName(int arg0) throws SQLException {
38         return impl.getCatalogName(arg0);
39     }
40 
getColumnCount()41     public int getColumnCount() throws SQLException {
42         return impl.getColumnCount();
43     }
44 
getColumnDisplaySize(int arg0)45     public int getColumnDisplaySize(int arg0) throws SQLException {
46         return impl.getColumnDisplaySize(arg0);
47     }
48 
getColumnLabel(int arg0)49     public String getColumnLabel(int arg0) throws SQLException {
50         return impl.getColumnLabel(arg0);
51     }
52 
getColumnName(int arg0)53     public String getColumnName(int arg0) throws SQLException {
54         return impl.getColumnName(arg0);
55     }
56 
getColumnServiceName(int arg0)57     public String getColumnServiceName(int arg0) throws SQLException {
58         return impl.getColumnServiceName(arg0);
59     }
60 
getColumnType(int column)61     public int getColumnType(int column) throws SQLException {
62         int columnType = impl.getColumnType(column);
63         if (columnType == DataType.BIT) {
64             String columnName = getColumnTypeName(column);
65             if (columnName.equals("bool")) {
66                 columnType = DataType.BOOLEAN;
67             }
68         }
69         return columnType;
70     }
71 
getColumnTypeName(int column)72     public String getColumnTypeName(int column) throws SQLException {
73         return impl.getColumnTypeName(column);
74     }
75 
getPrecision(int arg0)76     public int getPrecision(int arg0) throws SQLException {
77         return impl.getPrecision(arg0);
78     }
79 
getScale(int arg0)80     public int getScale(int arg0) throws SQLException {
81         return impl.getScale(arg0);
82     }
83 
getSchemaName(int arg0)84     public String getSchemaName(int arg0) throws SQLException {
85         return impl.getSchemaName(arg0);
86     }
87 
getTableName(int arg0)88     public String getTableName(int arg0) throws SQLException {
89         return impl.getTableName(arg0);
90     }
91 
isAutoIncrement(int arg0)92     public boolean isAutoIncrement(int arg0) throws SQLException {
93         return impl.isAutoIncrement(arg0);
94     }
95 
isCaseSensitive(int arg0)96     public boolean isCaseSensitive(int arg0) throws SQLException {
97         return impl.isCaseSensitive(arg0);
98     }
99 
isCurrency(int arg0)100     public boolean isCurrency(int arg0) throws SQLException {
101         return impl.isCurrency(arg0);
102     }
103 
isDefinitelyWritable(int arg0)104     public boolean isDefinitelyWritable(int arg0) throws SQLException {
105         return impl.isDefinitelyWritable(arg0);
106     }
107 
isNullable(int arg0)108     public int isNullable(int arg0) throws SQLException {
109         return impl.isNullable(arg0);
110     }
111 
isReadOnly(int arg0)112     public boolean isReadOnly(int arg0) throws SQLException {
113         return impl.isReadOnly(arg0);
114     }
115 
isSearchable(int arg0)116     public boolean isSearchable(int arg0) throws SQLException {
117         return impl.isSearchable(arg0);
118     }
119 
isSigned(int arg0)120     public boolean isSigned(int arg0) throws SQLException {
121         return impl.isSigned(arg0);
122     }
123 
isWritable(int arg0)124     public boolean isWritable(int arg0) throws SQLException {
125         return impl.isWritable(arg0);
126     }
127 }
128