Skip to content

Commit

Permalink
Merge pull request #134 from Microsoft/dev
Browse files Browse the repository at this point in the history
Preview release v6.1.3
  • Loading branch information
v-ahibr authored Jan 31, 2017
2 parents 162e292 + c845b92 commit 55f0b7f
Show file tree
Hide file tree
Showing 192 changed files with 52,405 additions and 57,011 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ 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.3]
### Added
- Added Binary and Varbinary types to the jUnit test framework [#119](https://github.com/Microsoft/mssql-jdbc/pull/119)
- Added BulkCopy test cases for csv [#123](https://github.com/Microsoft/mssql-jdbc/pull/123)
- Added BulkCopy ColumnMapping test cases [#127](https://github.com/Microsoft/mssql-jdbc/pull/127)

### Changed
- Switched to clean rounding for bigDecimal [#118](https://github.com/Microsoft/mssql-jdbc/pull/118)
- Updated BVT tests to use jUnit test framework [#120](https://github.com/Microsoft/mssql-jdbc/pull/120)
- In case of socket timeout occurance, avoid connection retry [#122](https://github.com/Microsoft/mssql-jdbc/pull/122)
- Changed ant build file to skip tests [#126](https://github.com/Microsoft/mssql-jdbc/pull/126)

### Fixed Issues
- Fixed the inconsistent coding style [#4](https://github.com/Microsoft/mssql-jdbc/issues/4)
- Fixed NullPointerException in case when SocketTimeout occurs [#65](https://github.com/Microsoft/mssql-jdbc/issues/121)


## [6.1.2]
### Added
- Socket timeout implementation for both connection string and data source [#85](https://github.com/Microsoft/mssql-jdbc/pull/85)
Expand Down
53 changes: 31 additions & 22 deletions Coding_Guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The purpose of the Java Coding Standards is to create a collaboration baseline.

## 1. General

All **changed code**, must obey these *coding standards*. As we have huge legacy code we will have code which defers Coding Standards.
All **changed code**, must obey these *coding standards*. As we have huge legacy code we will have code which defers Coding Standards. Eclipse code formatter [mssql-jdbc_formatter.xml](mssql-jdbc_formatter.xml) must be used to format the **changed code**, except for [enum types](#EnumSpec).

## 2. Comments

Expand All @@ -19,17 +19,19 @@ We should give appropriate java comments in code. Please find ideal example of j

```java
/**
* Get property-only names that do not work with connection String
* @param name to normalize
* Get property-only names that do not work with connection String
*
* @param name
* to normalize
* @param logger
* @return the normalized property name
*/
static String getPropertyOnlyName(String name, Logger logger) {
if(null == name) {
static String getPropertyOnlyName(String name, Logger logger) {
if (null == name) {
return name;
}
... some complex logic
}
}
```

**Incorrect:**
Expand All @@ -49,24 +51,12 @@ We should give appropriate java comments in code. Please find ideal example of j
All Java files should contain the appropriate copyright notice at the beginning of the file.

```java
/**
* File Name: {File_Name}
* Created : ${date}
*
/*
* Microsoft JDBC Driver for SQL Server
* The MIT License (MIT)
* Copyright(c) ${year} Microsoft Corporation
*
* 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.
* Copyright(c) Microsoft Corporation All rights reserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
*/
```

Expand Down Expand Up @@ -225,7 +215,7 @@ List people = Arrays.asList("you", "me");

Consider the use of common design patterns.

### 5.1. Enums
### 5.1. Enums <a name="EnumSpec"></a>

Constrain arguments by using type safe enumerations.

Expand All @@ -243,7 +233,26 @@ public enum Options {
String yes = "YES";
String no = "NO";
```
<br />
enum value with multiple constants must be alligned such that the constant of same type from all the values must be alligned in same column.

**Correct:**
```java
public enum SqlType{
VARCHAR ("varchar", JDBCType.VARCHAR),
NVARCHAR ("nvarchar", JDBCType.NVARCHAR),
CHAR ("char", JDBCType.CHAR);
}
```

**Incorrect**
```java
public enum SqlType {
VARCHAR("varchar", JDBCType.VARCHAR),
NVARCHAR("nvarchar", JDBCType.NVARCHAR),
CHAR("char", JDBCType.CHAR);
}
```

### 5.2. Private Helpers

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright(c) 2016 Microsoft Corporation
Copyright(c) 2017 Microsoft Corporation
All rights reserved.

MIT License
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ What's coming next? We will look into adding a more comprehensive set of tests,
* 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 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.
Maven and Gradle 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 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).

Expand Down Expand Up @@ -116,6 +116,11 @@ If you wish to limit the number of run-time dependencies, and your project does
</dependency>
```

## Guidelines for Creating Pull Requests
We love contributions from the community. To help improve the quality of our code, we encourage you to use the mssql-jdbc_formatter.xml formatter provided on all pull requests.

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:

Expand Down
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'java'

archivesBaseName = 'mssql-jdbc'
version = '6.1.2'
version = '6.1.3'

allprojects {
tasks.withType(JavaCompile) {
Expand Down Expand Up @@ -51,6 +51,13 @@ sourceSets {
include 'META-INF/services/java.sql.Driver'
}
}
test {
resources {
srcDirs 'src/test/resources'
include '**/*.csv'
output.resourcesDir = output.classesDir
}
}
}

//Get dependencies from Maven central repository
Expand All @@ -71,5 +78,3 @@ dependencies {
'org.junit.jupiter:junit-jupiter-api:5.0.0-M3',
'org.junit.jupiter:junit-jupiter-engine:5.0.0-M3'
}


62 changes: 1 addition & 61 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
</description>
<!-- set global properties for this build -->
<property name="artifactId" value="mssql-jdbc"/>
<property name="version" value="6.1.2"/>
<property name="version" value="6.1.3"/>

<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
<property name="bvtTest" location="src/test/java/com/microsoft/sqlserver/jdbc/bvt/"/>
<property name="bvtTest_Classes" location="${build}/classes/test/bvt"/>

<!-- download dependencies -->
<ivy:resolve>
Expand All @@ -35,7 +33,6 @@
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${bvtTest_Classes}"/>
</target>

<target name="compile" depends="init"
Expand Down Expand Up @@ -75,7 +72,6 @@
<fileset dir="${build}/classes/jdbc41"/>
<metainf dir="META-INF"/>
</jar>
<antcall target="Test41"/>
</target>

<target name="build42" description="generate the distribution">
Expand All @@ -94,7 +90,6 @@
<fileset dir="${build}/classes/jdbc42"/>
<metainf dir="META-INF"/>
</jar>
<antcall target="Test42"/>
</target>

<target name="build" description="generate the distribution">
Expand All @@ -103,61 +98,6 @@
<antcall target="build42"/>
</target>

<target name="compile_test"
description="compile the junit source">
<javac classpathref="${JDBC_VERSION}" srcdir="${bvtTest}"
destdir="${bvtTest_Classes}"
encoding="UTF-8"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
description="compiling the junit source" >
</javac>
</target>

<target name="Test41" >
<antcall target="compile_test">
<param name="JAVA_VERSION" value="1.7"/>
<param name="JDBC_VERSION" value="test_classpath41"/>
</antcall>
<junit haltonfailure="true" printsummary="true" showoutput="true" fork="true">
<formatter type="plain" usefile="false" />
<classpath><path refid="test_classpath41" /></classpath>
<test name="com.microsoft.sqlserver.jdbc.bvt.bvtTest"></test>
</junit>
</target>

<target name="Test42" >
<antcall target="compile_test">
<param name="JAVA_VERSION" value="1.8"/>
<param name="JDBC_VERSION" value="test_classpath42"/>
</antcall>
<junit haltonfailure="true" printsummary="true" showoutput="true" fork="true">
<formatter type="plain" usefile="false" />
<classpath><path refid="test_classpath42" /></classpath>
<test name="com.microsoft.sqlserver.jdbc.bvt.bvtTest"></test>
</junit>
</target>

<path id="test_classpath41">
<path location="${build}">
<fileset dir="${build}" includes="${artifactId}-${version}.jre7.jar"></fileset>
</path>
<path location="lib">
<fileset dir="lib" includes="*.jar"></fileset>
</path>
<path location="${bvtTest_Classes}"></path>
</path>

<path id="test_classpath42">
<path location="${build}">
<fileset dir="${build}" includes="${artifactId}-${version}.jre8.jar"></fileset>
</path>
<path location="lib">
<fileset dir="lib" includes="*.jar"></fileset>
</path>
<path location="${bvtTest_Classes}"></path>
</path>

<target name="clean"
description="clean up">
<delete dir="${build}"/>
Expand Down
Loading

0 comments on commit 55f0b7f

Please sign in to comment.