src/csip/sdm/SDMResultSet.java
@@ -47,6 +47,7 @@ |
int rowId; |
int maxRows; |
SDMStatement statement; |
+ SDMResultSetMetaData resultSetMetaData = new SDMResultSetMetaData(this); |
|
/** |
* The "lastReadNull" is vital to calling programs. Many test if the last |
@@ -284,6 +285,19 @@ |
throw new SQLFeatureNotSupportedException("Operation not supported."); //To change body of generated methods, choose Tools | Templates. |
} |
|
+ public int getColumnCount() { |
+ int ret_val = 0; |
+ if ((null != columns) && !columns.isEmpty()) { |
+ ret_val = columns.size(); |
+ } |
+ |
+ return ret_val; |
+ } |
+ |
+ public String getColumnName(int index) throws SQLException { |
+ return findName(index); |
+ } |
+ |
@Override |
public int getConcurrency() throws SQLException { |
throw new SQLFeatureNotSupportedException("Operation not supported."); //To change body of generated methods, choose Tools | Templates. |
@@ -384,8 +398,8 @@ |
} |
|
@Override |
- public ResultSetMetaData getMetaData() throws SQLException { |
- throw new SQLFeatureNotSupportedException("Operation not supported."); //To change body of generated methods, choose Tools | Templates. |
+ public ResultSetMetaData getMetaData() throws SQLException { |
+ return this.resultSetMetaData; |
} |
|
@Override |
@@ -677,12 +691,12 @@ |
|
@Override |
public boolean rowInserted() throws SQLException { |
- return false; |
+ return false; |
} |
|
@Override |
public boolean rowUpdated() throws SQLException { |
- return false; |
+ return false; |
} |
|
@Override |
@@ -1124,6 +1138,21 @@ |
return null; |
} |
|
+ private String findName(int index) throws SQLException { |
+ String ret_val = null; |
+ if ((index <= columns.size()) && (index > 0)) { |
+ for (String key : columns.keySet()) { |
+ if (columns.get(key) == (index-1)) { |
+ ret_val = key; |
+ } |
+ } |
+ } else { |
+ throw new SQLException("Invalid column index."); |
+ } |
+ |
+ return ret_val; |
+ } |
+ |
private class ResultRow { |
|
private final JSONArray values; |