64 bit build fix
[csql.git] / src / jdbc / JdbcSqlParameterMetaData.java
blobba2dfcc195c99b4d5ccc44358d6b5cb5096a254a
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 if (JSqlError.isDebug) System.out.println("JdbcSqlParameterMetaData::getPrecision called");
77 throw getException( CSQL_NOT_SUPPORTED );
80 public int getScale(int param) throws SQLException
82 if (JSqlError.isDebug) System.out.println("JdbcSqlParameterMetaData::getScale called");
83 throw getException( CSQL_NOT_SUPPORTED );
87 public int isNullable(int param) throws SQLException
89 // String name = stmt.jniStmt.getParamFldName(param);
90 //int pos =stmt.jniStmt.findColumn(name);
91 if(this.stmt.jniStmt.isNullable(param))
92 return JdbcSqlParameterMetaData.parameterNoNulls;
93 else
94 return JdbcSqlParameterMetaData.parameterNullable ;
97 public boolean isSigned(int param) throws SQLException
99 if (JSqlError.isDebug) System.out.println("JdbcSqlParameterMetaData::isSigned called");
100 throw getException( CSQL_NOT_SUPPORTED );
103 public boolean isWrapperFor(Class ifact) throws SQLException
105 if (JSqlError.isDebug) System.out.println("JdbcSqlParameterMetaData::isWrapperFor called");
106 throw getException(CSQL_NOT_SUPPORTED);
108 public Class unwrap(Class iface) throws SQLException
110 if (JSqlError.isDebug) System.out.println("JdbcSqlParameterMetaData::unwrap called");
111 throw getException(CSQL_NOT_SUPPORTED);