Skip to content

Commit b054fb3

Browse files
committed
Implement DatabaseMetaData.getCatalogs()
1 parent 2d9ee0f commit b054fb3

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,14 +1825,7 @@ public java.sql.ResultSet getSchemas() throws SQLException
18251825
*/
18261826
public java.sql.ResultSet getCatalogs() throws SQLException
18271827
{
1828-
// We don't use catalogs, so we simply return a single catalog name "".
1829-
Field f[] = new Field[1];
1830-
Vector v = new Vector();
1831-
byte[][] tuple = new byte[1][0];
1832-
f[0] = new Field(connection,"TABLE_CAT",iVarcharOid,32);
1833-
tuple[0] = "".getBytes();
1834-
v.addElement(tuple);
1835-
return new ResultSet(connection,f,v,"OK",1);
1828+
return connection.createStatement().executeQuery("select datname as TABLE_CAT from pg_database;");
18361829
}
18371830

18381831
/**

src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,14 +1825,7 @@ public java.sql.ResultSet getSchemas() throws SQLException
18251825
*/
18261826
public java.sql.ResultSet getCatalogs() throws SQLException
18271827
{
1828-
// We don't use catalogs, so we simply return a single catalog name "".
1829-
Field f[] = new Field[1];
1830-
Vector v = new Vector();
1831-
byte[][] tuple = new byte[1][0];
1832-
f[0] = new Field(connection,"TABLE_CAT",iVarcharOid,32);
1833-
tuple[0] = "".getBytes();
1834-
v.addElement(tuple);
1835-
return new ResultSet(connection,f,v,"OK",1);
1828+
return connection.createStatement().executeQuery("select datname as TABLE_CAT from pg_database;");
18361829
}
18371830

18381831
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy