You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2013/04/24 06:37:31 UTC
svn commit: r1471245 [14/14] - in /db/derby/code/trunk/java:
client/org/apache/derby/client/ client/org/apache/derby/client/am/
client/org/apache/derby/client/am/stmtcache/
client/org/apache/derby/client/net/ client/org/apache/derby/jdbc/
testing/org/a...
Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java Wed Apr 24 04:37:28 2013
@@ -21,6 +21,7 @@
package org.apache.derby.client.net;
+import java.sql.Types;
import org.apache.derby.iapi.reference.DRDAConstants;
import org.apache.derby.iapi.reference.JDBC30Translation;
import org.apache.derby.client.am.Cursor;
@@ -126,7 +127,7 @@ import org.apache.derby.shared.common.re
//
// typdef end
-public class Typdef implements java.lang.Cloneable {
+public class Typdef implements Cloneable {
//---------------------navigational members-----------------------------------
//-----------------------------state------------------------------------------
@@ -688,28 +689,28 @@ public class Typdef implements java.lang
private static final int[] protocolToJdbcTypes_ = {
0x00, // 0x00 Empties
0x00, // 0x01 Empties
- java.sql.Types.INTEGER, // 0x02 4-byte int
- java.sql.Types.INTEGER, // 0x03 null 4-byte int
- java.sql.Types.SMALLINT, // 0x04 2-byte int
- java.sql.Types.SMALLINT, // 0x05 null 2-byte int
- java.sql.Types.TINYINT, // 0x06 1-byte int
- java.sql.Types.TINYINT, // 0x07 null 1-byte int
- java.sql.Types.DECIMAL, // 0x08 16-byte bin float
- java.sql.Types.DECIMAL, // 0x09 null 16-byte bin float
- java.sql.Types.DOUBLE, // 0x0A 8-byte bin float
- java.sql.Types.DOUBLE, // 0x0B null 8-byte bin float
- java.sql.Types.REAL, // 0x0C 4-byte bin float
- java.sql.Types.REAL, // 0x0D null 4-byte bin float
- java.sql.Types.DECIMAL, // 0x0E Fixed Decimal
- java.sql.Types.DECIMAL, // 0x0F null Fixed Decimal
- java.sql.Types.DECIMAL, // 0x10 Zone Decimal
- java.sql.Types.DECIMAL, // 0x11 null Zone Decimal
- java.sql.Types.DECIMAL, // 0x12 Numeirc
- java.sql.Types.DECIMAL, // 0x13 null Numeric
+ Types.INTEGER, // 0x02 4-byte int
+ Types.INTEGER, // 0x03 null 4-byte int
+ Types.SMALLINT, // 0x04 2-byte int
+ Types.SMALLINT, // 0x05 null 2-byte int
+ Types.TINYINT, // 0x06 1-byte int
+ Types.TINYINT, // 0x07 null 1-byte int
+ Types.DECIMAL, // 0x08 16-byte bin float
+ Types.DECIMAL, // 0x09 null 16-byte bin float
+ Types.DOUBLE, // 0x0A 8-byte bin float
+ Types.DOUBLE, // 0x0B null 8-byte bin float
+ Types.REAL, // 0x0C 4-byte bin float
+ Types.REAL, // 0x0D null 4-byte bin float
+ Types.DECIMAL, // 0x0E Fixed Decimal
+ Types.DECIMAL, // 0x0F null Fixed Decimal
+ Types.DECIMAL, // 0x10 Zone Decimal
+ Types.DECIMAL, // 0x11 null Zone Decimal
+ Types.DECIMAL, // 0x12 Numeirc
+ Types.DECIMAL, // 0x13 null Numeric
0x00, // 0x14 Empties
0x00, // 0x15 Empties
- java.sql.Types.BIGINT, // 0x16 Big int
- java.sql.Types.BIGINT, // 0x17 null Big int
+ Types.BIGINT, // 0x16 Big int
+ Types.BIGINT, // 0x17 null Big int
0x00,
0x00,
0x00,
@@ -718,28 +719,28 @@ public class Typdef implements java.lang
0x00,
0x00,
0x00,
- java.sql.Types.DATE, // 0x20 Date
- java.sql.Types.DATE, // 0x21 null Date
- java.sql.Types.TIME, // 0x22 Time
- java.sql.Types.TIME, // 0x23 null Time
- java.sql.Types.TIMESTAMP, // 0x24 Timestamp
- java.sql.Types.TIMESTAMP, // 0x25 null Timestamp
- java.sql.Types.BINARY, // 0x26 Fixed bytes
- java.sql.Types.BINARY, // 0x27 null Fixed bytes
- java.sql.Types.VARBINARY, // 0x28 Variable bytes
- java.sql.Types.VARBINARY, // 0x29 null Variable bytes
- java.sql.Types.LONGVARBINARY, // 0x2A Long var bytes
- java.sql.Types.LONGVARBINARY, // 0x2B null Long var bytes
- java.sql.Types.VARBINARY, // 0x2C Nullterm bytes
- java.sql.Types.VARBINARY, // 0x2D null Nullterm bytes
- java.sql.Types.CHAR, // 0x2E Nullterm SBCS
- java.sql.Types.CHAR, // 0x2F null Nullterm SBCS
- java.sql.Types.CHAR, // 0x30 Fix char SBCS
- java.sql.Types.CHAR, // 0x31 null Fix char SBCS
- java.sql.Types.VARCHAR, // 0x32 Var char SBCS
- java.sql.Types.VARCHAR, // 0x33 null Var char SBCS
- java.sql.Types.LONGVARCHAR, // 0x34 Long var SBCS
- java.sql.Types.LONGVARCHAR, // 0x35 null Long var SBCS
+ Types.DATE, // 0x20 Date
+ Types.DATE, // 0x21 null Date
+ Types.TIME, // 0x22 Time
+ Types.TIME, // 0x23 null Time
+ Types.TIMESTAMP, // 0x24 Timestamp
+ Types.TIMESTAMP, // 0x25 null Timestamp
+ Types.BINARY, // 0x26 Fixed bytes
+ Types.BINARY, // 0x27 null Fixed bytes
+ Types.VARBINARY, // 0x28 Variable bytes
+ Types.VARBINARY, // 0x29 null Variable bytes
+ Types.LONGVARBINARY, // 0x2A Long var bytes
+ Types.LONGVARBINARY, // 0x2B null Long var bytes
+ Types.VARBINARY, // 0x2C Nullterm bytes
+ Types.VARBINARY, // 0x2D null Nullterm bytes
+ Types.CHAR, // 0x2E Nullterm SBCS
+ Types.CHAR, // 0x2F null Nullterm SBCS
+ Types.CHAR, // 0x30 Fix char SBCS
+ Types.CHAR, // 0x31 null Fix char SBCS
+ Types.VARCHAR, // 0x32 Var char SBCS
+ Types.VARCHAR, // 0x33 null Var char SBCS
+ Types.LONGVARCHAR, // 0x34 Long var SBCS
+ Types.LONGVARCHAR, // 0x35 null Long var SBCS
0x00, // 0x36 Empties
0x00, // 0x37 Empties
0x00, // 0x38 Empties
@@ -747,28 +748,28 @@ public class Typdef implements java.lang
0x00, // 0x3A Empties
0x00, // 0x3B Empties
// The following will have to be changed later for situations where
- java.sql.Types.CHAR, // 0x3C Fix char MBCS
- java.sql.Types.CHAR, // 0x3D null Fix char MBCS
- java.sql.Types.VARCHAR, // 0x3E Var char MBCS
- java.sql.Types.VARCHAR, // 0x3F null Var char MBCS
- java.sql.Types.LONGVARCHAR, // 0x40 Long var MBCS
- java.sql.Types.LONGVARCHAR, // 0x41 null Long var MBCS
- java.sql.Types.CHAR, // 0x42 Nullterm MBCS
- java.sql.Types.CHAR, // 0x43 null Nullterm MBCS
- java.sql.Types.VARBINARY, // 0x44 L String bytes
- java.sql.Types.VARBINARY, // 0x45 null L String bytes
- java.sql.Types.VARCHAR, // 0x46 L String SBCS
- java.sql.Types.VARCHAR, // 0x47 null L String SBCS
- java.sql.Types.VARCHAR, // 0x48 L String MBCS
- java.sql.Types.VARCHAR, // 0x49 null L String MBCS
+ Types.CHAR, // 0x3C Fix char MBCS
+ Types.CHAR, // 0x3D null Fix char MBCS
+ Types.VARCHAR, // 0x3E Var char MBCS
+ Types.VARCHAR, // 0x3F null Var char MBCS
+ Types.LONGVARCHAR, // 0x40 Long var MBCS
+ Types.LONGVARCHAR, // 0x41 null Long var MBCS
+ Types.CHAR, // 0x42 Nullterm MBCS
+ Types.CHAR, // 0x43 null Nullterm MBCS
+ Types.VARBINARY, // 0x44 L String bytes
+ Types.VARBINARY, // 0x45 null L String bytes
+ Types.VARCHAR, // 0x46 L String SBCS
+ Types.VARCHAR, // 0x47 null L String SBCS
+ Types.VARCHAR, // 0x48 L String MBCS
+ Types.VARCHAR, // 0x49 null L String MBCS
0x00, // 0x4A Empties
0x00, // 0x4B Empties
- java.sql.Types.VARCHAR, // 0x4C SBCS
- java.sql.Types.VARCHAR, // 0x4D null SBCS
- java.sql.Types.VARCHAR, // 0x4E MBCS
- java.sql.Types.VARCHAR, // 0x4F null MBCS
- java.sql.Types.JAVA_OBJECT, // 0x50 UDT
- java.sql.Types.JAVA_OBJECT, // 0x51 null UDT
+ Types.VARCHAR, // 0x4C SBCS
+ Types.VARCHAR, // 0x4D null SBCS
+ Types.VARCHAR, // 0x4E MBCS
+ Types.VARCHAR, // 0x4F null MBCS
+ Types.JAVA_OBJECT, // 0x50 UDT
+ Types.JAVA_OBJECT, // 0x51 null UDT
0x00, // 0x52 Empties
0x00, // 0x53 Empties
0x00, // 0x54 Empties
@@ -877,8 +878,8 @@ public class Typdef implements java.lang
0x00, // 0xBB Empties
0x00, // 0xBC Empties
0x00, // 0xBD Empties
- java.sql.Types.BOOLEAN, // 0xBE Boolean
- java.sql.Types.BOOLEAN, // 0xBF null Boolean
+ Types.BOOLEAN, // 0xBE Boolean
+ Types.BOOLEAN, // 0xBF null Boolean
0x00, // 0xC0 Empties
0x00, // 0xC1 Empties
0x00, // 0xC2 Empties
@@ -887,14 +888,14 @@ public class Typdef implements java.lang
0x00, // 0xC5 Empties
0x00, // 0xC6 Empties
0x00, // 0xC7 Empties
- java.sql.Types.BLOB, // 0xC8 Large object bytes
- java.sql.Types.BLOB, // 0xC9 null Large object bytes
- java.sql.Types.CLOB, // 0xCA Large object char SBCS
- java.sql.Types.CLOB, // 0xCB null Large object char SBCS
+ Types.BLOB, // 0xC8 Large object bytes
+ Types.BLOB, // 0xC9 null Large object bytes
+ Types.CLOB, // 0xCA Large object char SBCS
+ Types.CLOB, // 0xCB null Large object char SBCS
0x00,
0x00,
- java.sql.Types.CLOB, // 0xCE Large object char MBCS
- java.sql.Types.CLOB, // 0xCF null Large object char MBCS
+ Types.CLOB, // 0xCE Large object char MBCS
+ Types.CLOB, // 0xCF null Large object char MBCS
};
@@ -1056,7 +1057,7 @@ public class Typdef implements java.lang
public Object clone() {
try {
return super.clone();
- } catch (java.lang.CloneNotSupportedException e) {
+ } catch (CloneNotSupportedException e) {
return null; // this shouldn't happen since we implement the cloneable interface
}
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java Wed Apr 24 04:37:28 2013
@@ -24,6 +24,7 @@ package org.apache.derby.jdbc;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.sql.SQLException;
+import javax.sql.ConnectionPoolDataSource;
import javax.sql.PooledConnection;
import org.apache.derby.shared.common.i18n.MessageUtil;
import org.apache.derby.shared.common.reference.MessageId;
@@ -40,7 +41,7 @@ import org.apache.derby.shared.common.re
*/
public class BasicClientConnectionPoolDataSource40
extends BasicClientDataSource40
- implements javax.sql.ConnectionPoolDataSource,
+ implements ConnectionPoolDataSource,
ClientConnectionPoolDataSourceInterface {
private static final long serialVersionUID = -539234282156481378L;
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSourceRoot.java Wed Apr 24 04:37:28 2013
@@ -29,7 +29,9 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.sql.Connection;
import java.sql.SQLException;
+import java.util.Locale;
import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.StringTokenizer;
@@ -37,7 +39,8 @@ import javax.sql.PooledConnection;
import javax.sql.XAConnection;
import org.apache.derby.client.am.ClientMessageId;
import org.apache.derby.client.am.Configuration;
-import org.apache.derby.client.am.Connection;
+import org.apache.derby.client.am.ClientConnection;
+import org.apache.derby.client.am.EncryptionManager;
import org.apache.derby.client.am.EncryptionManager;
import org.apache.derby.client.am.LogWriter;
import org.apache.derby.client.am.SqlException;
@@ -725,8 +728,8 @@ public abstract class ClientBaseDataSour
}
for (int i = 0; i < choices.length; i++) {
- if (value.toUpperCase(java.util.Locale.ENGLISH).equals(
- choices[i].toUpperCase(java.util.Locale.ENGLISH))) {
+ if (value.toUpperCase(Locale.ENGLISH).equals(
+ choices[i].toUpperCase(Locale.ENGLISH))) {
return;
}
}
@@ -1158,7 +1161,7 @@ public abstract class ClientBaseDataSour
*
* @throws java.sql.SQLException if a database-access error occurs.
*/
- public java.sql.Connection getConnection() throws SQLException {
+ public Connection getConnection() throws SQLException {
LogWriter dncLogWriter = null;
try {
updateDataSourceValues(
@@ -1185,7 +1188,7 @@ public abstract class ClientBaseDataSour
*
* @throws java.sql.SQLException if a database-access error occurs.
*/
- public java.sql.Connection getConnection(String user, String password)
+ public Connection getConnection(String user, String password)
throws SQLException {
// Jdbc 2 connections will write driver trace info on a
// datasource-wide basis using the jdbc 2 data source log writer.
@@ -1210,7 +1213,7 @@ public abstract class ClientBaseDataSour
}
- private java.sql.Connection getConnectionX(LogWriter dncLogWriter,
+ private Connection getConnectionX(LogWriter dncLogWriter,
String user, String password)
throws SqlException {
return ClientDriver.getFactory().newNetConnection(
@@ -1416,7 +1419,7 @@ public abstract class ClientBaseDataSour
// s to lower case (3,4)
// omeProperty use as is (4->)
String propertyName = methodName.substring(3, 4).toLowerCase(
- java.util.Locale.ENGLISH).concat(
+ Locale.ENGLISH).concat(
methodName.substring(4));
try {
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java Wed Apr 24 04:37:28 2013
@@ -23,6 +23,7 @@ package org.apache.derby.jdbc;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
+import javax.sql.ConnectionPoolDataSource;
import org.apache.derby.client.am.ClientMessageId;
import org.apache.derby.client.am.SqlException;
import org.apache.derby.shared.common.reference.SQLState;
@@ -54,9 +55,9 @@ import org.apache.derby.shared.common.re
*/
public class ClientConnectionPoolDataSource40
extends ClientConnectionPoolDataSource
- implements javax.sql.ConnectionPoolDataSource /* compile-time
- * check for 4.1
- * extension */
+ implements ConnectionPoolDataSource /* compile-time
+ * check for 4.1
+ * extension */
{
private static final long serialVersionUID = 6313966728809326579L;
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSourceInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSourceInterface.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSourceInterface.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSourceInterface.java Wed Apr 24 04:37:28 2013
@@ -21,11 +21,13 @@
package org.apache.derby.jdbc;
+import javax.sql.ConnectionPoolDataSource;
+
/**
* Specifies Derby extensions to the {@code java.sqlx.ConnectionPoolDataSource}.
*/
public interface ClientConnectionPoolDataSourceInterface
- extends ClientDataSourceInterface, javax.sql.ConnectionPoolDataSource {
+ extends ClientDataSourceInterface, ConnectionPoolDataSource {
/**
* Returns the maximum number of JDBC prepared statements a connection is
* allowed to cache.
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSource40.java Wed Apr 24 04:37:28 2013
@@ -23,6 +23,7 @@ package org.apache.derby.jdbc;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
+import javax.sql.DataSource;
import org.apache.derby.client.am.ClientMessageId;
import org.apache.derby.client.am.SqlException;
import org.apache.derby.shared.common.reference.SQLState;
@@ -112,7 +113,7 @@ import org.apache.derby.shared.common.re
* <p/>
*/
public class ClientDataSource40 extends ClientDataSource
- implements javax.sql.DataSource /* compile-time check for 4.1 extension */
+ implements DataSource /* compile-time check for 4.1 extension */
{
private static final long serialVersionUID = -3936981157692787843L;
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSourceInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSourceInterface.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSourceInterface.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDataSourceInterface.java Wed Apr 24 04:37:28 2013
@@ -21,6 +21,7 @@
package org.apache.derby.jdbc;
+import javax.sql.DataSource;
import org.apache.derby.client.am.SqlException;
import org.apache.derby.client.net.NetConfiguration;
@@ -28,7 +29,7 @@ import org.apache.derby.client.net.NetCo
* Specifies Derby extensions to the {@code java.sqlx.DataSource}
* API common to all Derby client driver data sources.
*/
-public interface ClientDataSourceInterface extends javax.sql.DataSource {
+public interface ClientDataSourceInterface extends DataSource {
public void setPassword(String password);
public String getPassword();
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java Wed Apr 24 04:37:28 2013
@@ -21,9 +21,15 @@
package org.apache.derby.jdbc;
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.DriverPropertyInfo;
import java.util.Enumeration;
import java.util.Properties;
import java.sql.SQLException;
+import java.util.NoSuchElementException;
+import java.util.StringTokenizer;
import org.apache.derby.client.am.Configuration;
import org.apache.derby.client.am.SqlException;
import org.apache.derby.client.am.Utils;
@@ -41,7 +47,7 @@ import org.apache.derby.shared.common.re
/**
* The client JDBC driver (type 4) for Derby.
*/
-public class ClientDriver implements java.sql.Driver {
+public class ClientDriver implements Driver {
private transient int traceFileSuffixIndex_ = 0;
private final static int DERBY_REMOTE_PROTOCOL = 1;
@@ -81,8 +87,8 @@ public class ClientDriver implements jav
try {
registeredDriver__ = me;
- java.sql.DriverManager.registerDriver(registeredDriver__);
- } catch (java.sql.SQLException e) {
+ DriverManager.registerDriver(registeredDriver__);
+ } catch (SQLException e) {
// A null log writer is passed, because jdbc 1 sql exceptions are automatically traced
exceptionsOnLoadDriver__ =
new SqlException(null,
@@ -94,8 +100,8 @@ public class ClientDriver implements jav
public ClientDriver() {
}
- public java.sql.Connection connect(String url,
- java.util.Properties properties) throws java.sql.SQLException {
+ public Connection connect(String url,
+ Properties properties) throws SQLException {
NetConnection conn;
checkURLNotNull( url );
@@ -106,11 +112,11 @@ public class ClientDriver implements jav
}
if (properties == null) {
- properties = new java.util.Properties();
+ properties = new Properties();
}
- java.util.StringTokenizer urlTokenizer =
- new java.util.StringTokenizer(url, "/:= \t\n\r\f", true);
+ StringTokenizer urlTokenizer =
+ new StringTokenizer(url, "/:= \t\n\r\f", true);
int protocol = tokenizeProtocol(url, urlTokenizer);
if (protocol == 0) {
@@ -121,7 +127,7 @@ public class ClientDriver implements jav
if (protocol == DERBY_REMOTE_PROTOCOL) {
try {
slashOrNull = urlTokenizer.nextToken(":/");
- } catch (java.util.NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
throw new SqlException(null,
new ClientMessageId(SQLState.MALFORMED_URL),
@@ -137,14 +143,15 @@ public class ClientDriver implements jav
// database is the database name and attributes. This will be
// sent to network server as the databaseName
String database = tokenizeDatabase(urlTokenizer, url); // "database"
- java.util.Properties augmentedProperties = tokenizeURLProperties(url, properties);
+ Properties augmentedProperties =
+ tokenizeURLProperties(url, properties);
database = appendDatabaseAttributes(database,augmentedProperties);
int traceLevel;
try {
traceLevel =
ClientBaseDataSourceRoot.getTraceLevel(augmentedProperties);
- } catch (java.lang.NumberFormatException e) {
+ } catch (NumberFormatException e) {
// A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
throw new SqlException(null,
new ClientMessageId(SQLState.TRACELEVEL_FORMAT_INVALID), e);
@@ -156,7 +163,7 @@ public class ClientDriver implements jav
// This log writer will be passed to the agent constructor.
LogWriter dncLogWriter =
ClientBaseDataSourceRoot.computeDncLogWriterForNewConnection(
- java.sql.DriverManager.getLogWriter(),
+ DriverManager.getLogWriter(),
ClientBaseDataSourceRoot.getTraceDirectory(
augmentedProperties),
ClientBaseDataSourceRoot.getTraceFile(
@@ -169,9 +176,8 @@ public class ClientDriver implements jav
conn = (NetConnection)getFactory().
- newNetConnection((NetLogWriter)
- dncLogWriter,
- java.sql.DriverManager.getLoginTimeout(),
+ newNetConnection((NetLogWriter)dncLogWriter,
+ DriverManager.getLoginTimeout(),
server,
port,
database,
@@ -213,14 +219,14 @@ public class ClientDriver implements jav
return longDatabase.toString();
}
- public boolean acceptsURL(String url) throws java.sql.SQLException {
+ public boolean acceptsURL(String url) throws SQLException {
checkURLNotNull( url );
try
{
- java.util.StringTokenizer urlTokenizer =
- new java.util.StringTokenizer(url, "/:=; \t\n\r\f", true);
+ StringTokenizer urlTokenizer =
+ new StringTokenizer(url, "/:=; \t\n\r\f", true);
int protocol = tokenizeProtocol(url, urlTokenizer);
return protocol != 0;
}
@@ -229,7 +235,7 @@ public class ClientDriver implements jav
throw se.getSQLException();
}
}
- private void checkURLNotNull( String url ) throws java.sql.SQLException
+ private void checkURLNotNull( String url ) throws SQLException
{
if ( url == null )
{
@@ -241,25 +247,27 @@ public class ClientDriver implements jav
}
}
- public java.sql.DriverPropertyInfo[] getPropertyInfo(String url,
- java.util.Properties properties) throws java.sql.SQLException {
- java.sql.DriverPropertyInfo driverPropertyInfo[] = new java.sql.DriverPropertyInfo[2];
+ public DriverPropertyInfo[] getPropertyInfo(
+ String url,
+ Properties properties) throws SQLException {
+
+ DriverPropertyInfo driverPropertyInfo[] = new DriverPropertyInfo[2];
// If there are no properties set already,
// then create a dummy properties just to make the calls go thru.
if (properties == null) {
- properties = new java.util.Properties();
+ properties = new Properties();
}
driverPropertyInfo[0] =
- new java.sql.DriverPropertyInfo(
+ new DriverPropertyInfo(
Attribute.USERNAME_ATTR,
properties.getProperty(
Attribute.USERNAME_ATTR,
ClientBaseDataSourceRoot.propertyDefault_user));
driverPropertyInfo[1] =
- new java.sql.DriverPropertyInfo(Attribute.PASSWORD_ATTR,
+ new DriverPropertyInfo(Attribute.PASSWORD_ATTR,
properties.getProperty(Attribute.PASSWORD_ATTR));
driverPropertyInfo[0].description =
@@ -293,7 +301,10 @@ public class ClientDriver implements jav
// "jdbc:derby:"
// and return 0 if the protcol is unrecognized
// return DERBY_PROTOCOL for "jdbc:derby"
- private static int tokenizeProtocol(String url, java.util.StringTokenizer urlTokenizer) throws SqlException {
+ private static int tokenizeProtocol(
+ String url,
+ StringTokenizer urlTokenizer) throws SqlException {
+
// Is this condition necessary, StringTokenizer constructor may do this for us
if (url == null) {
return 0;
@@ -326,14 +337,14 @@ public class ClientDriver implements jav
}
return protocol;
- } catch (java.util.NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
return 0;
}
}
// tokenize "/server" from URL jdbc:derby://server:port/
// returns server name
- private static String tokenizeServerName(java.util.StringTokenizer urlTokenizer,
+ private static String tokenizeServerName(StringTokenizer urlTokenizer,
String url) throws SqlException {
try {
if (!urlTokenizer.nextToken("/").equals("/"))
@@ -343,7 +354,7 @@ public class ClientDriver implements jav
new ClientMessageId(SQLState.MALFORMED_URL), url);
}
return urlTokenizer.nextToken("/:");
- } catch (java.util.NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
throw new SqlException(null,
new ClientMessageId(SQLState.MALFORMED_URL), url);
@@ -352,7 +363,7 @@ public class ClientDriver implements jav
// tokenize "[:portNumber]/" from URL jdbc:derby://server[:port]/
// returns the portNumber or zero if portNumber is not specified.
- private static int tokenizeOptionalPortNumber(java.util.StringTokenizer urlTokenizer,
+ private static int tokenizeOptionalPortNumber(StringTokenizer urlTokenizer,
String url) throws SqlException {
try {
String firstToken = urlTokenizer.nextToken(":/");
@@ -371,7 +382,7 @@ public class ClientDriver implements jav
throw new SqlException(null,
new ClientMessageId(SQLState.MALFORMED_URL), url);
}
- } catch (java.util.NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
throw new SqlException(null,
new ClientMessageId(SQLState.MALFORMED_URL), url, e);
@@ -379,21 +390,21 @@ public class ClientDriver implements jav
}
//return database name
- private static String tokenizeDatabase(java.util.StringTokenizer urlTokenizer,
+ private static String tokenizeDatabase(StringTokenizer urlTokenizer,
String url) throws SqlException {
try {
// DERBY-618 - database name can contain spaces in the path
String databaseName = urlTokenizer.nextToken("\t\n\r\f;");
return databaseName;
- } catch (java.util.NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
throw new SqlException(null,
new ClientMessageId(SQLState.MALFORMED_URL), url, e);
}
}
- private static java.util.Properties tokenizeURLProperties(String url,
- java.util.Properties properties)
+ private static Properties tokenizeURLProperties(String url,
+ Properties properties)
throws SqlException {
String attributeString = null;
int attributeIndex = -1;
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java Wed Apr 24 04:37:28 2013
@@ -23,6 +23,7 @@ package org.apache.derby.jdbc;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
+import javax.sql.XADataSource;
import org.apache.derby.client.am.ClientMessageId;
import org.apache.derby.client.am.SqlException;
import org.apache.derby.shared.common.reference.SQLState;
@@ -56,7 +57,7 @@ import org.apache.derby.shared.common.re
* <P>See ClientDataSource40 for DataSource properties.</p>
*/
public class ClientXADataSource40 extends ClientXADataSource
- implements javax.sql.XADataSource /* compile-time check for 4.1 extension */
+ implements XADataSource /* compile-time check for 4.1 extension */
{
private static final long serialVersionUID = -3463444509507830926L;
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java Wed Apr 24 04:37:28 2013
@@ -21,9 +21,11 @@
package org.apache.derby.jdbc;
+import javax.sql.XADataSource;
+
/**
* Specifies Derby extensions to the {@code java.sqlx.XADataSource}.
*/
public interface ClientXADataSourceInterface
- extends ClientDataSourceInterface, javax.sql.XADataSource {
+ extends ClientDataSourceInterface, XADataSource {
}
Modified: db/derby/code/trunk/java/testing/org/apache/derby/client/am/LogicalStatementEntityTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derby/client/am/LogicalStatementEntityTest.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derby/client/am/LogicalStatementEntityTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derby/client/am/LogicalStatementEntityTest.java Wed Apr 24 04:37:28 2013
@@ -292,9 +292,9 @@ public class LogicalStatementEntityTest
JDBCStatementCache cache)
throws SQLException {
StatementCacheInteractor cacheInteractor =
- new StatementCacheInteractor(
- cache,
- ((org.apache.derby.client.am.Connection)getConnection()));
+ new StatementCacheInteractor(
+ cache,
+ ((org.apache.derby.client.am.ClientConnection)getConnection()));
LogicalStatementEntity entity;
if (isCallable) {
entity = (LogicalStatementEntity)cacheInteractor.prepareCall(sql);
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java Wed Apr 24 04:37:28 2013
@@ -36,6 +36,7 @@ import junit.framework.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.*;
+import org.apache.derby.client.am.ClientStatement;
/**
* Tests for new methods added for Statement in JDBC4.
@@ -539,7 +540,7 @@ public class StatementTest
{
if ( onClient )
{
- org.apache.derby.client.am.Statement.fetchedRowBase = rowCountBase;
+ ClientStatement.fetchedRowBase = rowCountBase;
}
else
{
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java Wed Apr 24 04:37:28 2013
@@ -378,10 +378,21 @@ public class VerifySignatures extends Ba
Method impMethod =
derbyImplementation.getMethod(ifaceMethod.getName(),
ifaceMethod.getParameterTypes());
-
- assertEquals("Incorrect return type",
- ifaceMethod.getReturnType(),
- impMethod.getReturnType());
+ StringBuilder sb = new StringBuilder();
+ Class[] pts = ifaceMethod.getParameterTypes();
+ sb.append("(");
+ for (int i=0; i < pts.length; i++) {
+ sb.append(pts[i].getName());
+ if (i < pts.length -1) {
+ sb.append(", ");
+ }
+ }
+ sb.append(")");
+ assertEquals(
+ "Incorrect return type for " + ifaceMethod.getName() +
+ sb.toString(),
+ ifaceMethod.getReturnType(),
+ impMethod.getReturnType());
int modifiers = impMethod.getModifiers();
assertTrue("Non-public method", Modifier.isPublic(modifiers));
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java Wed Apr 24 04:37:28 2013
@@ -26,7 +26,7 @@ import java.sql.SQLException;
import org.apache.derby.impl.jdbc.EmbedResultSet40;
import org.apache.derby.client.net.NetResultSet40;
import org.apache.derby.impl.jdbc.EmbedCallableStatement40;
-import org.apache.derby.client.am.CallableStatement40;
+import org.apache.derby.client.am.ClientCallableStatement40;
import org.apache.derby.iapi.jdbc.BrokeredCallableStatement40;
import org.apache.derby.client.am.LogicalCallableStatement40;
@@ -46,7 +46,7 @@ public class Wrapper41
private EmbedResultSet40 _embedded;
private NetResultSet40 _netclient;
private EmbedCallableStatement40 _embedCallableStatement;
- private CallableStatement40 _callableStatement;
+ private ClientCallableStatement40 _callableStatement;
private BrokeredCallableStatement40 _brokeredCallableStatement;
private LogicalCallableStatement40 _logicalCallableStatement;
@@ -62,7 +62,7 @@ public class Wrapper41
else if ( wrapped instanceof EmbedCallableStatement40 ) { _embedCallableStatement = (EmbedCallableStatement40) wrapped; }
else if ( wrapped instanceof BrokeredCallableStatement40 ) { _brokeredCallableStatement = (BrokeredCallableStatement40) wrapped; }
else if ( wrapped instanceof NetResultSet40 ) { _netclient = (NetResultSet40) wrapped; }
- else if ( wrapped instanceof CallableStatement40 ) { _callableStatement = (CallableStatement40) wrapped; }
+ else if ( wrapped instanceof ClientCallableStatement40 ) { _callableStatement = (ClientCallableStatement40) wrapped; }
else if ( wrapped instanceof LogicalCallableStatement40 ) { _logicalCallableStatement = (LogicalCallableStatement40) wrapped; }
else { throw nothingWrapped(); }
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CacheSessionDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CacheSessionDataTest.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CacheSessionDataTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CacheSessionDataTest.java Wed Apr 24 04:37:28 2013
@@ -34,6 +34,7 @@ import java.sql.ResultSet;
import java.util.Arrays;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.derby.client.am.ClientConnection;
import org.apache.derbyTesting.junit.BaseJDBCTestCase;
import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
import org.apache.derbyTesting.junit.JDBC;
@@ -451,8 +452,7 @@ public class CacheSessionDataTest extend
private void verifyCachedSchema(Connection c) throws SQLException {
if (usingDerbyNetClient()) {
String cached =
- ((org.apache.derby.client.am.Connection) c).
- getCurrentSchemaName();
+ ((ClientConnection) c).getCurrentSchemaName();
Statement s = c.createStatement();
ResultSet rs = s.executeQuery("VALUES CURRENT SCHEMA");
rs.next();
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41DBMD.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41DBMD.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41DBMD.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41DBMD.java Wed Apr 24 04:37:28 2013
@@ -24,7 +24,7 @@ package org.apache.derbyTesting.function
import java.sql.SQLException;
import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData;
-import org.apache.derby.client.am.DatabaseMetaData;
+import org.apache.derby.client.am.ClientDatabaseMetaData;
/**
* A wrapper around the new DatabaseMetaData methods added by JDBC 4.1.
@@ -40,7 +40,7 @@ public class Wrapper41DBMD
///////////////////////////////////////////////////////////////////////
protected EmbedDatabaseMetaData _embedded;
- protected DatabaseMetaData _netclient;
+ protected ClientDatabaseMetaData _netclient;
///////////////////////////////////////////////////////////////////////
//
@@ -51,7 +51,7 @@ public class Wrapper41DBMD
public Wrapper41DBMD( Object wrapped ) throws Exception
{
if ( wrapped instanceof EmbedDatabaseMetaData ) { _embedded = (EmbedDatabaseMetaData) wrapped; }
- else if ( wrapped instanceof DatabaseMetaData ) { _netclient = (DatabaseMetaData) wrapped; }
+ else if ( wrapped instanceof ClientDatabaseMetaData ) { _netclient = (ClientDatabaseMetaData) wrapped; }
else { throw nothingWrapped(); }
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41Statement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41Statement.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41Statement.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper41Statement.java Wed Apr 24 04:37:28 2013
@@ -23,6 +23,7 @@ package org.apache.derbyTesting.function
import java.lang.reflect.Method;
import java.sql.SQLException;
+import org.apache.derby.client.am.ClientStatement;
import org.apache.derby.iapi.jdbc.EngineStatement;
import org.apache.derby.client.am.LogicalPreparedStatement;
@@ -39,7 +40,7 @@ public class Wrapper41Statement
///////////////////////////////////////////////////////////////////////
private EngineStatement _engineStatement;
- private org.apache.derby.client.am.Statement _netStatement;
+ private ClientStatement _netStatement;
private LogicalPreparedStatement _logicalStatement;
///////////////////////////////////////////////////////////////////////
@@ -51,7 +52,7 @@ public class Wrapper41Statement
public Wrapper41Statement( Object wrapped ) throws Exception
{
if ( wrapped instanceof EngineStatement ) { _engineStatement = (EngineStatement) wrapped; }
- else if ( wrapped instanceof org.apache.derby.client.am.Statement ) { _netStatement = (org.apache.derby.client.am.Statement) wrapped; }
+ else if ( wrapped instanceof ClientStatement ) { _netStatement = (ClientStatement) wrapped; }
else if ( wrapped instanceof LogicalPreparedStatement ) { _logicalStatement = (LogicalPreparedStatement) wrapped; }
else { throw nothingWrapped(); }
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper42DBMD.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper42DBMD.java?rev=1471245&r1=1471244&r2=1471245&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper42DBMD.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/Wrapper42DBMD.java Wed Apr 24 04:37:28 2013
@@ -24,7 +24,7 @@ package org.apache.derbyTesting.function
import java.sql.SQLException;
import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData;
-import org.apache.derby.client.am.DatabaseMetaData;
+import org.apache.derby.client.am.ClientDatabaseMetaData;
/**
* A wrapper around the new DatabaseMetaData methods added by JDBC 4.2.