Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ public static synchronized void unregisterPerformanceLogCallback() {
static Properties fixupProperties(Properties props) throws SQLServerException {
// assert props !=null
Properties fixedup = new Properties();
Enumeration<?> e = props.keys();
Enumeration<?> e = props.propertyNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String newname = getNormalizedPropertyName(name, drLogger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,37 @@ public void testConnectionDriver() throws SQLException {
}
}
}

/**
* test connection properties
*
* @throws SQLException
*/
@Test
public void testDefaultProperties() throws SQLException {
SQLServerDriver d = new SQLServerDriver();
Properties defaults = new Properties();
defaults.setProperty(SQLServerDriverIntProperty.PORT_NUMBER.toString(), "101");
defaults.setProperty(SQLServerDriverStringProperty.DATABASE_NAME.toString(), "test");

Properties info = new Properties(defaults);
StringBuffer url = new StringBuffer();
url.append(Constants.JDBC_PREFIX).append(randomServer).append(";packetSize=512;");

// test defaults
DriverPropertyInfo[] infoArray = d.getPropertyInfo(url.toString(), info);

for (DriverPropertyInfo anInfoArray : infoArray) {
if (anInfoArray.name.equalsIgnoreCase(Constants.PORT_NUMBER)) {
assertTrue(anInfoArray.value.equalsIgnoreCase("101"),
TestResource.getResource("R_valuesAreDifferent"));
}
if (anInfoArray.name.equalsIgnoreCase(Constants.DATABASE_NAME)) {
assertTrue(anInfoArray.value.equalsIgnoreCase("test"),
TestResource.getResource("R_valuesAreDifferent"));
}
}
}

/**
* test application name
Expand Down