public class CpConnect extends AbsConnect<CpConnect>
drvName, enableSystemout, locks, log
Constructor and Description |
---|
CpConnect(String srcId,
io.odysz.common.dbtype driverType,
boolean printSql,
boolean log)
Managing connection and ds for mysql, oracle, ...
|
Modifier and Type | Method and Description |
---|---|
int[] |
commit(ArrayList<String> sqls,
int flags) |
int[] |
commit(io.odysz.semantics.IUser log,
ArrayList<String> sqls,
ArrayList<Clob> lobs,
int i) |
protected Connection |
getConnection()
Get Connection
|
HashMap<String,HashMap<String,OracleLob>> |
getlobMeta()
Get the CLOBs meta data - which is built while initialization.
|
AnResultset |
select(String sql,
int flags)
For
Connects creating Meta data before Datasource is usable. |
static AnResultset |
select(String src,
String sql)
Use this for querying database without help of sql builder (which need query meta data first with this method).
|
static String |
truncatUtf8(String s,
int maxBytes) |
close, commit, driverType, getAutoseqLock, initDmConnect, initPooledConnect, prop, prop
public CpConnect(String srcId, io.odysz.common.dbtype driverType, boolean printSql, boolean log)
srcId
- driverType
- printSql
- log
- public static AnResultset select(String src, String sql) throws SQLException
src
- name that matches context.xml/Resource/name, like 'inet' etc.sql
- SQLException
public HashMap<String,HashMap<String,OracleLob>> getlobMeta()
protected Connection getConnection() throws SQLException, NamingException
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake Caused by: java.io.EOFException: SSL peer shut down incorrectlyProbable caused by no certificate?
<Resource auth="Container" connectionProperties="useUnicode=yes;characterEncoding=utf8;autoReconnect=true;autoReconnectForPools=true;useSSL=false;enabledTLSProtocols=TLSv1,TLSv1.1,TLSv1.2" driverClassName="com.mysql.cj.jdbc.Driver" maxActive="10" maxIdle="3" maxWait="10000" global="jdbc/db-name" name="jdbc/db-name" password="..." type="javax.sql.DataSource" url="jdbc:mysql://host:3306/db-name" username="..."/>See This.
SQLException
- database access error occurs while get connection. See DataSource.getConnection()
.NamingException
- lookup connection failedpublic AnResultset select(String sql, int flags) throws SQLException, NamingException
Connects
creating Meta data before Datasource is usable.select
in class AbsConnect<CpConnect>
sql
- SQLException
NamingException
public int[] commit(ArrayList<String> sqls, int flags) throws SQLException, NamingException
commit
in class AbsConnect<CpConnect>
SQLException
NamingException
public int[] commit(io.odysz.semantics.IUser log, ArrayList<String> sqls, ArrayList<Clob> lobs, int i) throws SQLException
commit
in class AbsConnect<CpConnect>
SQLException
Copyright © 2024. All rights reserved.