Skip to content

Commit

Permalink
Merge pull request #631 from Microsoft/dev
Browse files Browse the repository at this point in the history
Merge dev to master (RTW release 6.4.0)
  • Loading branch information
cheenamalhotra committed Feb 27, 2018
2 parents b09a02e + 9277451 commit e8ad454
Show file tree
Hide file tree
Showing 55 changed files with 1,278 additions and 674 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ local.properties
.settings/
.gradle/
.loadpath
outdated-dependencies.txt
pom.xml.versionBackup

# External tool builders
.externalToolBuilders/
Expand Down
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

language: java
jdk:
- oraclejdk8
- oraclejdk9

addons:
apt:
packages:
- oracle-java9-installer

services:
- docker

Expand All @@ -29,7 +34,7 @@ install:
- keytool -importkeystore -destkeystore clientcert.jks -deststorepass password -srckeystore identity.p12 -srcstoretype PKCS12 -srcstorepass password
- keytool -list -v -keystore clientcert.jks -storepass "password" > JavaKeyStore.txt
- cd ..
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild41
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild43
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild42

before_script:
Expand All @@ -39,6 +44,6 @@ before_script:
script:
- docker ps -a

##Test for JDBC Specification 41 & 42 and submit coverage report.
- mvn test -B -Pbuild41 jacoco:report && bash <(curl -s https://codecov.io/bash) -cF JDBC41
##Test for JDBC Specification 43 & 42 and submit coverage report.
- mvn test -B -Pbuild41 jacoco:report && bash <(curl -s https://codecov.io/bash) -cF JDBC43
- mvn test -B -Pbuild42 jacoco:report && bash <(curl -s https://codecov.io/bash) -cF JDBC42
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file.

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

## [6.4.0] Stable Release
### Added
- Support added for AAD Integrated Authentication with ADAL4J on Windows/Linux/Mac OS [#603](https://github.com/Microsoft/mssql-jdbc/pull/603)
- Enable Recover after MSDTC is restarted [#581](https://github.com/Microsoft/mssql-jdbc/pull/581)
- Added Version Update configuration rules to project [#541](https://github.com/Microsoft/mssql-jdbc/pull/541)
- JDK 9 Compatibility + JDBC 4.3 API support added to the driver [#601 (https://github.com/Microsoft/mssql-jdbc/pull/601)

### Fixed Issues
- Re-introduced Retry Logic for Prepared Statement Caching implementation and remove detect change context function [#618](https://github.com/Microsoft/mssql-jdbc/pull/618) and [#620](https://github.com/Microsoft/mssql-jdbc/pull/620)
- Fixes for SonarQube Reported issues [#599](https://github.com/Microsoft/mssql-jdbc/pull/599)
- Fixes for Random Assertion Errors [#597](https://github.com/Microsoft/mssql-jdbc/pull/597)

### Changed
- Updated Appveyor to use JDK9 building driver and running tests [#619](https://github.com/Microsoft/mssql-jdbc/pull/619)
- JDK 7 compilation support removed from the driver [#601](https://github.com/Microsoft/mssql-jdbc/pull/601)

## [6.3.6] Preview Release
### Added
- Added support for using database name as part of the key for handle cache [#561](https://github.com/Microsoft/mssql-jdbc/pull/561)
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ What's coming next? We will look into adding a more comprehensive set of tests,

## Build
### Prerequisites
* Java 8
* Java 9
* [Maven](http://maven.apache.org/download.cgi)
* An instance of SQL Server or Azure SQL Database that you can connect to.

### Build the JAR files
Maven builds automatically trigger a set of verification tests to run. For these tests to pass, you will first need to add an environment variable in your system called `mssql_jdbc_test_connection_properties` to provide the [correct connection properties](https://msdn.microsoft.com/en-us/library/ms378428(v=sql.110).aspx) for your SQL Server or Azure SQL Database instance.

To build the jar files, you must use Java 8 with Maven. You can choose to build a JDBC 4.1 compliant jar file (for use with JRE 7) and/or a JDBC 4.2 compliant jar file (for use with JRE 8).
To build the jar files, you must use Java 9 with Maven. You can choose to build a JDBC 4.3 compliant jar file (for use with JRE 9) and/or a JDBC 4.2 compliant jar file (for use with JRE 8).

* Maven:
1. If you have not already done so, add the environment variable `mssql_jdbc_test_connection_properties` in your system with the connection properties for your SQL Server or SQL DB instance.
2. Run one of the commands below to build a JDBC 4.1 compliant jar or JDBC 4.2 compliant jar in the \target directory.
* Run `mvn install -Pbuild41`. This creates JDBC 4.1 compliant jar in \target directory
2. Run one of the commands below to build a JDBC 4.3 compliant jar or JDBC 4.2 compliant jar in the \target directory.
* Run `mvn install -Pbuild43`. This creates JDBC 4.3 compliant jar in \target directory
* Run `mvn install -Pbuild42`. This creates JDBC 4.2 compliant jar in \target directory

**NOTE**: Beginning release v6.1.7, we will no longer be maintaining the existing [Gradle build script](build.gradle) and it will be left in the repository for reference. Please refer to issue [#62](https://github.com/Microsoft/mssql-jdbc/issues/62) for this decision.
Expand Down Expand Up @@ -80,7 +80,7 @@ We're now on the Maven Central Repository. Add the following to your POM file to
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.2.jre8</version>
<version>6.4.0.jre9</version>
</dependency>
```
The driver can be downloaded from the [Microsoft Download Center](https://go.microsoft.com/fwlink/?linkid=852460).
Expand All @@ -100,8 +100,8 @@ To get the latest preview version of the driver, add the following to your POM f
This project has following dependencies:

Compile Time:
- `azure-keyvault` : Azure Key Vault Provider for Always Encrypted feature (optional)
- `adal4j` : Azure ActiveDirectory Library for Java for Azure Active Directory Authentication feature (optional)
- `azure-keyvault` : Azure Key Vault Provider for Always Encrypted Azure Key Vault feature (optional)
- `adal4j` : Azure ActiveDirectory Library for Java for Azure Active Directory Authentication feature and Azure Key Vault feature (optional)

Test Time:
- `junit:jar` : For Unit Test cases.
Expand All @@ -120,26 +120,32 @@ 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.6.jre8-preview</version>
<version>6.4.0.jre9</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
</dependency>
```

***For Example:*** If you are using *Azure Key Vault feature* then you need to redeclare *azure-keyvault* dependency in your project's pom file. Please see the following snippet:
***For Example:*** If you are using *Azure Key Vault feature* then you need to redeclare *azure-keyvault* dependency and *adal4j* dependency in your project's pom file. Please see the following snippet:
```xml
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.6.jre8-preview</version>
<version>6.4.0.jre9</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.4.0</version>
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
Expand All @@ -154,7 +160,7 @@ We love contributions from the community. To help improve the quality of our co
Thank you!

## Guidelines for Reporting Issues
We appreciate you taking the time to test the driver, provide feedback and report any issues. It would be extremely helpful if you:
We appreciate you taking the time to test the driver, provide feedback and report any issues. It would be extremely helpful if you:

- Report each issue as a new issue (but check first if it's already been reported)
- Try to be detailed in your report. Useful information for good bug reports include:
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ init:
- cmd: net start MSSQL$%SQL_Instance%

environment:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
JAVA_HOME: C:\Program Files\Java\jdk9
mssql_jdbc_test_connection_properties: jdbc:sqlserver://localhost:1433;instanceName=%SQL_Instance%;databaseName=master;username=sa;password=Password12!;

matrix:
Expand Down Expand Up @@ -32,9 +32,9 @@ build_script:
- keytool -importkeystore -srckeystore cert.pfx -srcstoretype pkcs12 -destkeystore clientcert.jks -deststoretype JKS -srcstorepass password -deststorepass password
- keytool -list -v -keystore clientcert.jks -storepass "password" > JavaKeyStore.txt
- cd..
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild41
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild43
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild42

test_script:
- mvn test -B -Pbuild41
- mvn test -B -Pbuild43
- mvn test -B -Pbuild42
26 changes: 26 additions & 0 deletions maven-version-rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" comparisonMethod="maven" xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
<ignoreVersions>
<!-- Ignore Alpha's, Beta's, release candidates and milestones -->
<ignoreVersion type="regex">(?i).*Alpha(?:-?\d+)?</ignoreVersion>
<ignoreVersion type="regex">(?i).*Beta(?:-?\d+)?</ignoreVersion>
<ignoreVersion type="regex">(?i).*-B(?:-?\d+)?</ignoreVersion>
<ignoreVersion type="regex">(?i).*RC(?:-?\d+)?</ignoreVersion>
<ignoreVersion type="regex">(?i).*EA(?:-?\d+)?</ignoreVersion>
<ignoreVersion type="regex">(?i).*SNAPSHOT(?:-?\d+)?</ignoreVersion>
<!-- Sometimes Milestone releases are fair enough for testing libs like JUnit-->
<ignoreVersion type="regex">(?i).*M(?:-?\d+)?</ignoreVersion>
</ignoreVersions>

<rules>
<!-- One can add different rules in order to exclude specific version from automatic updates. -->
<!-- Testing... Update groupId, artifact id and appropriate version in order to exclude from versioning plugin
<rule groupId="com.microsoft.azure" artifactId="adal4j">
<ignoreVersions>
<ignoreVersion>1.3.0</ignoreVersion>
</ignoreVersions>
</rule>
-->
</rules>

</ruleset>
47 changes: 28 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.6.${jreVersion}-preview</version>
<version>6.4.0.${jreVersion}</version>
<packaging>jar</packaging>

<name>Microsoft JDBC Driver for SQL Server</name>
Expand Down Expand Up @@ -54,7 +55,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<optional>true</optional>
</dependency>

Expand Down Expand Up @@ -117,7 +118,7 @@
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>2.6.1</version>
<version>2.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -138,10 +139,10 @@

<profiles>
<profile>
<id>build41</id>
<id>build42</id>

<properties>
<jreVersion>jre7</jreVersion>
<jreVersion>jre8</jreVersion>
</properties>

<build>
Expand All @@ -151,10 +152,10 @@
<version>3.6.0</version>
<configuration>
<excludes>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java</exclude>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc43.java</exclude>
</excludes>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
Expand All @@ -166,21 +167,19 @@
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>

</plugin>
</plugins>
</build>
</profile>

<profile>
<id>build42</id>

<id>build43</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>

<properties>
<jreVersion>jre8</jreVersion>
<jreVersion>jre9</jreVersion>
</properties>

<build>
Expand All @@ -190,10 +189,10 @@
<version>3.6.0</version>
<configuration>
<excludes>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java</exclude>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java</exclude>
</excludes>
<source>1.8</source>
<target>1.8</target>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -278,7 +277,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
Expand All @@ -300,7 +299,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<version>3.0.0-M1</version>

<configuration>
<failOnError>true</failOnError>
Expand Down Expand Up @@ -335,6 +334,16 @@
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<outputFile>outdated-dependencies.txt</outputFile>
<rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>
</configuration>
</plugin>

</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ final class AuthenticationJNI extends SSPIAuthentication {
static int GetMaxSSPIBlobSize() {
return sspiBlobMaxlen;
}

static boolean isDllLoaded() {
return enabled;
}

static {
UnsatisfiedLinkError temp = null;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/microsoft/sqlserver/jdbc/DDC.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static final Object convertFloatToObject(float floatVal,
return new BigDecimal(Float.toString(floatVal));
case FLOAT:
case DOUBLE:
return (new Float(floatVal)).doubleValue();
return (Float.valueOf(floatVal)).doubleValue();
case BINARY:
return convertIntToBytes(Float.floatToRawIntBits(floatVal), 4);
default:
Expand Down Expand Up @@ -275,7 +275,7 @@ static final Object convertDoubleToObject(double doubleVal,
case DOUBLE:
return doubleVal;
case REAL:
return (new Double(doubleVal)).floatValue();
return (Double.valueOf(doubleVal)).floatValue();
case INTEGER:
return (int) doubleVal;
case SMALLINT: // small and tinyint returned as short
Expand Down Expand Up @@ -439,7 +439,7 @@ private static byte[] convertToBytes(BigDecimal value,
}
}
int offset = numBytes - unscaledBytes.length;
System.arraycopy(unscaledBytes, offset - offset, ret, offset, numBytes - offset);
System.arraycopy(unscaledBytes, 0, ret, offset, numBytes - offset);
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void setupInfo(SQLServerConnection con) throws SQLServerException {
instancePort = con.getInstancePort(failoverPartner, instanceValue);

try {
portNumber = new Integer(instancePort);
portNumber = Integer.parseInt(instancePort);
}
catch (NumberFormatException e) {
// Should not get here as the server should give a proper port number anyway.
Expand Down
Loading

0 comments on commit e8ad454

Please sign in to comment.