mariadb/storage/connect/ApacheInterface.java

62 lines
1.7 KiB
Java
Raw Normal View History

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 {
- JAVA DEBUG now depends on connect_xtrace MySQL and MariaDB drivers use catalog for schema modified: storage/connect/JdbcInterface.java - Jdbc temporal fields now return time in seconds modified: storage/connect/JdbcInterface.java modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h - Recognize JDBC temporal types modified: storage/connect/ha_connect.cc modified: storage/connect/jdbconn.cpp - Test validity of URL modified: storage/connect/ApacheInterface.java modified: storage/connect/JdbcInterface.java modified: storage/connect/MariadbInterface.java modified: storage/connect/MysqlInterface.java modified: storage/connect/OracleInterface.java modified: storage/connect/PostgresqlInterface.java - Java class files are no more distributed A JdbcInterface.jar file is now compiled modified: storage/connect/CMakeLists.txt deleted: storage/connect/wrappers/ApacheInterface.class deleted: storage/connect/wrappers/Client.class deleted: storage/connect/wrappers/JdbcInterface.class deleted: storage/connect/wrappers/MariadbInterface.class deleted: storage/connect/wrappers/MysqlInterface.class deleted: storage/connect/wrappers/OracleInterface.class deleted: storage/connect/wrappers/PostgresqlInterface.class - Try to find the JVM path using JAVA_HOME or registers (Windows) modified: storage/connect/jdbconn.cpp - Add Monty's patches modified: storage/connect/connect.h modified: storage/connect/csort.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp -Change connect_java_wrapper variable from GLOBAL to SESSION modified: storage/connect/ha_connect.cc modified: storage/connect/jdbconn.cpp - Modify the tests to be able to run at least jdbc and jdbc_new modified: storage/connect/mysql-test/connect/disabled.def modified: storage/connect/mysql-test/connect/r/jdbc.result modified: storage/connect/mysql-test/connect/r/jdbc_new.result modified: storage/connect/mysql-test/connect/t/jdbc.test modified: storage/connect/mysql-test/connect/t/jdbc_new.test modified: storage/connect/mysql-test/connect/t/jdbconn.inc modified: storage/connect/mysql-test/connect/t/jdbconn_cleanup.inc added: storage/connect/mysql-test/connect/std_data/JdbcMariaDB.jar
2016-07-09 12:08:31 +02:00
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