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

JDK9 Compatibility + JDBC 4.3 API addition #601

Merged
merged 34 commits into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 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
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
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
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
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
5669308
Merge branch 'dev' into JDBC4.3
cheenamalhotra Jan 23, 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
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
8 changes: 4 additions & 4 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
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
32 changes: 15 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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 +138,10 @@

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

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

<build>
Expand All @@ -151,10 +151,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 +166,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 +188,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 +276,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 +298,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
4 changes: 2 additions & 2 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
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