xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
结构体 | Public 成员函数 | 静态 Public 成员函数 | 包函数 | 包属性 | 静态包属性
SQLCipher类 参考
类 SQLCipher 继承关系图:
Connection

结构体

class  Native
 
class  SQLCipherPreparedStatement
 
class  SQLCipherRegister
 
class  SQLCipherResultSet
 

Public 成员函数

静态 Public 成员函数

包函数

包属性

静态包属性

额外继承的成员函数

详细描述

在文件 sqlcipher.xcsm5 行定义.

成员函数说明

◆ close()

void close ( )
override

实现了 Connection.

在文件 sqlcipher.xcsm190 行定义.

190 {
191 if (hdb != 0){
192 Native.sqlite3_close(hdb);
193 hdb = 0;
194 }
195 }

引用了 hdb.

被这些函数引用 finalize().

◆ commit()

int commit ( )

在文件 sqlcipher.xcsm214 行定义.

214 {
215 return execute("COMMIT;");
216 }
int execute(String stmt)

引用了 execute().

◆ create()

void create ( String  uri,
String  username,
String  pwd 
)
override

实现了 Connection.

在文件 sqlcipher.xcsm109 行定义.

109 {
110 int err = Native.sqlite3_open(uri, hdb);
111 if (err != 0){
112 throw new Sql.SqlException(err, "can not open database:" + uri);
113 }
114 /*if (pwd != nilptr){
115 err = Native.sqlite3_key(hdb, pwd, pwd.length());
116 if (err != 0){
117 throw new Sql.SqlException(err, "password incorrect");
118 }
119 }*/
120 }
Definition xsql.xcs:3

引用了 hdb.

◆ createStatement()

Sql.Statement createStatement ( )
override

实现了 Connection.

在文件 sqlcipher.xcsm178 行定义.

178 {
179 return new SQLCipherPreparedStatement(this);
180 }

◆ enableSycnhronous()

int enableSycnhronous ( int  n)

在文件 sqlcipher.xcsm202 行定义.

202 {
203 if (n < 0 || n > 2){
204 return -1;
205 }
206 String [] cof = {"FULL", "NORMAL", "OFF"};
207 return execute("PRAGMA synchronous = " + cof[n] + ";");
208 }
字符串类

引用了 execute().

◆ execute()

int execute ( String  stmt)

在文件 sqlcipher.xcsm232 行定义.

232 {
233 if (hdb != 0){
234 long msg = 0;
235 int err = Native.sqlite3_exec(hdb, stmt, (long)0, (long)0, msg);
236 if (err != 0){
238 }
239 return err;
240 }
241 throw new Sql.SqlException(-1, "database not opened");
242 return -1;
243 }
void throw_sqlite_error()

引用了 hdb , 以及 throw_sqlite_error().

被这些函数引用 commit(), enableSycnhronous(), SQLCipher.SQLCipherPreparedStatement.execute(), SQLCipher.SQLCipherPreparedStatement.executeUpdate(), rollback() , 以及 workBegin().

◆ finalize()

void finalize ( )
package

在文件 sqlcipher.xcsm197 行定义.

197 {
198 close();
199 }
void close() override

引用了 close().

◆ generateErrorText()

String generateErrorText ( long  herr,
String  fallback 
)

在文件 sqlcipher.xcsm222 行定义.

222 {
223 if (herr != 0){
224 long len = Sqlite.CSTDNative.strlen(herr);
225 byte [] data = new byte[len + 1];
226 Sqlite.CSTDNative.memcpy(data, herr, len);
227 return new String(data, 0, len);
228 }
229 return fallback;
230 }

◆ get_changes()

int get_changes ( )

在文件 sqlcipher.xcsm245 行定义.

245 {
246 return Native.sqlite3_changes(hdb);
247 }

引用了 hdb.

被这些函数引用 SQLCipher.SQLCipherPreparedStatement.get_changes().

◆ getDb()

long getDb ( )

在文件 sqlcipher.xcsm262 行定义.

262 {
263 return hdb;
264 }

引用了 hdb.

◆ getError()

String getError ( )
override

实现了 Connection.

在文件 sqlcipher.xcsm165 行定义.

165 {
166 return Native.sqlite3_errmsg(hdb);
167 }

引用了 hdb.

被这些函数引用 throw_sqlite_error().

◆ getErrorCode()

int getErrorCode ( )
override

实现了 Connection.

在文件 sqlcipher.xcsm133 行定义.

133 {
134 return Native.sqlite3_errcode(hdb);
135 }

引用了 hdb.

被这些函数引用 throw_sqlite_error().

