Re: getColumns()

Поиск
Список
Период
Сортировка
От Auri Mason
Тема Re: getColumns()
Дата
Msg-id Pine.LNX.4.44.0204040907200.6208-100000@mendeleev.syntrex.com
обсуждение исходный текст
Ответ на Re: getColumns()  (Dave Cramer <dave@fastcrypt.com>)
Ответы Re: getColumns()
Список pgsql-jdbc
Hi Dave,

As far as you known it works? Sounds good!

BTW, I'm using Postgresql 7.1.3 and the 'incriminated' code is:

####### Code example ########
...
        private DatabaseMetaData dma;
        private Connection dbCon;
...
        /**
                the schema is set to "%"
        */
        public void setSchema(String schema) {
                this.schema = schema;
        }
        /**
        * This function is used to get the current used schema name to
perform table and fields checks in the right schema.
        private String getSchema() {
                return schema;
        }

        private String getCatalog() throws SQLException {
                String catalog = dbCon.getCatalog();
                if (catalog != null && catalog.length() == 0) {
                        catalog = null;
                }
                return catalog;
        }
...
  public int getFieldSize(String tableName, String fieldName, String
schema) throws BDEException {
                int ret = -1;
                try {
//->>>>>>>>>>>>the following returns no rows!
                        ResultSet rs = dma.getColumns(getCatalog(),
getSchema(), tableName.toUpperCase(),
fieldName.toUpperCase());

                        rs.next();
//So this throws an exception...
                        ret = rs.getInt("COLUMN_SIZE");
                } catch (Exception e) {
                        trace.fail(e);
                }
//...and this returns null
                return ret;
        }
############# EO Code sample ############

TIA, Auri


On 3 Apr 2002, Dave Cramer wrote:

> Auri,
>
> AFAIK this works, can you give me specifics?
>
> ie db version, columns, code sample, etc.
>
> Dave


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: getColumns()
Следующее
От: "Jose Javier Gutierrez"
Дата:
Сообщение: Re: getColumns()