public class Connects extends Object
Modifier and Type | Field and Description |
---|---|
static int |
flag_disableSql |
static int |
flag_nothing
nothing special for commit
|
static int |
flag_printSql |
protected static HashMap<String,HashMap<String,io.odysz.semantics.meta.TableMeta>> |
metas |
Constructor and Description |
---|
Connects() |
Modifier and Type | Method and Description |
---|---|
static void |
close() |
static int[] |
commit(io.odysz.semantics.IUser usr,
ArrayList<String> sqls,
ArrayList<Clob> lobs,
int... flags) |
static int[] |
commit(io.odysz.semantics.IUser usr,
ArrayList<String> sqls,
int... flags)
Commit to default connection.
|
static int[] |
commit(io.odysz.semantics.IUser usr,
String sql) |
static int[] |
commit(String conn,
io.odysz.semantics.IUser usr,
ArrayList<String> sqls,
int... flags) |
static int[] |
commit(String conn,
io.odysz.semantics.IUser usr,
String sql,
int... flags) |
static Set<String> |
connIds() |
static String |
defltConn() |
static io.odysz.common.dbtype |
driverType(String conn) |
static Set<String> |
getAllConnIds() |
static boolean |
getDebug(String conn) |
static HashMap<String,io.odysz.semantics.meta.TableMeta> |
getMeta(String connId) |
static io.odysz.semantics.meta.TableMeta |
getMeta(String connId,
String tbl) |
static String |
getSmtcsPath(String conn)
Get the smtcs file path configured in connects.xml.
|
static void |
init(String xmlDir)
parse connects.xml, setup connections configured in table "drvmnger", for JDBC DriverManger,
and "dbcp", for JDBC connection-pooled connection managed by container.
|
static HashMap<String,io.odysz.semantics.meta.TableMeta> |
loadMeta(String conn)
Build database tables' meta.
|
static String |
pagingSql(io.odysz.common.dbtype dt,
String sql,
int pageIx,
int pgSize) |
static String |
pagingSql(String conn,
String sql,
int page,
int size)
compose paged sql, e.g.
|
static io.odysz.common.dbtype |
parseDrvType(String type)
Convert names like "sqlit" to
dbtype . |
static void |
printSql(boolean asking,
int flag,
ArrayList<String> sqls)
If printSql is true or if asking enable,
then print sqls.
|
static void |
printSql(boolean asking,
int flag,
String sql) |
static void |
reinit(String xmlDir) |
static AnResultset |
select(String sql,
int... flags) |
static AnResultset |
select(String conn,
String sql,
int... flags) |
static void |
setMeta(String connId,
io.odysz.semantics.meta.TableMeta m)
Set table meta (providing a chance of extending table's semantics and keep a single copy for DB's meta).
|
static String |
uri2conn(String uri)
Mapping client function id to data connection according to configuration.
|
public static final int flag_nothing
public static final int flag_printSql
public static final int flag_disableSql
public static io.odysz.common.dbtype parseDrvType(String type) throws SemanticException
dbtype
.type
- SemanticException
public static String defltConn()
public static void reinit(String xmlDir)
public static void init(String xmlDir)
xmlDir
- public static void close()
public static void printSql(boolean asking, int flag, ArrayList<String> sqls)
asking
- flag
- sqls
- public static void printSql(boolean asking, int flag, String sql)
public static AnResultset select(String conn, String sql, int... flags) throws SQLException
SQLException
public static AnResultset select(String sql, int... flags) throws SQLException
SQLException
public static String pagingSql(String conn, String sql, int page, int size) throws io.odysz.transact.x.TransException
sql
- page
- size
- io.odysz.transact.x.TransException
public static String pagingSql(io.odysz.common.dbtype dt, String sql, int pageIx, int pgSize) throws io.odysz.transact.x.TransException
io.odysz.transact.x.TransException
public static int[] commit(io.odysz.semantics.IUser usr, ArrayList<String> sqls, int... flags) throws SQLException, io.odysz.transact.x.TransException
usr
- sqls
- flags
- SQLException
io.odysz.transact.x.TransException
public static int[] commit(io.odysz.semantics.IUser usr, ArrayList<String> sqls, ArrayList<Clob> lobs, int... flags) throws SQLException
SQLException
public static int[] commit(String conn, io.odysz.semantics.IUser usr, String sql, int... flags) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public static int[] commit(String conn, io.odysz.semantics.IUser usr, ArrayList<String> sqls, int... flags) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public static int[] commit(io.odysz.semantics.IUser usr, String sql) throws SQLException, io.odysz.transact.x.TransException
SQLException
io.odysz.transact.x.TransException
public static io.odysz.common.dbtype driverType(String conn)
public static HashMap<String,io.odysz.semantics.meta.TableMeta> loadMeta(String conn) throws SemanticException, SQLException
Build database tables' meta.
conn
- SemanticException
SQLException
public static HashMap<String,io.odysz.semantics.meta.TableMeta> getMeta(String connId) throws SemanticException, SQLException
SemanticException
SQLException
public static io.odysz.semantics.meta.TableMeta getMeta(String connId, String tbl) throws SemanticException, SQLException
connId
- tbl
- SemanticException
SQLException
public static void setMeta(String connId, io.odysz.semantics.meta.TableMeta m) throws SemanticException, SQLException
connId
- m
- SemanticException
SQLException
public static String getSmtcsPath(String conn)
conn
- public static boolean getDebug(String conn)
public static String uri2conn(String uri) throws SemanticException
uri
- SemanticException
Copyright © 2024. All rights reserved.