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