Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull from main #11

Merged
merged 76 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
40edfde
removing java.xml.bind dependency
AfsanehR-zz Sep 25, 2017
380ab87
removed dependency of java.xml.bind and updated pom file with latest …
AfsanehR-zz Sep 25, 2017
04e4a0b
disabled appveyor and updated travic to use java 9
AfsanehR-zz Sep 25, 2017
0b094dc
Fixed NoSuchMethodError when compiling with Java 9 but running on jav…
AfsanehR-zz Sep 25, 2017
022d747
add support for JDBC 4.3 APIs and throw unsupported exceptions for th…
AfsanehR-zz Sep 25, 2017
98f9f65
fixed the javadoc warnings.
AfsanehR-zz Sep 25, 2017
7ed782d
update SQLServerJdbc41 to throw unsupportedError for 4.3 APIs
AfsanehR-zz Sep 25, 2017
b42c200
works for AAD integrated on driver side changes
xiangyushawn Sep 29, 2017
d95575b
remove hardcoded username from exception message
xiangyushawn Oct 3, 2017
9d604ee
cleanup
xiangyushawn Oct 24, 2017
c399a60
remove error message when running AAD integrated on non-windows OS
xiangyushawn Oct 24, 2017
db5f09f
read user name from kerberos TGT client name
xiangyushawn Oct 26, 2017
1cc1170
add error message when Future's outcome has no AuthenticationResult b…
xiangyushawn Oct 26, 2017
0691598
Version Update Configuration Rules.
nsidhaye Nov 4, 2017
74e12a9
Added `outdated-dependencies.txt` in .gitignore
nsidhaye Nov 5, 2017
8004cdf
if password is null, it means AAD integrated auth
xiangyushawn Nov 24, 2017
1c389e8
remove apache code for encoder and remove 4.1 compaitble jars
AfsanehR-zz Nov 27, 2017
8ef32d8
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into Java9
AfsanehR-zz Nov 27, 2017
6f9fec6
Merge pull request #565 from Microsoft/dev
AfsanehR-zz Nov 27, 2017
778d3ee
updated dependency versions in pom file for jdbc 4.3 branch
AfsanehR-zz Nov 28, 2017
8c7f465
Merge pull request #566 from v-afrafi/Java9
AfsanehR-zz Nov 29, 2017
27b9414
update samples in JDBC 4.3 branch + change the the junit.platform.ver…
AfsanehR-zz Nov 30, 2017
b1dbacc
Merge pull request #570 from v-afrafi/Java9
AfsanehR-zz Nov 30, 2017
f1674af
update sendTimeAsDateTime property to false.
AfsanehR-zz Dec 5, 2017
7ec7356
remove deprecated APIs
AfsanehR-zz Dec 6, 2017
3a21346
add more catch blocks for new getDeclaredConstructor method.
AfsanehR-zz Dec 7, 2017
9540cce
update Travis script with official support of jdk 9
AfsanehR-zz Dec 8, 2017
24486c9
fix comment
AfsanehR-zz Dec 8, 2017
47ddc43
update readme file
AfsanehR-zz Dec 8, 2017
7a2bbef
Merge pull request #577 from v-afrafi/Java9
AfsanehR-zz Dec 11, 2017
855e9fe
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into AA…
xiangyushawn Dec 11, 2017
23aac33
make recovery work after ms dtc restart
AfsanehR-zz Dec 12, 2017
e601b81
use javax.security.auth.kerberos instead of sun.security.krb5.Credent…
xiangyushawn Dec 12, 2017
8070803
add log
xiangyushawn Dec 13, 2017
755b9c6
upadate comments and remove an unused import
AfsanehR-zz Dec 13, 2017
83ec122
remove JNI functions for AAD integrated auth
xiangyushawn Dec 13, 2017
6ccf201
update the ADAL4J version to 1.4.0 in pom, this will break the compil…
xiangyushawn Dec 13, 2017
5846c8f
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into JD…
AfsanehR-zz Dec 15, 2017
29a8a3a
Merge pull request #586 from v-afrafi/JDBC4.3
cheenamalhotra Dec 15, 2017
84fb8c5
Merge pull request #587 from Microsoft/dev
cheenamalhotra Dec 15, 2017
257d6e1
use wrapper for sharding APIs
AfsanehR-zz Dec 18, 2017
6a833eb
fix another issue with Java 9 regarding bulkcopy connection check
AfsanehR-zz Dec 18, 2017
4b28d70
added another fix
AfsanehR-zz Dec 19, 2017
19d8a51
added cast to Buffer
AfsanehR-zz Dec 19, 2017
99868e6
change Base64.getEncoder().encodeToString()
AfsanehR-zz Dec 20, 2017
b9fc801
Make sure the right wrapper is used for 4.2 and above.
AfsanehR-zz Dec 20, 2017
8faa912
make SQLServerConnection43 throw SQLServerException for new Unsupport…
AfsanehR-zz Dec 20, 2017
9f3dedd
Merge pull request #589 from v-afrafi/JDBC4.3_Wrapper
AfsanehR-zz Dec 21, 2017
9d33494
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into dev
AfsanehR-zz Dec 21, 2017
db760b5
update readme for AKV
xiangyushawn Dec 29, 2017
daa647c
& is not allowed in error strings or parsing fails.
peterbae Jan 2, 2018
16d3bb0
Merge pull request #594 from peterbae/localization-jdbc4.3
peterbae Jan 3, 2018
877cd7a
update the dtc_xa_interface to use the correct flag for xa_start
AfsanehR-zz Jan 4, 2018
598292b
Merge pull request #591 from v-xiangs/AKV-read-me
cheenamalhotra Jan 5, 2018
2791904
fixed random assertion error
rene-ye Jan 5, 2018
bf28544
spacing
rene-ye Jan 5, 2018
bef12b2
logger security fix
rene-ye Jan 5, 2018
98182f9
sonarQube fixes
rene-ye Jan 5, 2018
697757b
Merge pull request #572 from v-afrafi/sendTimeAsDateTime_property
cheenamalhotra Jan 12, 2018
0cd1a72
Merge pull request #581 from v-afrafi/xaFix
cheenamalhotra Jan 12, 2018
a93737d
Merge branch 'AAD-integrated-investigation' of https://github.com/v-x…
AfsanehR-zz Jan 12, 2018
b567e72
use dll authentication when DLL is loaded and windows is the operatin…
AfsanehR-zz Jan 13, 2018
d6080c8
Added XML header
cheenamalhotra Jan 17, 2018
7a7a8b4
Policheck issue fixes
cheenamalhotra Jan 18, 2018
8141c69
Merge pull request #606 from cheenamalhotra/dev
cheenamalhotra Jan 18, 2018
ecf505f
Merge pull request #599 from rene-ye/sonarQube
cheenamalhotra Jan 18, 2018
4c361c8
Merge pull request #598 from rene-ye/loggerSecurity
cheenamalhotra Jan 18, 2018
5d15edb
Merge pull request #597 from rene-ye/JavaAssertionError
cheenamalhotra Jan 18, 2018
ba52c78
Merge remote-tracking branch 'upstream/dev' into dev
nsidhaye Jan 20, 2018
e79f964
Updated as per review comments
nsidhaye Jan 20, 2018
5669308
Merge branch 'dev' into JDBC4.3
cheenamalhotra Jan 23, 2018
2e5d9d3
Merge pull request #603 from v-afrafi/AADIntegrationAuth
AfsanehR-zz Jan 23, 2018
82b43b0
Merge pull request #541 from nsidhaye/dev
cheenamalhotra Jan 23, 2018
e0e70a4
Merge pull request #601 from Microsoft/JDBC4.3
AfsanehR-zz Jan 23, 2018
4fef240
Update POM XML with SNAPSHOT Tag
cheenamalhotra Jan 27, 2018
5856172
Merge pull request #613 from cheenamalhotra/dev
cheenamalhotra Jan 27, 2018
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
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
20 changes: 13 additions & 7 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 @@ -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 Down Expand Up @@ -131,7 +131,7 @@ Projects that require either of the two features need to explicitly declare the
</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>
Expand All @@ -140,6 +140,12 @@ Projects that require either of the two features need to explicitly declare the
<scope>compile</scope>
</dependency>

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

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
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 -Pbuild42
# - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild41
# - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild42

test_script:
- mvn test -B -Pbuild41
- mvn test -B -Pbuild42
#test_script:
# - mvn test -B -Pbuild41
# - 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-SNAPSHOT.${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