Skip to content

Commit

Permalink
[CBRD-24592] Remove default connection in CUBRIDDriver (#39)
Browse files Browse the repository at this point in the history
http://jira.cubrid.org/browse/CBRD-24592

The default connection-related routine doesn't have to be placed in the client-side's JDBC Driver. This PR removes them.
  • Loading branch information
hgryoo authored Dec 26, 2022
1 parent 9fb24f5 commit 4a2743d
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/jdbc/cubrid/jdbc/driver/CUBRIDDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public class CUBRIDDriver implements Driver {
private static final String URL_PATTERN =
"jdbc:cubrid(-oracle|-mysql)?:([a-zA-Z_0-9\\.-]*):([0-9]*):([^:]+):([^:]*):([^:]*):(\\?[a-zA-Z_0-9]+=[^&=?]+(&[a-zA-Z_0-9]+=[^&=?]+)*)?";
private static final String CUBRID_JDBC_URL_HEADER = "jdbc:cubrid";
private static final String JDBC_DEFAULT_CONNECTION = "jdbc:default:connection";
private static final String ENV_JDBC_PROP_NAME = "CUBRID_JDBC_PROP";

static {
Expand Down Expand Up @@ -140,10 +139,6 @@ public Connection connect(String url, Properties info) throws SQLException {
return null;
}

if (url.toLowerCase().startsWith(JDBC_DEFAULT_CONNECTION)) {
return defaultConnection();
}

Pattern pattern = Pattern.compile(URL_PATTERN, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(url);
if (!matcher.find()) {
Expand Down Expand Up @@ -304,26 +299,6 @@ public Connection connect(String url, Properties info) throws SQLException {
return conn;
}

public Connection defaultConnection() {
try {
if (UJCIUtil.isServerSide()) {
Thread t = Thread.currentThread();
Connection c =
(Connection)
UJCIUtil.invoke(
"com.cubrid.jsp.ExecuteThread",
"createConnection",
null,
t,
null);
return c;
}
} catch (Exception e) {
/* do nothing. The exception will be dealt with in ExecuteThread */
}
return null;
}

public boolean acceptsURL(String url) throws SQLException {
if (url == null) {
return false;
Expand All @@ -343,10 +318,6 @@ public boolean acceptsURL(String url) throws SQLException {
return true;
}

if (url.toLowerCase().startsWith(JDBC_DEFAULT_CONNECTION)) {
return true;
}

return false;
}

Expand Down

0 comments on commit 4a2743d

Please sign in to comment.