core reorg
[csql.git] / src / jdbc / JSqlStatement.java
blob7fb463e9ad8320f3784985bf2c2fce4e8bfaee80
1 package csql.jdbc;
2 import java.sql.Time;
3 import java.sql.Date;
4 import java.sql.Timestamp;
5 public class JSqlStatement
7 public long sqlStmtPtr;
9 public long getPtr()
11 return sqlStmtPtr;
13 public void setPtr( long ptr )
15 sqlStmtPtr = ptr;
18 // Wrappers Below
20 public native void alloc(int mode);
21 public native void free();
22 public native void freeStmt();
24 // Operations
25 public native void setConnectionPtr(long ptr);
26 public native int prepare( String statement );
27 public native boolean isSelect();
28 public native int execute();
29 public native long next(); //returns next tuple
30 public native long close(); //close the scan
32 // Parameters
33 public native void setShort( int pos, short value );
34 public native void setInt( int pos, int value );
35 public native void setLong( int pos, long value );
36 public native void setByte( int pos, byte value ); // TINYINT
37 public native void setFloat( int pos, float value );
38 public native void setDouble( int pos, double value );
39 public native void setString( int pos, String value );
40 public native void setDate( int pos, Date d );
41 public native void setTime( int pos, Time t );
42 public native void setTimestamp( int pos, Timestamp tms );
43 public native void setBoolean( int pos, boolean value ); //TODO
45 public native void setNull( int pos );
46 public native boolean isNull(int pos);
48 // To retrieve Field values
49 public native short getShort( int pos , int type);
50 public native int getInt( int pos,int type );
51 public native long getLong( int pos,int type );
52 public native byte getByte( int pos,int type ); // TINYINT
53 public native float getFloat( int pos, int type );
54 public native double getDouble( int pos, int type );
55 public native String getString( int pos, int type );
56 public native Date getDate( int pos, int type );
57 public native Time getTime( int pos, int type );
58 public native Timestamp getTimestamp( int pos, int type );
59 public native boolean getBoolean( int pos, int type );
60 //get value with field name
61 public native short getShortS( String fldName );
62 public native int getIntS( String fldName );
63 public native long getLongS( String fldName );
64 public native byte getByteS( String fldName ); // TINYINT
65 public native float getFloatS( String fldName );
66 public native double getDoubleS( String fldName );
67 public native String getStringS( String fldName );
68 public native Date getDateS( String fldName );
69 public native Time getTimeS( String fldName );
70 public native Timestamp getTimestampS( String fldName );
71 public native boolean getBooleanS( String fldName );
73 // ResultSet
74 public native int findColumn( String str );
75 public native int getNoOfFields();
76 public native String getFieldName( int pos );
77 public native int[] getProjFldTypeArray();
79 // ResultSetMetaData
80 public native int getTotalProjFld();
81 public native int getProjFldType(int pos);
82 public native boolean isFldNullable(int pos);
83 public native String getProjFldName(int pos);
84 public native String getTableName();
85 //ParameterMetaData
86 public native String getParamFldName(int param);
87 public native int getTotalparam();
88 public native int getType(int param);
89 public native boolean isNullable(int pos);
91 //Callable statement.
92 public native int executePro();
93 public native int preparePro(String statemnt);
94 public native long nextSet();