Skip site navigation (1) Skip section navigation (2)

Re: BUG #6293: JDBC driver performance

From: Teun Hoogendoorn <th(at)atsc(dot)nl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6293: JDBC driver performance
Date: 2011-11-17 11:12:51
Message-ID: (view raw or whole thread)
Lists: pgsql-bugs
Hi Kris,
This is exactly what I'm doing. I understand your solution, but that's
not really an option for me (I have to change a lot of code). 

Maybe the driver can cache the ResultSetMetaData for the ResultSet?
BTW. I looked into the driver code to look for a solution for my problem. 
I came
across the following lines of code (in

Statement stmt = connection.createStatement();
        ResultSet rs = stmt.executeQuery(sql.toString());
        while ( {
            int table = rs.getInt(1);
            int column = rs.getInt(2);
            String columnName = rs.getString(3);
            String tableName = rs.getString(4);
            String schemaName = rs.getString(5);
            int nullable = rs.getBoolean(6) ? 
ResultSetMetaData.columnNoNulls : ResultSetMetaData.columnNullable;
            boolean autoIncrement = rs.getBoolean(7);
            for (int i=0; i<fields.length; i++) {
                if (fields[i].getTableOid() == table && 
fields[i].getPositionInTable() == column) {

Shouldn't this ResultSet/Statement be closed?
Teun Hoogendoorn

pgsql-bugs by date

Next:From: Robert HaasDate: 2011-11-17 15:11:11
Subject: Re: ST_Distance Issue
Previous:From: Archana Sachin GhagDate: 2011-11-17 09:29:10
Subject: ST_Distance Issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group