11 public enum MysqlOption{
44 if (bloaded ==
false){
56 Pointer cdecl ado_alloc(
String driver,
String host,
int port,
String name,
String pwd,
int timeout, ObjectPtr, ObjectRef);
57 void cdecl ado_delloc(Pointer);
58 Pointer cdecl ado_execute(Pointer,
String sql,
bool needrs, ObjectPtr, ObjectRef);
59 void cdecl ado_delloc_rs(Pointer);
61 bool cdecl ado_rs_next(Pointer);
62 bool cdecl ado_rs_prev(Pointer);
64 bool cdecl ado_rs_first(Pointer);
65 bool cdecl ado_rs_last(Pointer);
66 int cdecl ado_rs_count(Pointer);
67 bool cdecl ado_rs_iseof(Pointer);
70 int cdecl ado_rs_getValueI(Pointer,
String);
71 long cdecl ado_rs_getValueL(Pointer,
String);
72 double cdecl ado_rs_getValueD(Pointer,
String);
74 Object cdecl ado_rs_getIValue(Pointer,
int);
75 int cdecl ado_rs_getIValueI(Pointer,
int);
76 long cdecl ado_rs_getIValueL(Pointer,
int);
77 double cdecl ado_rs_getIValueD(Pointer,
int);
81 public static class AdoResultSet :
Sql.ResultSet{
89 return Helper.ado_rs_first(hres);
92 public bool last()
override{
93 return Helper.ado_rs_last(hres);
96 public bool next()
override{
97 return Helper.ado_rs_next(hres);
101 return Helper.ado_rs_prev(hres);
115 return Helper.ado_rs_iseof(hres);
123 return Helper.ado_rs_getValueI(hres, columnlabel);
127 return Helper.ado_rs_getValueL(hres, columnlabel);
131 return Helper.ado_rs_getValueD(hres, columnlabel);
135 return Helper.ado_rs_getValueI(hres, columnlabel);
139 return Helper.ado_rs_getValueI(hres, columnlabel) != 0;
143 return (
String)Helper.ado_rs_getValue(hres, columnlabel);
146 public int getInt(
int columnIndex)
override{
147 return Helper.ado_rs_getIValueI(hres, columnIndex);
151 return Helper.ado_rs_getIValueL(hres, columnIndex);
155 return Helper.ado_rs_getIValueD(hres, columnIndex);
159 return Helper.ado_rs_getIValueI(hres, columnIndex);
163 return Helper.ado_rs_getIValueI(hres, columnIndex) != 0;
167 return (
String)Helper.ado_rs_getIValue(hres, columnIndex);
186 return Helper.ado_rs_count(hres);
196 Helper.ado_delloc_rs(hres);
206 static class AdoStatement :
Sql.Statement{
217 long hrs = Helper.ado_execute(__ado.
hAdo,sql,
false, errcode, errmsg);
221 Helper.ado_delloc_rs(hrs);
226 throw new SqlException(-1,
"get_changes");
232 long hrs = Helper.ado_execute(__ado.
hAdo,sql,
true, errcode, errmsg);
236 return new AdoResultSet(hrs);
242 long hrs = Helper.ado_execute(__ado.
hAdo,sql,
false, errcode, errmsg);
246 Helper.ado_delloc_rs(hrs);
257 public class AdoPreparedStatement :
Sql.PreparedStatement{
268 long hrs = Helper.ado_execute(__ado.
hAdo,sql,
false, errcode, errmsg);
272 Helper.ado_delloc_rs(hrs);
280 long hrs = Helper.ado_execute(__ado.
hAdo,sql,
false, errcode, errmsg);
284 return new AdoResultSet(hrs);
290 long hrs = Helper.ado_execute(__ado.
hAdo,sql,
false, errcode, errmsg);
294 Helper.ado_delloc_rs(hrs);
310 Helper.ado_delloc(
hAdo);
374 case MysqlOption.PORT:
377 case MysqlOption.TIMEOUT:
387 return new AdoStatement(
this);
391 return new AdoPreparedStatement(
this, sql);
static final int getPlatformId()
static final void output(String)
int execute(String sql) override
AdoPreparedStatement(AdoConnector m, String sql)
Sql.ResultSet executeQuery(String sql) override
int executeUpdate(String sql) override
Sql.ResultSet getResult() override
String getString(int columnIndex) override
String getString(String columnlabel) override
bool getBoolean(int columnIndex) override
int getColumnCount() override
double getDouble(String columnlabel) override
long getRowCount() override
int getInt(String columnlabel) override
long getLong(int columnIndex) override
int findColumn(String) override
double getDouble(int columnIndex) override
String getColumnName(int i)
byte getByte(String columnlabel) override
long getLong(String columnlabel) override
bool getBoolean(String columnlabel) override
byte getByte(int columnIndex) override
int getInt(int columnIndex) override
int get_changes() override
int execute(String sql) override
Sql.ResultSet executeQuery(String sql) override
int executeUpdate(String sql) override
AdoStatement(AdoConnector m)
Sql.ResultSet getResult() override
int getErrorCode() override
void create(String uri, String username, String pwd) override
Object getOption(int opt) override
void setDriver(String strDrv)
Sql.Statement createStatement() override
Sql.PreparedStatement prepareStatement(String sql) override
void setOption(int opt, Object option) override
String getError() override
final String getMessage()
static final void loadLibrary(String)