Dear all:
When i use the method resultsetmetadata.getScale(int i) with hxttdbf jdbc driver. error occured . I debug it with jbuilerx:
public clsList getHeads(String table) {
clsList lstHeads = new clsList();
try {
Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
HxttDataSource ds = new HxttDataSource();
ds.setUrl("jdbc:dbf:/" + dir);
HxttRowSet rowSet = new HxttRowSet(ds);
rowSet.setCommand("select * from " + table);
rowSet.execute();
ResultSetMetaData rsmd = rowSet.getMetaData();
int iNumCols = rsmd.getColumnCount();
for (int i = 1; i <= iNumCols; i++) {
clsHashtable hHead = new clsHashtable();
hHead.put("columnLabel", rsmd.getColumnLabel(i));
hHead.put("columnName", rsmd.getColumnName(i));
hHead.put("columnType", rsmd.getColumnTypeName(i));
hHead.put("columnScale", String.valueOf(rsmd.getScale(i))); // this clause is skipped
hHead.put("columnDisplaySize", String.valueOf(rsmd.getColumnDisplaySize(i)));
lstHeads.add(hHead);
}
}
catch (Exception ex) {
ex.printStackTrace();
}
finally {
return lstHeads;
}
}
when I debug it with jbuiler , the clause is skipped:
hHead.put("columnScale", String.valueOf(rsmd.getScale(i)));
the program run to :
return lstHeads;
|
>when I debug it with jbuiler , the clause is skipped:
>hHead.put("columnScale", String.valueOf(rsmd.getScale(i)));
Passed test. What's your issue?
|
Thank you very much!
I find it out;The problem was caused by a older version hxttdbf jar;
|