due to buffer overlap it was dumping core
[csql.git] / src / jdbc / JdbcSqlParameterMetaData.java
blob3b32cb3dd8c8b0bf937d7c10567a51404043db7e
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
6 package csql.jdbc;
8 import java.sql.ParameterMetaData;
9 import java.sql.SQLException;
12 /**
14 * @author bijaya
16 public class JdbcSqlParameterMetaData extends JSqlError implements ParameterMetaData , JSqlErrorType
18 private boolean isClosed;
19 JdbcSqlStatement stmt;
21 JdbcSqlParameterMetaData()
23 isClosed = false ;
26 public void setStmt(JdbcSqlStatement stmt)
28 this.stmt = stmt;
29 this.isClosed = false ;
34 public String getParameterClassName(int param) throws SQLException
36 if(isClosed)
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
44 if(isClosed)
45 throw getException( CSQL_INVALID_STATE );
46 return (this.stmt.jniStmt.getTotalparam());
49 public int getParameterMode(int param) throws SQLException
51 if(isClosed)
52 throw getException( CSQL_INVALID_STATE );
53 return parameterModeIn;
56 public int getParameterType(int param) throws SQLException
58 if(isClosed)
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
67 if(isClosed)
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;
91 else
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);