Skip to content

Commit

Permalink
Merge pull request #69 from Microsoft/dev
Browse files Browse the repository at this point in the history
Preparing release
  • Loading branch information
AfsanehR-zz authored Dec 6, 2016
2 parents 9d76e67 + 4bc558f commit eb14f63
Show file tree
Hide file tree
Showing 114 changed files with 6,813 additions and 3,540 deletions.
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
sudo: required

language: java
jdk:
- oraclejdk8

services:
- docker

env:
- mssql_jdbc_test_connection_properties='jdbc:sqlserver://localhost:1433;databaseName=master;username=sa;password=<YourStrong!Passw0rd>;'

install:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild41
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Pbuild42

before_script:
- docker pull microsoft/mssql-server-linux
- docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 -d microsoft/mssql-server-linux

script:
- docker ps -a
- mvn test -B -Pbuild41
- mvn test -B -Pbuild42
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Change Log
All notable changes to this project will be documented in this file.

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

## [6.1.1]
### Added
- Java Docs [#46](https://github.com/Microsoft/mssql-jdbc/pull/46)
- Driver version number in LOGIN7 packet [#43](https://github.com/Microsoft/mssql-jdbc/pull/43)
- Travis- CI Integration [#23](https://github.com/Microsoft/mssql-jdbc/pull/23)
- Appveyor Integration [#23](https://github.com/Microsoft/mssql-jdbc/pull/23)
- Make Ms Jdbc driver more Spring friendly [#9](https://github.com/Microsoft/mssql-jdbc/pull/9)
- Implement Driver#getParentLogger [#8](https://github.com/Microsoft/mssql-jdbc/pull/8)
- Implement missing MetaData #unwrap methods [#12](https://github.com/Microsoft/mssql-jdbc/pull/12)
- Added Gradle build script [#54](https://github.com/Microsoft/mssql-jdbc/pull/54)
- Added a queryTimeout connection parameter [#45](https://github.com/Microsoft/mssql-jdbc/pull/45)
- Added Stored Procedure support for TVP [#47](https://github.com/Microsoft/mssql-jdbc/pull/47)

### Changed
- Use StandardCharsets [#15](https://github.com/Microsoft/mssql-jdbc/pull/15)
- Use Charset throughout [#26](https://github.com/Microsoft/mssql-jdbc/pull/26)
- Upgrade azure-keyvault to 0.9.7 [#50](https://github.com/Microsoft/mssql-jdbc/pull/50)
- Avoid unnecessary calls to String copy constructor [#14](https://github.com/Microsoft/mssql-jdbc/pull/14)
- make setObject() throw a clear exception for TVP when using with result set [#48](https://github.com/Microsoft/mssql-jdbc/pull/48)
- Few clean-ups like remove wild card imports, unused imports etc. [#52](https://github.com/Microsoft/mssql-jdbc/pull/52)
- Update Maven Plugin [#55](https://github.com/Microsoft/mssql-jdbc/pull/55)


## [6.1.0]
### Changed
- Open Sourced.



63 changes: 55 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,46 @@ What's coming next? We will look into adding a more comprehensive set of tests,
* [**Mac + SQL Server + Java**](https://www.microsoft.com/en-us/sql-server/developer-get-started/java-mac)
* [**Windows + SQL Server + Java**](https://www.microsoft.com/en-us/sql-server/developer-get-started/java-windows)


## Build
### Prerequisites
* Java 8
* [Ant](http://ant.apache.org/manual/install.html) (with [Ivy](https://ant.apache.org/ivy/download.cgi)) or [Maven](http://maven.apache.org/download.cgi)
* [Ant](http://ant.apache.org/manual/install.html) (with [Ivy](https://ant.apache.org/ivy/download.cgi)), [Maven](http://maven.apache.org/download.cgi) or [Gradle](https://gradle.org/gradle-download/)
* An instance of SQL Server or Azure SQL Database that you can connect to.

### Build the JAR files
The build automatically triggers a set of verification tests to run. For these tests to pass, you will first need to modify the serverConfig.cfg file under .\src\test to provide the correct connection properties for your SQL Server or Azure SQL Database instance.
The build automatically triggers 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 either Ant (with Ivy) or 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 8 with either Ant (with Ivy), Maven or Gradle. 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).

* Ant:
1. If you have not already done so, update the serverConfig.cfg file under .\src\test with the connection properties for your SQL Server or SQL DB instance.
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, JDBC 4.2 compliant jar, or both in the \build directory.
* Run `ant`. This creates both JDBC 4.1 compliant jar and JDBC 4.2 compliant jar in \build directory
* Run `ant build41`. This creates JDBC 4.1 compliant jar in \build directory
* Run `ant build42`. This creates JDBC 4.2 compliant jar in \build directory

* Maven:
1. If you have not already done so, update the serverConfig.cfg file under .\src\test 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 \build directory.
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
* Run `mvn install -Pbuild42`. This creates JDBC 4.2 compliant jar in \target directory

* Gradle:
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 \build\libs directory.
* Run `gradle build -Pbuild=build41`. This creates JDBC 4.1 compliant jar in \build\libs directory
* Run `gradle build -Pbuild=build42`. This creates JDBC 4.2 compliant jar in \build\libs directory

### Status of Most Recent Builds
| AppVeyor (Windows) | Travis CI (Linux) |
|--------------------------|--------------------------|
| [![av-image][]][av-site] | [![tv-image][]][tv-site] |

[av-image]: https://ci.appveyor.com/api/projects/status/o6fjg16678ol64d3?svg=true
[av-site]: https://ci.appveyor.com/project/Microsoft-JDBC/mssql-jdbc
[tv-image]: https://travis-ci.org/Microsoft/mssql-jdbc.svg?
[tv-site]: https://travis-ci.org/Microsoft/mssql-jdbc

## Resources

### Documentation
Expand All @@ -52,7 +67,7 @@ This driver is documented on [Microsoft's Documentation web site](https://msdn.m
For samples, please see the src\sample directory.

### Download the DLLs
For some features (e.g. Integrated Authentication and Distributed Transactions), you may need to use the sqljdbc_xa and sqljdbc_auth DLLs. They can be downloaded from the [Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774)
For some features (e.g. Integrated Authentication and Distributed Transactions), you may need to use the `sqljdbc_xa` and `sqljdbc_auth` DLLs. They can be downloaded from the [Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774)

### Download the driver
Don't want to compile anything?
Expand All @@ -69,6 +84,38 @@ We're now on the Maven Central Repository. Add the following to your POM file:

The driver can be downloaded from the [Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774)

##Dependencies
This project has following dependencies:

Compile Time:
- `azure-keyvault` : Azure Key Vault Provider for Always Encrypted feature

Test Time:
- `junit:jar` : For Unit Test cases.

###Dependency Tree
One can see all dependencies including Transitive Dependency by executing following command.
```
mvn dependency:tree
```

###Exclude Dependencies
If you wish to limit the number of run-time dependencies, and your project does not require the features named above, you can explicitly exclude them by adding exclusion tag.
***For Example:*** If you are not using *Always Encrypted Azure Key Vault feature* then you can exclude *azure-keyvault* dependency. Please see following snippet.
```
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
</exclusion>
</exclusions>
</dependency>
```

## 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:
Expand Down
16 changes: 16 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '{build}'

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

services:
- mssql2016

build_script:
- 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
66 changes: 66 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apply plugin: 'java'

archivesBaseName = 'mssql-jdbc'
version = '6.1.1'

allprojects {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
}
}

def excludedFile = ''

if(build == "build41") {
jar.archiveName = "${archivesBaseName}-${version}.jre7.jar"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'

sourceCompatibility = 1.7
targetCompatibility = 1.7
}

if(build == "build42") {
jar.archiveName = "${archivesBaseName}-${version}.jre8.jar"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java'

sourceCompatibility = 1.8
targetCompatibility = 1.8
}

jar {
manifest {
attributes 'Title': "Microsoft JDBC Driver ${version} for SQL Server",
'Version': version,
'Vendor': 'Microsoft Corporation'
}
}

sourceSets {
main {
java {
srcDirs 'src/main/java'
exclude excludedFile
}

resources {
srcDirs "$projectDir"
include 'META-INF/services/java.sql.Driver'
}
}
}

//Get dependencies from Maven central repository
repositories {
mavenCentral()
}

dependencies {
compile 'com.microsoft.azure:azure-keyvault:0.9.7',
'junit:junit:4.12'
}


8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</description>
<!-- set global properties for this build -->
<property name="artifactId" value="mssql-jdbc"/>
<property name="version" value="6.1.0"/>
<property name="version" value="6.1.1"/>

<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
Expand All @@ -13,7 +13,7 @@

<!-- download dependencies -->
<ivy:resolve>
<dependency org="com.microsoft.azure" name="azure-keyvault" rev="0.9.3"/>
<dependency org="com.microsoft.azure" name="azure-keyvault" rev="0.9.7"/>
<dependency org="junit" name="junit" rev="4.12"/>
</ivy:resolve>

Expand Down Expand Up @@ -55,7 +55,7 @@
<param name="CLASSES_DST_DIR" value="${build}/classes/jdbc41"/>
<param name="JAVA_VERSION" value="1.7"/>
<param name="DEBUG_LEVEL" value="source,lines"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc3.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc4.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java"/>
</antcall>
<jar destfile="${build}/${artifactId}-${version}.jre7.jar">
<manifest>
Expand All @@ -74,7 +74,7 @@
<param name="CLASSES_DST_DIR" value="${build}/classes/jdbc42"/>
<param name="JAVA_VERSION" value="1.8"/>
<param name="DEBUG_LEVEL" value="source,lines"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc3.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc4.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java"/>
</antcall>
<jar destfile="${build}/${artifactId}-${version}.jre8.jar">
<manifest>
Expand Down
32 changes: 21 additions & 11 deletions 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.1.0</version>
<version>6.1.1</version>

<packaging>jar</packaging>

Expand All @@ -23,6 +23,10 @@
</license>
</licenses>

<organization>
<name>Microsoft Corporation</name>
</organization>

<developers>
<developer>
<name>Andrea Lam</name>
Expand All @@ -44,7 +48,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
<version>0.9.3</version>
<version>0.9.7</version>
</dependency>

<!-- dependency for running tests -->
Expand All @@ -64,11 +68,9 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.6.0</version>
<configuration>
<excludes>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc3.java</exclude>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc4.java</exclude>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java</exclude>
</excludes>
<source>1.7</source>
Expand All @@ -80,7 +82,12 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<finalName>${project.artifactId}-${project.version}.jre7</finalName>
<finalName>${project.artifactId}-${project.version}.jre7</finalName>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
Expand All @@ -93,11 +100,9 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.6.0</version>
<configuration>
<excludes>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc3.java</exclude>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc4.java</exclude>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java</exclude>
</excludes>
<source>1.8</source>
Expand All @@ -109,7 +114,12 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<finalName>${project.artifactId}-${project.version}.jre8</finalName>
<finalName>${project.artifactId}-${project.version}.jre8</finalName>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
Expand All @@ -134,7 +144,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
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 @@ -6,7 +6,7 @@
// Copyright(c) Microsoft Corporation
// All rights reserved.
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright(c) Microsoft Corporation
// All rights reserved.
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Expand Down
Loading

0 comments on commit eb14f63

Please sign in to comment.