mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
5884aa15d4
Now it is also possible to escape it by a backslash. modified: storage/connect/tabfmt.cpp - Prepare making VEC table type support conditional. VEC tables might be unsupported in future versions modified: storage/connect/CMakeLists.txt modified: storage/connect/mycat.cc modified: storage/connect/reldef.cpp modified: storage/connect/xindex.cpp - MDEV-11067 suggested to add configuration support to the Apache wrapper. Was added but commented out until prooved it is really useful. modified: storage/connect/ApacheInterface.java modified: storage/connect/ha_connect.cc modified: storage/connect/jdbccat.h modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h - Remove useless members. modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h - New UDF countin. modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h
61 lines
1.7 KiB
Java
61 lines
1.7 KiB
Java
package wrappers;
|
|
|
|
import java.sql.*;
|
|
import java.util.Hashtable;
|
|
import org.apache.commons.dbcp2.BasicDataSource;
|
|
|
|
public class ApacheInterface extends JdbcInterface {
|
|
static Hashtable<String,BasicDataSource> pool = new Hashtable<String, BasicDataSource>();
|
|
|
|
public ApacheInterface() {
|
|
this(true);
|
|
} // end of default constructor
|
|
|
|
public ApacheInterface(boolean b) {
|
|
super(b);
|
|
} // end of constructor
|
|
|
|
@Override
|
|
public int JdbcConnect(String[] parms, int fsize, boolean scrollable) {
|
|
int rc = 0;
|
|
String url = parms[1];
|
|
BasicDataSource ds = null;
|
|
|
|
if (DEBUG)
|
|
System.out.println("Connecting to Apache data source");
|
|
|
|
try {
|
|
CheckURL(url, null);
|
|
|
|
if ((ds = pool.get(url)) == null) {
|
|
ds = new BasicDataSource();
|
|
ds.setDriverClassName(parms[0]);
|
|
ds.setUrl(url);
|
|
ds.setUsername(parms[2]);
|
|
ds.setPassword(parms[3]);
|
|
pool.put(url, ds);
|
|
} // endif ds
|
|
|
|
// if (parms.length > 4 && parms[4] != null)
|
|
// ds.setConnectionProperties(parms[4]);
|
|
|
|
// Get a connection from the data source
|
|
conn = ds.getConnection();
|
|
|
|
// Get the data base meta data object
|
|
dbmd = conn.getMetaData();
|
|
|
|
// Get a statement from the connection
|
|
stmt = GetStmt(fsize, scrollable);
|
|
} catch (SQLException se) {
|
|
SetErrmsg(se);
|
|
rc = -2;
|
|
} catch (Exception e) {
|
|
SetErrmsg(e);
|
|
rc = -3;
|
|
} // end try/catch
|
|
|
|
return rc;
|
|
} // end of JdbcConnect
|
|
|
|
} // end of class ApacheInterface
|