Skip to content

Commit 55f0b7f

Browse files
author
v-ahibr
authored
Merge pull request #134 from Microsoft/dev
Preview release v6.1.3
2 parents 162e292 + c845b92 commit 55f0b7f

File tree

192 files changed

+52405
-57011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+52405
-57011
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file.
33

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

6+
## [6.1.3]
7+
### Added
8+
- Added Binary and Varbinary types to the jUnit test framework [#119](https://github.com/Microsoft/mssql-jdbc/pull/119)
9+
- Added BulkCopy test cases for csv [#123](https://github.com/Microsoft/mssql-jdbc/pull/123)
10+
- Added BulkCopy ColumnMapping test cases [#127](https://github.com/Microsoft/mssql-jdbc/pull/127)
11+
12+
### Changed
13+
- Switched to clean rounding for bigDecimal [#118](https://github.com/Microsoft/mssql-jdbc/pull/118)
14+
- Updated BVT tests to use jUnit test framework [#120](https://github.com/Microsoft/mssql-jdbc/pull/120)
15+
- In case of socket timeout occurance, avoid connection retry [#122](https://github.com/Microsoft/mssql-jdbc/pull/122)
16+
- Changed ant build file to skip tests [#126](https://github.com/Microsoft/mssql-jdbc/pull/126)
17+
18+
### Fixed Issues
19+
- Fixed the inconsistent coding style [#4](https://github.com/Microsoft/mssql-jdbc/issues/4)
20+
- Fixed NullPointerException in case when SocketTimeout occurs [#65](https://github.com/Microsoft/mssql-jdbc/issues/121)
21+
22+
623
## [6.1.2]
724
### Added
825
- Socket timeout implementation for both connection string and data source [#85](https://github.com/Microsoft/mssql-jdbc/pull/85)

Coding_Guidelines.md

+31-22
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The purpose of the Java Coding Standards is to create a collaboration baseline.
99

1010
## 1. General
1111

12-
All **changed code**, must obey these *coding standards*. As we have huge legacy code we will have code which defers Coding Standards.
12+
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).
1313

1414
## 2. Comments
1515

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

2020
```java
2121
/**
22-
* Get property-only names that do not work with connection String
23-
* @param name to normalize
22+
* Get property-only names that do not work with connection String
23+
*
24+
* @param name
25+
* to normalize
2426
* @param logger
2527
* @return the normalized property name
2628
*/
27-
static String getPropertyOnlyName(String name, Logger logger) {
28-
if(null == name) {
29+
static String getPropertyOnlyName(String name, Logger logger) {
30+
if (null == name) {
2931
return name;
3032
}
3133
... some complex logic
32-
}
34+
}
3335
```
3436

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

5153
```java
52-
/**
53-
* File Name: {File_Name}
54-
* Created : ${date}
55-
*
54+
/*
5655
* Microsoft JDBC Driver for SQL Server
57-
* The MIT License (MIT)
58-
* Copyright(c) ${year} Microsoft Corporation
5956
*
60-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
61-
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
62-
* 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:
63-
*
64-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
57+
* Copyright(c) Microsoft Corporation All rights reserved.
6558
*
66-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
67-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
68-
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
69-
* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59+
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
7060
*/
7161
```
7262

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

226216
Consider the use of common design patterns.
227217

228-
### 5.1. Enums
218+
### 5.1. Enums <a name="EnumSpec"></a>
229219

230220
Constrain arguments by using type safe enumerations.
231221

@@ -243,7 +233,26 @@ public enum Options {
243233
String yes = "YES";
244234
String no = "NO";
245235
```
236+
<br />
237+
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.
246238

239+
**Correct:**
240+
```java
241+
public enum SqlType{
242+
VARCHAR ("varchar", JDBCType.VARCHAR),
243+
NVARCHAR ("nvarchar", JDBCType.NVARCHAR),
244+
CHAR ("char", JDBCType.CHAR);
245+
}
246+
```
247+
248+
**Incorrect**
249+
```java
250+
public enum SqlType {
251+
VARCHAR("varchar", JDBCType.VARCHAR),
252+
NVARCHAR("nvarchar", JDBCType.NVARCHAR),
253+
CHAR("char", JDBCType.CHAR);
254+
}
255+
```
247256

248257
### 5.2. Private Helpers
249258

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright(c) 2016 Microsoft Corporation
1+
Copyright(c) 2017 Microsoft Corporation
22
All rights reserved.
33

44
MIT License

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ What's coming next? We will look into adding a more comprehensive set of tests,
3434
* An instance of SQL Server or Azure SQL Database that you can connect to.
3535

3636
### Build the JAR files
37-
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.
37+
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.
3838

3939
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).
4040

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

119+
## Guidelines for Creating Pull Requests
120+
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.
121+
122+
Thank you!
123+
119124
## Guidelines for Reporting Issues
120125
We appreciate you taking the time to test the driver, provide feedback and report any issues. It would be extremely helpful if you:
121126

build.gradle

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'java'
22

33
archivesBaseName = 'mssql-jdbc'
4-
version = '6.1.2'
4+
version = '6.1.3'
55

66
allprojects {
77
tasks.withType(JavaCompile) {
@@ -51,6 +51,13 @@ sourceSets {
5151
include 'META-INF/services/java.sql.Driver'
5252
}
5353
}
54+
test {
55+
resources {
56+
srcDirs 'src/test/resources'
57+
include '**/*.csv'
58+
output.resourcesDir = output.classesDir
59+
}
60+
}
5461
}
5562

5663
//Get dependencies from Maven central repository
@@ -71,5 +78,3 @@ dependencies {
7178
'org.junit.jupiter:junit-jupiter-api:5.0.0-M3',
7279
'org.junit.jupiter:junit-jupiter-engine:5.0.0-M3'
7380
}
74-
75-

build.xml

+1-61
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
</description>
55
<!-- set global properties for this build -->
66
<property name="artifactId" value="mssql-jdbc"/>
7-
<property name="version" value="6.1.2"/>
7+
<property name="version" value="6.1.3"/>
88

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

1412
<!-- download dependencies -->
1513
<ivy:resolve>
@@ -35,7 +33,6 @@
3533
<!-- Create the build directory structure used by compile -->
3634
<mkdir dir="${build}"/>
3735
<mkdir dir="${build}/classes"/>
38-
<mkdir dir="${bvtTest_Classes}"/>
3936
</target>
4037

4138
<target name="compile" depends="init"
@@ -75,7 +72,6 @@
7572
<fileset dir="${build}/classes/jdbc41"/>
7673
<metainf dir="META-INF"/>
7774
</jar>
78-
<antcall target="Test41"/>
7975
</target>
8076

8177
<target name="build42" description="generate the distribution">
@@ -94,7 +90,6 @@
9490
<fileset dir="${build}/classes/jdbc42"/>
9591
<metainf dir="META-INF"/>
9692
</jar>
97-
<antcall target="Test42"/>
9893
</target>
9994

10095
<target name="build" description="generate the distribution">
@@ -103,61 +98,6 @@
10398
<antcall target="build42"/>
10499
</target>
105100

106-
<target name="compile_test"
107-
description="compile the junit source">
108-
<javac classpathref="${JDBC_VERSION}" srcdir="${bvtTest}"
109-
destdir="${bvtTest_Classes}"
110-
encoding="UTF-8"
111-
source="${JAVA_VERSION}"
112-
target="${JAVA_VERSION}"
113-
description="compiling the junit source" >
114-
</javac>
115-
</target>
116-
117-
<target name="Test41" >
118-
<antcall target="compile_test">
119-
<param name="JAVA_VERSION" value="1.7"/>
120-
<param name="JDBC_VERSION" value="test_classpath41"/>
121-
</antcall>
122-
<junit haltonfailure="true" printsummary="true" showoutput="true" fork="true">
123-
<formatter type="plain" usefile="false" />
124-
<classpath><path refid="test_classpath41" /></classpath>
125-
<test name="com.microsoft.sqlserver.jdbc.bvt.bvtTest"></test>
126-
</junit>
127-
</target>
128-
129-
<target name="Test42" >
130-
<antcall target="compile_test">
131-
<param name="JAVA_VERSION" value="1.8"/>
132-
<param name="JDBC_VERSION" value="test_classpath42"/>
133-
</antcall>
134-
<junit haltonfailure="true" printsummary="true" showoutput="true" fork="true">
135-
<formatter type="plain" usefile="false" />
136-
<classpath><path refid="test_classpath42" /></classpath>
137-
<test name="com.microsoft.sqlserver.jdbc.bvt.bvtTest"></test>
138-
</junit>
139-
</target>
140-
141-
<path id="test_classpath41">
142-
<path location="${build}">
143-
<fileset dir="${build}" includes="${artifactId}-${version}.jre7.jar"></fileset>
144-
</path>
145-
<path location="lib">
146-
<fileset dir="lib" includes="*.jar"></fileset>
147-
</path>
148-
<path location="${bvtTest_Classes}"></path>
149-
</path>
150-
151-
<path id="test_classpath42">
152-
<path location="${build}">
153-
<fileset dir="${build}" includes="${artifactId}-${version}.jre8.jar"></fileset>
154-
</path>
155-
<path location="lib">
156-
<fileset dir="lib" includes="*.jar"></fileset>
157-
</path>
158-
<path location="${bvtTest_Classes}"></path>
159-
</path>
160-
161101
<target name="clean"
162102
description="clean up">
163103
<delete dir="${build}"/>

0 commit comments

Comments
 (0)