4 import java
.sql
.SQLException
;
5 import java
.sql
.ResultSetMetaData
;
8 public final class JdbcSqlResultSetMetaData
9 extends JSqlError
implements ResultSetMetaData
, JSqlErrorType
11 private boolean isClosed
;
12 JdbcSqlStatement stmt
; // This guy creates me
14 JdbcSqlResultSetMetaData()
18 void setStmt( JdbcSqlStatement s
)
24 public void close() throws SQLException
31 public int getColumnCount () throws SQLException
33 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
34 return( stmt
.jniStmt
.getTotalProjFld() );
36 public int getColumnIndex (String name
) throws SQLException
38 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
39 return( stmt
.jniStmt
.findColumn( name
) );//TO DO
42 public String
getColumnName (int colNum
) throws SQLException
44 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
46 String name
= stmt
.jniStmt
.getProjFldName(colNum
);
49 public String
getColumnLabel (int colNum
) throws SQLException
51 return getColumnName( colNum
);
54 public boolean isReadOnly (int colNum
) throws SQLException
56 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
59 public boolean isWritable (int colNum
) throws SQLException
61 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
64 public boolean isDefinitelyWritable (int colNum
) throws SQLException
66 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
71 public String
getColumnClassName(int colNum
) throws SQLException
73 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
74 return Util
.getClassName(this.stmt
.jniStmt
.getProjFldType(colNum
));
77 public int getColumnType (int colNum
) throws SQLException
79 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
80 return Util
.getType(this.stmt
.jniStmt
.getProjFldType(colNum
));
82 public String
getColumnTypeName (int colNum
) throws SQLException
84 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
85 return Util
.getTypeName(this.stmt
.jniStmt
.getProjFldType(colNum
));
87 public boolean isCaseSensitive (int colNum
) throws SQLException
89 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
93 public int isNullable (int colNum
) throws SQLException
95 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
96 if (this.stmt
.jniStmt
.isFldNullable(colNum
))
97 return JdbcSqlResultSetMetaData
.columnNoNulls
;
99 return JdbcSqlResultSetMetaData
.columnNullable
;
102 public String
getTableName (int colNum
) throws SQLException
104 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
107 public boolean isSigned (int colNum
) throws SQLException
109 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
110 throw getException( CSQL_NOT_SUPPORTED
);
112 public int getPrecision (int colNum
) throws SQLException
//TODO
114 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
115 throw getException( CSQL_NOT_SUPPORTED
);
117 public int getScale (int colNum
) throws SQLException
//TODO
119 if( isClosed
) throw getException( CSQL_INVALID_STATE
);
120 throw getException( CSQL_NOT_SUPPORTED
);
122 public String
getSchemaName (int colNum
) throws SQLException
128 // UN-SUPPORTED API's
129 public int getColumnDisplaySize (int colNum
) throws SQLException
133 public boolean isAutoIncrement (int colNum
) throws SQLException
137 public boolean isCurrency (int colNum
) throws SQLException
141 public String
getCatalogName (int colNum
) throws SQLException
145 public boolean isSearchable (int colNum
) throws SQLException
150 public boolean isWrapperFor(Class ifact
) throws SQLException
152 throw getException(CSQL_NOT_SUPPORTED
);
154 public Class
unwrap(Class iface
) throws SQLException
156 throw getException(CSQL_NOT_SUPPORTED
);