1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.6.3.1'

This commit is contained in:
gnosygnu
2016-06-19 23:58:10 -04:00
parent 96636f3161
commit d4e8590345
1960 changed files with 20790 additions and 9272 deletions

View File

@@ -23,10 +23,10 @@ public class Db_qry__select_in_tbl implements Db_qry {
}
public int Tid() {return Db_qry_.Tid_select_in_tbl;}
public boolean Exec_is_rdr() {return true;}
public String Base_table() {return base_table;} private final String base_table;
public String Base_table() {return base_table;} private final String base_table;
public Criteria Where() {return where;} private Criteria where;
public String[] Select_flds() {return select_flds;} private final String[] select_flds;
private final String[] where_flds;
public String[] Select_flds() {return select_flds;} private final String[] select_flds;
private final String[] where_flds;
public void Where_sql(String_bldr sb) {
if (where_flds == null) return;
int where_flds_len = where_flds.length;
@@ -36,10 +36,10 @@ public class Db_qry__select_in_tbl implements Db_qry {
sb.Add(where_flds[i]).Add(" = ? ");
}
}
public String Group_by_sql() {return group_by_sql;} private final String group_by_sql;
public String Having_sql() {return having_sql;} private final String having_sql;
public String Group_by_sql() {return group_by_sql;} private final String group_by_sql;
public String Having_sql() {return having_sql;} private final String having_sql;
public String Order_by_sql() {return order_by_sql;} public Db_qry__select_in_tbl Order_by_sql_(String v) {order_by_sql = v; return this;} private String order_by_sql;
public String Limit_sql() {return limit_sql;} private final String limit_sql;
public String Limit_sql() {return limit_sql;} private final String limit_sql;
public String To_sql__exec(gplx.dbs.sqls.Sql_qry_wtr wtr) {
synchronized (this) {
String_bldr sb = String_bldr_.new_();
@@ -66,7 +66,7 @@ public class Db_qry__select_in_tbl implements Db_qry {
case 0: break;
case 1: order_by_sql = order_flds[0]; break;
default:
Bry_bfr bfr = Bry_bfr.new_();
Bry_bfr bfr = Bry_bfr_.New();
for (int i = 0; i < len; ++i) {
String order_fld = order_flds[i];
if (i != 0) bfr.Add_byte_comma();
@@ -81,6 +81,6 @@ public class Db_qry__select_in_tbl implements Db_qry {
return rv;
}
public static Db_qry__select_in_tbl as_(Object obj) {return obj instanceof Db_qry__select_in_tbl ? (Db_qry__select_in_tbl)obj : null;}
public static final String[] Where_flds__all = String_.Ary_empty;
public static final String[] Order_by_null = null;
public static final String[] Where_flds__all = String_.Ary_empty;
public static final String[] Order_by_null = null;
}

View File

@@ -42,7 +42,7 @@ public class Db_qry_sql implements Db_qry {
byte[] src = Bry_.new_u8(Sql_qry_wtr_.Gen_placeholder_parameters(qry));
int src_len = src.length;
int args_idx = 0, args_len = args.length, pos = 0;
Bry_bfr bfr = Bry_bfr.new_(src_len);
Bry_bfr bfr = Bry_bfr_.New_w_size(src_len);
while (pos < src_len) {
int question_pos = Bry_find_.Find_fwd(src, Byte_ascii.Question, pos);
if (question_pos == Bry_find_.Not_found)
@@ -78,5 +78,5 @@ public class Db_qry_sql implements Db_qry {
val_bry = Bry_.Replace(val_bry, Byte_ascii.Apos_bry, Bry_escape_apos);
bfr.Add_byte_apos().Add(val_bry).Add_byte_apos();
}
} private static final byte[] Bry_null = Bry_.new_u8("NULL"), Bry_escape_apos = Bry_.new_a7("''");
} private static final byte[] Bry_null = Bry_.new_u8("NULL"), Bry_escape_apos = Bry_.new_a7("''");
}

View File

@@ -120,7 +120,7 @@ public class Db_stmt_cmd implements Db_stmt {
try {stmt.setString(++val_idx, v);} catch (Exception e) {this.Rls(); throw Err_.new_exc(e, "db", "failed to add value", "type", "text", "val", v, "sql", sql);}
return this;
}
public Db_stmt Val_rdr_(gplx.core.ios.Io_stream_rdr v, long rdr_len) {
public Db_stmt Val_rdr_(gplx.core.ios.streams.Io_stream_rdr v, long rdr_len) {
try {stmt.setBinaryStream(++val_idx, (java.io.InputStream)v.Under(), (int)rdr_len);} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to add value", "type", "rdr", "val", v);}
return this;
}

View File

@@ -20,9 +20,9 @@ import gplx.core.brys.fmtrs.*; import gplx.core.stores.*;
import gplx.dbs.engines.*;
public class Db_stmt_sql implements Db_stmt {// used for formatting SQL statements; not used for actual insert into database
private static final String Key_na = ""; // key is not_available; only called by procs with signature of Val(<type> v);
private final List_adp args = List_adp_.new_();
private final Bry_bfr tmp_bfr = Bry_bfr.new_();
private final Bry_fmtr tmp_fmtr = Bry_fmtr.new_();
private final List_adp args = List_adp_.New();
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
private final Bry_fmtr tmp_fmtr = Bry_fmtr.new_();
public void Ctor_stmt(Db_engine engine, Db_qry qry) {}
public Db_conn Conn() {return conn;} public void Conn_(Db_conn v) {this.conn = v;} Db_conn conn;
public Db_stmt Reset_stmt() {return this;}
@@ -103,10 +103,10 @@ public class Db_stmt_sql implements Db_stmt {// used for formatting SQL statemen
try {Add(k, Val_str_wrap(v));} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to add value", "type", "text", "val", v);}
return this;
}
public Db_stmt Val_rdr_(gplx.core.ios.Io_stream_rdr v, long rdr_len) {
public Db_stmt Val_rdr_(gplx.core.ios.streams.Io_stream_rdr v, long rdr_len) {
try {
Bry_bfr bfr = Bry_bfr.new_();
gplx.core.ios.Io_stream_rdr_.Load_all_to_bfr(bfr, v);
Bry_bfr bfr = Bry_bfr_.New();
gplx.core.ios.streams.Io_stream_rdr_.Load_all_to_bfr(bfr, v);
Add(Key_na, bfr.To_str_and_clear());
} catch (Exception e) {throw Err_.new_exc(e, "db", "failed to add value", "type", "rdr", "val", v);}
return this;