◆ getLastInsertedRowId()

long getLastInsertedRowId ( )

在文件 sqlcipher.xcsm186 行定义.

186 {
187 return Native.sqlite3_last_insert_rowid(hdb);
188 }

引用了 hdb.

◆ getOption()

Object getOption ( int  opt)
override

实现了 Connection.

在文件 sqlcipher.xcsm169 行定义.

169 {
170 throw new Sql.DatabaseNotSupportException("getOption");
171 return nilptr;
172 }

◆ isClosed()

bool isClosed ( )
override

实现了 Connection.

在文件 sqlcipher.xcsm182 行定义.

182 {
183 return hdb != 0;
184 }

引用了 hdb.

◆ key() [1/2]

void key ( byte []  pKey)

在文件 sqlcipher.xcsm137 行定义.

137 {
138 int err = Native.sqlite3_key(hdb, pKey, pKey.length);
139 if (err != 0){
141 }
142 }

引用了 hdb , 以及 throw_sqlite_error().

◆ key() [2/2]

void key ( String  dbname,
byte []  pKey 
)

在文件 sqlcipher.xcsm144 行定义.

144 {
145 int err = Native.sqlite3_key_v2(hdb, dbname, pKey, pKey.length);
146 if (err != 0){
148 }
149 }

引用了 hdb, String.length() , 以及 throw_sqlite_error().

◆ prepare()

long prepare ( String  sql)

在文件 sqlcipher.xcsm249 行定义.

249 {
250 long nstmt = 0;
251 if (hdb != 0){
252 int err = Native.sqlite3_prepare_v2(hdb, sql, sql.length(), nstmt, nilptr);
253 if (err != 0 || nstmt == 0){
255 }
256 return nstmt;
257 }
258 throw new Sql.SqlException(-1, "database not opened");
259 return nstmt;
260 }
int length()

引用了 hdb, String.length() , 以及 throw_sqlite_error().

被这些函数引用 SQLCipher.SQLCipherPreparedStatement.executeQuery() , 以及 SQLCipher.SQLCipherPreparedStatement.SQLCipherPreparedStatement().

◆ prepareStatement()

Sql.PreparedStatement prepareStatement ( String  sql)
override

实现了 Connection.

在文件 sqlcipher.xcsm174 行定义.

174 {
175 return new SQLCipherPreparedStatement(this, sql);
176 }

◆ registry()

static bool registry ( )
static

在文件 sqlcipher.xcsm8 行定义.

8 {
9 if (Native.init()){
10 Sql.Database.reigstry(DRIVERNAME, new SQLCipherRegister());
11 return true;
12 }
13 return false;
14 }
static const String DRIVERNAME
Definition sqlcipher.xcsm:6
static bool reigstry(String name, ConnectionRegister reg)
Definition xsql.xcs:210

引用了 DRIVERNAME , 以及 Database.reigstry().

◆ rekey() [1/2]

void rekey ( byte []  pKey)

在文件 sqlcipher.xcsm151 行定义.

151 {
152 int err = Native.sqlite3_rekey(hdb, pKey, pKey.length);
153 if (err != 0){
155 }
156 }

引用了 hdb , 以及 throw_sqlite_error().

◆ rekey() [2/2]

void rekey ( String  dbname,
byte []  pKey 
)

在文件 sqlcipher.xcsm158 行定义.

158 {
159 int err = Native.sqlite3_rekey_v2(hdb, dbname, pKey, pKey.length);
160 if (err != 0){
162 }
163 }

引用了 hdb, String.length() , 以及 throw_sqlite_error().

◆ rollback()

int rollback ( )

在文件 sqlcipher.xcsm218 行定义.

218 {
219 return execute("ROLLBACK;");
220 }

引用了 execute().

◆ setOption()

void setOption ( int  opt,
Object  option 
)
override

设置参数

@Exception : SqlException

实现了 Connection.

在文件 sqlcipher.xcsm126 行定义.

126 {
127 throw new Sql.DatabaseNotSupportException("setOption");
128 }

◆ throw_sqlite_error()

void throw_sqlite_error ( )

◆ workBegin()

int workBegin ( )

在文件 sqlcipher.xcsm210 行定义.

210 {
211 return execute("BEGIN;");
212 }

引用了 execute().

结构体成员变量说明

◆ DRIVERNAME

const String DRIVERNAME = "sqlcipher"
staticpackage

在文件 sqlcipher.xcsm6 行定义.

被这些函数引用 registry().

◆ hdb

long hdb = 0
package

◆ registried

bool registried = registry()
staticpackage

在文件 sqlcipher.xcsm106 行定义.