3 import java
.sql
.Connection
;
4 import java
.sql
.Statement
;
5 import java
.sql
.SQLException
;
6 import java
.sql
.ResultSetMetaData
;
7 import java
.sql
.SQLWarning
;
9 public final class JdbcSqlResultSetMetaData
10 extends JSqlError
implements ResultSetMetaData
, JSqlErrorType
12 private boolean isClosed
;
13 JdbcSqlStatement stmt
; // This guy creates me
15 JdbcSqlResultSetMetaData()
19 void setStmt( JdbcSqlStatement s
)
25 public void close() throws SQLException
32 public int getColumnCount () throws SQLException
34 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
35 return( stmt
.jniStmt
.getNoOfFields() );
37 public int getColumnIndex (String name
) throws SQLException
39 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
40 throw getException( CSQL_NOT_SUPPORTED
);
41 //return( stmt.jniStmt.findColumn( name ) );
44 public String
getColumnName (int colNum
) throws SQLException
46 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
48 String name
= stmt
.jniStmt
.getFieldName( colNum
-1 );
51 public String
getColumnLabel (int colNum
) throws SQLException
53 return getColumnName( colNum
);
56 public boolean isReadOnly (int colNum
) throws SQLException
58 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
61 public boolean isWritable (int colNum
) throws SQLException
63 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
66 public boolean isDefinitelyWritable (int colNum
) throws SQLException
68 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
73 public String
getColumnClassName(int colNum
) throws SQLException
75 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
76 throw getException( CSQL_NOT_SUPPORTED
);
78 public int getColumnType (int colNum
) throws SQLException
//TODO
80 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
81 throw getException( CSQL_NOT_SUPPORTED
);
83 public String
getColumnTypeName (int colNum
) throws SQLException
//TODO
85 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
86 throw getException( CSQL_NOT_SUPPORTED
);
88 public boolean isCaseSensitive (int colNum
) throws SQLException
//TODO
90 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
93 public boolean isSigned (int colNum
) throws SQLException
//TODO
95 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
96 throw getException( CSQL_NOT_SUPPORTED
);
98 public int isNullable (int colNum
) throws SQLException
//TODO
100 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
101 throw getException( CSQL_NOT_SUPPORTED
);
103 public int getPrecision (int colNum
) throws SQLException
//TODO
105 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
106 throw getException( CSQL_NOT_SUPPORTED
);
108 public int getScale (int colNum
) throws SQLException
//TODO
110 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
111 throw getException( CSQL_NOT_SUPPORTED
);
113 public String
getSchemaName (int colNum
) throws SQLException
117 public String
getTableName (int colNum
) throws SQLException
122 // UN-SUPPORTED API's
123 public int getColumnDisplaySize (int colNum
) throws SQLException
127 public boolean isAutoIncrement (int colNum
) throws SQLException
131 public boolean isCurrency (int colNum
) throws SQLException
135 public String
getCatalogName (int colNum
) throws SQLException
139 public boolean isSearchable (int colNum
) throws SQLException
144 public boolean isWrapperFor(Class ifact
) throws SQLException
146 throw getException(CSQL_NOT_SUPPORTED
);
148 public Class
unwrap(Class iface
) throws SQLException
150 throw getException(CSQL_NOT_SUPPORTED
);