2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
8 import java
.sql
.ParameterMetaData
;
9 import java
.sql
.SQLException
;
16 public class JdbcSqlParameterMetaData
extends JSqlError
implements ParameterMetaData
, JSqlErrorType
18 private boolean isClosed
;
19 JdbcSqlStatement stmt
;
21 JdbcSqlParameterMetaData()
26 public void setStmt(JdbcSqlStatement stmt
)
29 this.isClosed
= false ;
34 public String
getParameterClassName(int param
) throws SQLException
37 throw getException( CSQL_INVALID_STATE
);
38 //String name = this.stmt.jniStmt.getParamFldName(param);
39 //int pos =stmt.jniStmt.findColumn(name);
40 return Util
.getClassName(this.stmt
.jniStmt
.getType(param
));
42 public int getParameterCount() throws SQLException
45 throw getException( CSQL_INVALID_STATE
);
46 return (this.stmt
.jniStmt
.getTotalparam());
49 public int getParameterMode(int param
) throws SQLException
52 throw getException( CSQL_INVALID_STATE
);
53 return parameterModeIn
;
56 public int getParameterType(int param
) throws SQLException
59 throw getException( CSQL_INVALID_STATE
);
60 //String name = this.stmt.jniStmt.getParamFldName(param);
61 //int pos =stmt.jniStmt.findColumn(name);
62 return Util
.getType(this.stmt
.jniStmt
.getType(param
));
65 public String
getParameterTypeName(int param
) throws SQLException
68 throw getException( CSQL_INVALID_STATE
);
69 //String name = this.stmt.jniStmt.getParamFldName(param);
70 //int pos =stmt.jniStmt.findColumn(name);
71 return Util
.getTypeName(this.stmt
.jniStmt
.getType(param
));
74 public int getPrecision(int param
) throws SQLException
76 throw getException( CSQL_NOT_SUPPORTED
);
79 public int getScale(int param
) throws SQLException
81 throw getException( CSQL_NOT_SUPPORTED
);
85 public int isNullable(int param
) throws SQLException
87 // String name = stmt.jniStmt.getParamFldName(param);
88 //int pos =stmt.jniStmt.findColumn(name);
89 if(this.stmt
.jniStmt
.isNullable(param
))
90 return JdbcSqlParameterMetaData
.parameterNoNulls
;
92 return JdbcSqlParameterMetaData
.parameterNullable
;
95 public boolean isSigned(int param
) throws SQLException
97 throw getException( CSQL_NOT_SUPPORTED
);
100 public boolean isWrapperFor(Class ifact
) throws SQLException
102 throw getException(CSQL_NOT_SUPPORTED
);
104 public Class
unwrap(Class iface
) throws SQLException
106 throw getException(CSQL_NOT_SUPPORTED
);