Commit b054fb3b authored by Peter Eisentraut's avatar Peter Eisentraut

Implement DatabaseMetaData.getCatalogs()

parent 2d9ee0fc
...@@ -1825,14 +1825,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData ...@@ -1825,14 +1825,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/ */
public java.sql.ResultSet getCatalogs() throws SQLException public java.sql.ResultSet getCatalogs() throws SQLException
{ {
// We don't use catalogs, so we simply return a single catalog name "". return connection.createStatement().executeQuery("select datname as TABLE_CAT from pg_database;");
Field f[] = new Field[1];
Vector v = new Vector();
byte[][] tuple = new byte[1][0];
f[0] = new Field(connection,"TABLE_CAT",iVarcharOid,32);
tuple[0] = "".getBytes();
v.addElement(tuple);
return new ResultSet(connection,f,v,"OK",1);
} }
/** /**
......
...@@ -1825,14 +1825,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData ...@@ -1825,14 +1825,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/ */
public java.sql.ResultSet getCatalogs() throws SQLException public java.sql.ResultSet getCatalogs() throws SQLException
{ {
// We don't use catalogs, so we simply return a single catalog name "". return connection.createStatement().executeQuery("select datname as TABLE_CAT from pg_database;");
Field f[] = new Field[1];
Vector v = new Vector();
byte[][] tuple = new byte[1][0];
f[0] = new Field(connection,"TABLE_CAT",iVarcharOid,32);
tuple[0] = "".getBytes();
v.addElement(tuple);
return new ResultSet(connection,f,v,"OK",1);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment