Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0e6f120
Initial commit for the new connection property - sslprotocol
ulvii Jul 28, 2017
7f5606c
Adding another value that will let the users specify default
ulvii Jul 29, 2017
1b0224c
Replace explicit types with <> (The diamond operator).
JamieMagee Jul 31, 2017
7b7275b
Replace for and while loops with foeach loops
JamieMagee Jul 31, 2017
9713fe2
make TLS keyword default
ulvii Jul 31, 2017
81b3f06
minor fixes
ulvii Jul 31, 2017
f88b361
Merge branch 'dev' into TLSVersionFix
ulvii Jul 31, 2017
dee4059
Update SQLServerResource.java
ulvii Jul 31, 2017
11cd000
Update SSLProtocolTest.java
ulvii Jul 31, 2017
a3b3bc8
Applying formatting
ulvii Aug 1, 2017
65de9a9
Applying formatting
ulvii Aug 1, 2017
558801c
Reverting back to tabs
ulvii Aug 1, 2017
5d46e6a
Minor fix
ulvii Aug 1, 2017
94cc5e2
Update SSLProtocolTest.java
ulvii Aug 2, 2017
9d0486c
fixed issue with sql_variant
AfsanehR-zz Aug 14, 2017
ac44f6e
setNull depends on sendStringParameterAsUnicode
xiangyushawn Aug 14, 2017
cce8eac
make sendStringParameterAsUnicode impact updateNull() as well
xiangyushawn Aug 14, 2017
dd74c9d
do not override the maxlength type in sql_variant when reading the va…
AfsanehR-zz Aug 15, 2017
be29264
Fixed issue with throwing error message for unsupported datatype.
AfsanehR-zz Aug 16, 2017
149e8d8
add test
xiangyushawn Aug 17, 2017
cc11277
rename a variable
xiangyushawn Aug 17, 2017
3a9d8da
update error messages for localization
xiangyushawn Aug 17, 2017
3bc6f34
fix misspelled words
xiangyushawn Aug 17, 2017
6790ecd
adding one error message back
xiangyushawn Aug 17, 2017
5bc2a9f
too bad.. I forgot to fix the misspelled word....
xiangyushawn Aug 17, 2017
117bd76
fix tests
xiangyushawn Aug 17, 2017
29d4e40
change cancellded to canceled
xiangyushawn Aug 17, 2017
e581dcf
Merge pull request #452 from v-xiangs/xiangs-dev
xiangyushawn Aug 18, 2017
b7777d9
Fix typo in Javadoc
mches Aug 18, 2017
8abe96c
Merge pull request #454 from mches/fix-javadoc-typo
xiangyushawn Aug 18, 2017
93e087c
Merge pull request #422 from ulvii/TLSVersionFix
ulvii Aug 18, 2017
35cfed9
Fixes all statement leaks in the driver.
peterbae Aug 18, 2017
d068bda
Fix issues with resultset getting closed before it's consumed / closi…
peterbae Aug 21, 2017
195719e
test
peterbae Aug 22, 2017
332a942
Removed logic for closing a statement that is still used somewhere, a…
peterbae Aug 22, 2017
9859067
remove unnecessary import
peterbae Aug 22, 2017
04f7b93
Throw the initial batch exception
AfsanehR-zz Aug 23, 2017
94f8829
Change formatting
peterbae Aug 23, 2017
e95082e
Merge branch 'statementLeak' of https://github.com/peterbae/mssql-jdb…
AfsanehR-zz Aug 23, 2017
396ea49
Merge branch 'dev' into sql_variant_temproal_fix
cheenamalhotra Aug 24, 2017
490c169
Merge pull request #455 from peterbae/statementLeak
peterbae Aug 28, 2017
1892ee1
updated test file
AfsanehR-zz Aug 28, 2017
5a55172
added test for the fix.
AfsanehR-zz Aug 28, 2017
a4bae33
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into sq…
AfsanehR-zz Aug 28, 2017
8c4f6f2
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into dev
AfsanehR-zz Aug 28, 2017
bad7829
Setting the loginTimout to default in case of a zero value (#456)
ulvii Aug 28, 2017
7cc14cc
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into sq…
AfsanehR-zz Aug 29, 2017
d9ffd9c
Resolving conflicts
AfsanehR-zz Aug 29, 2017
d1d2ccb
fix indentation of SQLServerResource.java
AfsanehR-zz Aug 29, 2017
e207571
added test
AfsanehR-zz Aug 29, 2017
80a4665
Merge pull request #442 from v-afrafi/sql_variant_fix
AfsanehR-zz Aug 29, 2017
5e6eb38
Merge pull request #450 from v-afrafi/sql_variant_temproal_fix
AfsanehR-zz Aug 29, 2017
b756dd6
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into dev
AfsanehR-zz Aug 29, 2017
ff085a5
add slow tag to tests
AfsanehR-zz Aug 30, 2017
3c9f635
Merge pull request #445 from v-xiangs/make-sendStringParameterAsUnico…
AfsanehR-zz Aug 31, 2017
7e7ada5
Fixing a few mistakes in SQLServerResource (#459)
ulvii Aug 31, 2017
5597d4d
Merge pull request #461 from v-afrafi/skipLongRunningTests
AfsanehR-zz Aug 31, 2017
ef28f62
Removing connection property - fipsProvider (#460)
ulvii Aug 31, 2017
2e87201
Merge pull request #421 from JamieMagee/foreach
peterbae Aug 31, 2017
e277087
Replace explicit types with <>
peterbae Aug 31, 2017
b31ec7c
Revert "Replace explicit types with <>"
peterbae Aug 31, 2017
a9fa2c2
Merge branch 'explicit-type-diamond' of https://github.com/JamieMagee…
peterbae Aug 31, 2017
4e66654
Merge branch 'JamieMagee-explicit-type-diamond' into dev
peterbae Aug 31, 2017
5a13577
Merge pull request #468 from peterbae/dev
peterbae Aug 31, 2017
b7fee51
Merge pull request #458 from v-afrafi/batchUpdateException
AfsanehR-zz Sep 1, 2017
460e3a3
update 6.3.1 to 6.3.2
xiangyushawn Sep 6, 2017
3e3a34e
update changelog
xiangyushawn Sep 6, 2017
3923086
update changelog format
xiangyushawn Sep 6, 2017
756bbb5
Merge pull request #478 from v-xiangs/xiangs-dev
xiangyushawn Sep 6, 2017
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)

## [6.3.2] Preview Release
### Added
- Added new connection property: sslProtocol [#422](https://github.com/Microsoft/mssql-jdbc/pull/422)
- Added "slow" tag to long running tests [#461](https://github.com/Microsoft/mssql-jdbc/pull/461)

### Fixed Issues
- Fixed some error messages [#452](https://github.com/Microsoft/mssql-jdbc/pull/452) & [#459](https://github.com/Microsoft/mssql-jdbc/pull/459)
- Fixed statement leaks [#455](https://github.com/Microsoft/mssql-jdbc/pull/455)
- Fixed an issue regarding to loginTimeout with TLS [#456](https://github.com/Microsoft/mssql-jdbc/pull/456)
- Fixed sql_variant issue with String type [#442](https://github.com/Microsoft/mssql-jdbc/pull/442)
- Fixed issue with throwing error message for unsupported datatype [#450](https://github.com/Microsoft/mssql-jdbc/pull/450)
- Fixed issue that initial batchException was not thrown [#458](https://github.com/Microsoft/mssql-jdbc/pull/458)

### Changed
- Changed sendStringParameterAsUnicode to impact set/update null [#445](https://github.com/Microsoft/mssql-jdbc/pull/445)
- Removed connection property: fipsProvider [#460](https://github.com/Microsoft/mssql-jdbc/pull/460)
- Replaced for and while loops with foeach loops [#421](https://github.com/Microsoft/mssql-jdbc/pull/421)
- Replaced explicit types with the diamond operator [#468](https://github.com/Microsoft/mssql-jdbc/pull/468) & [#420](https://github.com/Microsoft/mssql-jdbc/pull/420)

## [6.3.1] Preview Release
### Added
- Added support for datetime/smallDatetime in TVP [#435](https://github.com/Microsoft/mssql-jdbc/pull/435)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ To get the latest preview version of the driver, add the following to your POM f
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.1.jre8-preview-v2</version>
<version>6.3.2.jre8-preview</version>
</dependency>
```

Expand Down Expand Up @@ -120,7 +120,7 @@ Projects that require either of the two features need to explicitly declare the
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.1.jre8-preview-v2</version>
<version>6.3.2.jre8-preview</version>
<scope>compile</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.2-SNAPSHOT</version>
<version>6.3.2</version>

<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/AE.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ byte[] getCekMdVersion() {
cekId = 0;
cekVersion = 0;
cekMdVersion = null;
columnEncryptionKeyValues = new ArrayList<EncryptionKeyInfo>();
columnEncryptionKeyValues = new ArrayList<>();
}

int getSize() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ else if (jdbcType.isBinary()) {
// to the server as Unicode rather than MBCS. This is accomplished here by re-tagging
// the value with the appropriate corresponding Unicode type.
if ((null != cryptoMetadata) && (con.sendStringParametersAsUnicode())
&& (JavaType.STRING == javaType || JavaType.READER == javaType || JavaType.CLOB == javaType)) {
&& (JavaType.STRING == javaType || JavaType.READER == javaType || JavaType.CLOB == javaType || JavaType.OBJECT == javaType)) {
jdbcType = getSSPAUJDBCType(jdbcType);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/DDC.java
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,8 @@ static final Object convertTemporalToObject(JDBCType jdbcType,
}
// Convert the calendar value (in local time) to the desired Java object type.
switch (jdbcType.category) {
case BINARY: {
case BINARY:
case SQL_VARIANT: {
switch (ssType) {
case DATE: {
// Per JDBC spec, the time part of java.sql.Date values is initialized to midnight
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ private GetterConversion(SSType.Category from,
this.to = to;
}

private static final EnumMap<SSType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<SSType.Category, EnumSet<JDBCType.Category>>(
private static final EnumMap<SSType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<>(
SSType.Category.class);

static {
Expand Down Expand Up @@ -776,7 +776,7 @@ private SetterConversionAE(JavaType from,
this.to = to;
}

private static final EnumMap<JavaType, EnumSet<JDBCType>> setterConversionAEMap = new EnumMap<JavaType, EnumSet<JDBCType>>(JavaType.class);
private static final EnumMap<JavaType, EnumSet<JDBCType>> setterConversionAEMap = new EnumMap<>(JavaType.class);

static {
for (JavaType javaType : JavaType.values())
Expand Down Expand Up @@ -1086,7 +1086,7 @@ private SetterConversion(JDBCType.Category from,
this.to = to;
}

private static final EnumMap<JDBCType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<JDBCType.Category, EnumSet<JDBCType.Category>>(
private static final EnumMap<JDBCType.Category, EnumSet<JDBCType.Category>> conversionMap = new EnumMap<>(
JDBCType.Category.class);

static {
Expand Down Expand Up @@ -1305,7 +1305,7 @@ private UpdaterConversion(JDBCType.Category from,
this.to = to;
}

private static final EnumMap<JDBCType.Category, EnumSet<SSType.Category>> conversionMap = new EnumMap<JDBCType.Category, EnumSet<SSType.Category>>(
private static final EnumMap<JDBCType.Category, EnumSet<SSType.Category>> conversionMap = new EnumMap<>(
JDBCType.Category.class);

static {
Expand Down Expand Up @@ -1616,7 +1616,7 @@ private NormalizationAE(JDBCType from,
this.to = to;
}

private static final EnumMap<JDBCType, EnumSet<SSType>> normalizationMapAE = new EnumMap<JDBCType, EnumSet<SSType>>(JDBCType.class);
private static final EnumMap<JDBCType, EnumSet<SSType>> normalizationMapAE = new EnumMap<>(JDBCType.class);

static {
for (JDBCType jdbcType : JDBCType.values())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

final class FailoverMapSingleton {
private static int INITIALHASHMAPSIZE = 5;
private static HashMap<String, FailoverInfo> failoverMap = new HashMap<String, FailoverInfo>(INITIALHASHMAPSIZE);
private static HashMap<String, FailoverInfo> failoverMap = new HashMap<>(INITIALHASHMAPSIZE);

private FailoverMapSingleton() {
/* hide the constructor to stop the instantiation of this class. */}
Expand Down
83 changes: 29 additions & 54 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ void enableSSL(String host,

boolean isFips = false;
String trustStoreType = null;
String fipsProvider = null;
String sslProtocol = null;

// If anything in here fails, terminate the connection and throw an exception
try {
Expand All @@ -1597,11 +1597,11 @@ void enableSSL(String host,
trustStoreType = SQLServerDriverStringProperty.TRUST_STORE_TYPE.getDefaultValue();
}

fipsProvider = con.activeConnectionProperties.getProperty(SQLServerDriverStringProperty.FIPS_PROVIDER.toString());
isFips = Boolean.valueOf(con.activeConnectionProperties.getProperty(SQLServerDriverBooleanProperty.FIPS.toString()));
sslProtocol = con.activeConnectionProperties.getProperty(SQLServerDriverStringProperty.SSL_PROTOCOL.toString());

if (isFips) {
validateFips(fipsProvider, trustStoreType, trustStoreFileName);
validateFips(trustStoreType, trustStoreFileName);
}

assert TDS.ENCRYPT_OFF == con.getRequestedEncryptionLevel() || // Login only SSL
Expand Down Expand Up @@ -1647,12 +1647,8 @@ void enableSSL(String host,
if (logger.isLoggable(Level.FINEST))
logger.finest(toString() + " Finding key store interface");

if (isFips) {
ks = KeyStore.getInstance(trustStoreType, fipsProvider);
}
else {
ks = KeyStore.getInstance(trustStoreType);
}

ks = KeyStore.getInstance(trustStoreType);
ksProvider = ks.getProvider();

// Next, load up the trust store file from the specified location.
Expand Down Expand Up @@ -1728,7 +1724,7 @@ void enableSSL(String host,
if (logger.isLoggable(Level.FINEST))
logger.finest(toString() + " Getting TLS or better SSL context");

sslContext = SSLContext.getInstance("TLS");
sslContext = SSLContext.getInstance(sslProtocol);
sslContextProvider = sslContext.getProvider();

if (logger.isLoggable(Level.FINEST))
Expand All @@ -1745,8 +1741,7 @@ void enableSSL(String host,
logger.finest(toString() + " Creating SSL socket");

sslSocket = (SSLSocket) sslContext.getSocketFactory().createSocket(proxySocket, host, port, false); // don't close proxy when SSL socket
// is closed

// is closed
// At long last, start the SSL handshake ...
if (logger.isLoggable(Level.FINER))
logger.finer(toString() + " Starting SSL handshake");
Expand Down Expand Up @@ -1827,57 +1822,40 @@ void enableSSL(String host,
* Valid FIPS settings:
* <LI>Encrypt should be true
* <LI>trustServerCertificate should be false
* <LI>if certificate is not installed FIPSProvider & TrustStoreType should be present.
* <LI>if certificate is not installed TrustStoreType should be present.
*
* @param fipsProvider
* FIPS Provider
* @param trustStoreType
* @param trustStoreFileName
* @throws SQLServerException
* @since 6.1.4
*/
private void validateFips(final String fipsProvider,
final String trustStoreType,
private void validateFips(final String trustStoreType,
final String trustStoreFileName) throws SQLServerException {
boolean isValid = false;
boolean isEncryptOn;
boolean isValidTrustStoreType;
boolean isValidTrustStore;
boolean isTrustServerCertificate;
boolean isValidFipsProvider;

String strError = SQLServerException.getErrString("R_invalidFipsConfig");

isEncryptOn = (TDS.ENCRYPT_ON == con.getRequestedEncryptionLevel());

// Here different FIPS provider supports different KeyStore type along with different JVM Implementation.
isValidFipsProvider = !StringUtils.isEmpty(fipsProvider);
isValidTrustStoreType = !StringUtils.isEmpty(trustStoreType);
isValidTrustStore = !StringUtils.isEmpty(trustStoreFileName);
isTrustServerCertificate = con.trustServerCertificate();

if (isEncryptOn && !isTrustServerCertificate) {
if (logger.isLoggable(Level.FINER))
logger.finer(toString() + " Found parameters are encrypt is true & trustServerCertificate false");

if (isEncryptOn && !isTrustServerCertificate) {
isValid = true;

if (isValidTrustStore) {
// In case of valid trust store we need to check fipsProvider and TrustStoreType.
if (!isValidFipsProvider || !isValidTrustStoreType) {
isValid = false;
strError = SQLServerException.getErrString("R_invalidFipsProviderConfig");

// In case of valid trust store we need to check TrustStoreType.
if (!isValidTrustStoreType) {
isValid = false;
if (logger.isLoggable(Level.FINER))
logger.finer(toString() + " FIPS provider & TrustStoreType should pass with TrustStore.");
logger.finer(toString() + "TrustStoreType is required alongside with TrustStore.");
}
if (logger.isLoggable(Level.FINER))
logger.finer(toString() + " Found FIPS parameters seems to be valid.");
}
}
else {
strError = SQLServerException.getErrString("R_invalidFipsEncryptConfig");
}

if (!isValid) {
throw new SQLServerException(strError, null, 0, null);
Expand Down Expand Up @@ -2338,8 +2316,8 @@ else if (!useTnir) {
findSocketUsingJavaNIO(inetAddrs, portNumber, timeoutInMilliSeconds);
}
else {
LinkedList<Inet4Address> inet4Addrs = new LinkedList<Inet4Address>();
LinkedList<Inet6Address> inet6Addrs = new LinkedList<Inet6Address>();
LinkedList<Inet4Address> inet4Addrs = new LinkedList<>();
LinkedList<Inet6Address> inet6Addrs = new LinkedList<>();

for (InetAddress inetAddr : inetAddrs) {
if (inetAddr instanceof Inet4Address) {
Expand Down Expand Up @@ -2467,13 +2445,13 @@ private void findSocketUsingJavaNIO(InetAddress[] inetAddrs,
assert inetAddrs.length != 0 : "Number of inetAddresses should not be zero in this function";

Selector selector = null;
LinkedList<SocketChannel> socketChannels = new LinkedList<SocketChannel>();
LinkedList<SocketChannel> socketChannels = new LinkedList<>();
SocketChannel selectedChannel = null;

try {
selector = Selector.open();

for (int i = 0; i < inetAddrs.length; i++) {
for (InetAddress inetAddr : inetAddrs) {
SocketChannel sChannel = SocketChannel.open();
socketChannels.add(sChannel);

Expand All @@ -2484,10 +2462,10 @@ private void findSocketUsingJavaNIO(InetAddress[] inetAddrs,
int ops = SelectionKey.OP_CONNECT;
SelectionKey key = sChannel.register(selector, ops);

sChannel.connect(new InetSocketAddress(inetAddrs[i], portNumber));
sChannel.connect(new InetSocketAddress(inetAddr, portNumber));

if (logger.isLoggable(Level.FINER))
logger.finer(this.toString() + " initiated connection to address: " + inetAddrs[i] + ", portNumber: " + portNumber);
logger.finer(this.toString() + " initiated connection to address: " + inetAddr + ", portNumber: " + portNumber);
}

long timerNow = System.currentTimeMillis();
Expand Down Expand Up @@ -2646,8 +2624,8 @@ private void findSocketUsingThreading(LinkedList<Inet6Address> inetAddrs,

assert inetAddrs.isEmpty() == false : "Number of inetAddresses should not be zero in this function";

LinkedList<Socket> sockets = new LinkedList<Socket>();
LinkedList<SocketConnector> socketConnectors = new LinkedList<SocketConnector>();
LinkedList<Socket> sockets = new LinkedList<>();
LinkedList<SocketConnector> socketConnectors = new LinkedList<>();

try {

Expand Down Expand Up @@ -5037,13 +5015,11 @@ void writeTVPColumnMetaData(TVP value) throws SQLServerException {
writeShort((short) value.getTVPColumnCount());

Map<Integer, SQLServerMetaData> columnMetadata = value.getColumnMetadata();
Iterator<Entry<Integer, SQLServerMetaData>> columnsIterator = columnMetadata.entrySet().iterator();
/*
* TypeColumnMetaData = UserType Flags TYPE_INFO ColName ;
*/

while (columnsIterator.hasNext()) {
Map.Entry<Integer, SQLServerMetaData> pair = columnsIterator.next();
for (Entry<Integer, SQLServerMetaData> pair : columnMetadata.entrySet()) {
JDBCType jdbcType = JDBCType.of(pair.getValue().javaSqlType);
boolean useServerDefault = pair.getValue().useServerDefault;
// ULONG ; UserType of column
Expand Down Expand Up @@ -5118,13 +5094,12 @@ void writeTVPColumnMetaData(TVP value) throws SQLServerException {
writeByte(TDSType.NVARCHAR.byteValue());
isShortValue = (2L * pair.getValue().precision) <= DataTypes.SHORT_VARTYPE_MAX_BYTES;
// Use PLP encoding on Yukon and later with long values
if (!isShortValue) // PLP
if (!isShortValue) // PLP
{
// Handle Yukon v*max type header here.
writeShort((short) 0xFFFF);
con.getDatabaseCollation().writeCollation(this);
}
else // non PLP
} else // non PLP
{
writeShort((short) DataTypes.SHORT_VARTYPE_MAX_BYTES);
con.getDatabaseCollation().writeCollation(this);
Expand All @@ -5138,16 +5113,16 @@ void writeTVPColumnMetaData(TVP value) throws SQLServerException {
writeByte(TDSType.BIGVARBINARY.byteValue());
isShortValue = pair.getValue().precision <= DataTypes.SHORT_VARTYPE_MAX_BYTES;
// Use PLP encoding on Yukon and later with long values
if (!isShortValue) // PLP
if (!isShortValue) // PLP
// Handle Yukon v*max type header here.
writeShort((short) 0xFFFF);
else // non PLP
else // non PLP
writeShort((short) DataTypes.SHORT_VARTYPE_MAX_BYTES);
break;
case SQL_VARIANT:
writeByte(TDSType.SQL_VARIANT.byteValue());
writeInt(TDS.SQL_VARIANT_LENGTH);// write length of sql variant 8009

break;

default:
Expand All @@ -5168,7 +5143,7 @@ void writeTvpOrderUnique(TVP value) throws SQLServerException {

Map<Integer, SQLServerMetaData> columnMetadata = value.getColumnMetadata();
Iterator<Entry<Integer, SQLServerMetaData>> columnsIterator = columnMetadata.entrySet().iterator();
LinkedList<TdsOrderUnique> columnList = new LinkedList<TdsOrderUnique>();
LinkedList<TdsOrderUnique> columnList = new LinkedList<>();

while (columnsIterator.hasNext()) {
byte flags = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class JaasConfiguration extends Configuration {

private static AppConfigurationEntry[] generateDefaultConfiguration() {
if (Util.isIBM()) {
Map<String, String> confDetailsWithoutPassword = new HashMap<String, String>();
Map<String, String> confDetailsWithoutPassword = new HashMap<>();
confDetailsWithoutPassword.put("useDefaultCcache", "true");
Map<String, String> confDetailsWithPassword = new HashMap<String, String>();
Map<String, String> confDetailsWithPassword = new HashMap<>();
// We generated a two configurations fallback that is suitable for password and password-less authentication
// See https://www.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/security-component/jgssDocs/jaas_login_user.html
final String ibmLoginModule = "com.ibm.security.auth.module.Krb5LoginModule";
Expand All @@ -34,7 +34,7 @@ private static AppConfigurationEntry[] generateDefaultConfiguration() {
new AppConfigurationEntry(ibmLoginModule, AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, confDetailsWithPassword)};
}
else {
Map<String, String> confDetails = new HashMap<String, String>();
Map<String, String> confDetails = new HashMap<>();
confDetails.put("useTicketCache", "true");
return new AppConfigurationEntry[] {new AppConfigurationEntry("com.sun.security.auth.module.Krb5LoginModule",
AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, confDetails)};
Expand Down
Loading