Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.

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

## [7.1.0] Preview Release
### Added
- Added support for LocalDate, LocalTime and LocalDateTime to be passed as 'type' in ResultSet.getObject() [#749](https://github.com/Microsoft/mssql-jdbc/pull/749)
- Added support to read SQL Warnings after ResultSet is read completely [#785](https://github.com/Microsoft/mssql-jdbc/pull/785)

### Fixed Issues
- Fixed Javadoc warnings and removed obselete HTML tags from Javadocs [#786](https://github.com/Microsoft/mssql-jdbc/pull/786)
- Fixed random JUnit failures in framework tests [#762](https://github.com/Microsoft/mssql-jdbc/pull/762)

### Changed
- Improved performance of readLong() function by unrolling loop and using bitwise operators instead of additions [#763](https://github.com/Microsoft/mssql-jdbc/pull/763)
- Removed logging logic which caused performance degradation in AE [#773](https://github.com/Microsoft/mssql-jdbc/pull/773)

## [7.0.0] Stable Release
### Added
- Added 'Automatic-Module-Name' manifest entry to jre10 Jar, allowing JDK 10 users to access driver module 'com.microsoft.sqlserver.jdbc' [#732](https://github.com/Microsoft/mssql-jdbc/pull/732)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ To get the latest preview version of the driver, add the following to your POM f
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.5.4.jre10-preview</version>
<version>7.1.0.jre10-preview</version>
</dependency>
```
### Using driver as Java Module
Expand Down Expand Up @@ -119,7 +119,7 @@ Projects that require either of the two features need to explicitly declare the
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre10</version>
<version>7.1.0.jre10-preview</version>
<scope>compile</scope>
</dependency>

Expand All @@ -135,7 +135,7 @@ Projects that require either of the two features need to explicitly declare the
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre10</version>
<version>7.1.0.jre10-preview</version>
<scope>compile</scope>
</dependency>

Expand Down Expand Up @@ -183,7 +183,7 @@ Preview releases happen approximately monthly between stable releases. This give
You can see what is going into a future release by monitoring [Milestones](https://github.com/Microsoft/mssql-jdbc/milestones) in the repository.

### Versioning convention
Starting with 6.0, stable versions have an even minor version. For example, 6.0, 6.2, 6.4. Preview versions have an odd minor version. For example, 6.1, 6.3, 6.5.
Starting with 6.0, stable versions have an even minor version. For example, 6.0, 6.2, 6.4, 7.0. Preview versions have an odd minor version. For example, 6.1, 6.3, 6.5, 7.1.

## Contributors
Special thanks to everyone who has contributed to the project.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

apply plugin: 'java'

version = '7.1.0-SNAPSHOT'
version = '7.1.0'
def jreVersion = ""
def testOutputDir = file("build/classes/java/test")
def archivesBaseName = 'mssql-jdbc'
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.1.0-SNAPSHOT</version>
<version>7.1.0</version>
<packaging>jar</packaging>

<name>Microsoft JDBC Driver for SQL Server</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

final class SQLJdbcVersion {
static final int major = 7;
static final int minor = 0;
static final int minor = 1;
static final int patch = 0;
static final int build = 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ public byte[] encryptColumnEncryptionKey(String masterKeyPath, String encryption
System.arraycopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.length);

javaKeyStoreLogger.exiting(SQLServerColumnEncryptionJavaKeyStoreProvider.class.getName(),
"encryptColumnEncryptionKey",
"Finished encrypting Column Encryption Key.");
"encryptColumnEncryptionKey", "Finished encrypting Column Encryption Key.");
return encryptedColumnEncryptionKey;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2381,16 +2381,15 @@ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
returnValue = getTime(columnIndex);
} else if (type == java.sql.Timestamp.class) {
returnValue = getTimestamp(columnIndex);
} else if (type == java.time.LocalDateTime.class
|| type == java.time.LocalDate.class
} else if (type == java.time.LocalDateTime.class || type == java.time.LocalDate.class
|| type == java.time.LocalTime.class) {
java.sql.Timestamp ts = getTimestamp(columnIndex,
Calendar.getInstance(java.util.TimeZone.getTimeZone("UTC")));
if (ts == null) {
returnValue = null;
} else {
java.time.LocalDateTime ldt = java.time.LocalDateTime
.ofInstant(ts.toInstant(), java.time.ZoneId.of("UTC"));
java.time.LocalDateTime ldt = java.time.LocalDateTime.ofInstant(ts.toInstant(),
java.time.ZoneId.of("UTC"));
if (type == java.time.LocalDateTime.class) {
returnValue = ldt;
} else if (type == java.time.LocalDate.class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ protected void serializeToWkb(boolean noZM, SQLServerSpatialDatatype type) {
* multiple corresponding data structures.
*
* @param type
* Type of Spatial Datatype (Geography/Geometry)
* Type of Spatial Datatype (Geography/Geometry)
* @throws SQLServerException
* if an Exception occurs
* if an Exception occurs
*/
protected void parseWkb(SQLServerSpatialDatatype type) throws SQLServerException {
srid = readInt();
Expand Down
12 changes: 4 additions & 8 deletions src/main/java/com/microsoft/sqlserver/jdbc/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,10 @@ static BigDecimal readBigDecimal(byte valueBytes[], int valueLength, int scale)
* @return long value as read from bytes.
*/
/* L0 */static long readLong(byte data[], int nOffset) {
return ((long) (data[nOffset + 7] & 0xff) << 56)
| ((long) (data[nOffset + 6] & 0xff) << 48)
| ((long) (data[nOffset + 5] & 0xff) << 40)
| ((long) (data[nOffset + 4] & 0xff) << 32)
| ((long) (data[nOffset + 3] & 0xff) << 24)
| ((long) (data[nOffset + 2] & 0xff) << 16)
| ((long) (data[nOffset + 1] & 0xff) << 8)
| ((long) (data[nOffset] & 0xff));
return ((long) (data[nOffset + 7] & 0xff) << 56) | ((long) (data[nOffset + 6] & 0xff) << 48)
| ((long) (data[nOffset + 5] & 0xff) << 40) | ((long) (data[nOffset + 4] & 0xff) << 32)
| ((long) (data[nOffset + 3] & 0xff) << 24) | ((long) (data[nOffset + 2] & 0xff) << 16)
| ((long) (data[nOffset + 1] & 0xff) << 8) | ((long) (data[nOffset] & 0xff));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,28 +254,26 @@ public void testGetObjectAsLocalDateTime() throws SQLException {
try (Connection con = DriverManager.getConnection(connectionString); Statement stmt = con.createStatement()) {
TimeZone prevTimeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("America/Edmonton"));

// a local date/time that does not actually exist because of Daylight Saving Time
final String testValueDate = "2018-03-11";
final String testValueTime = "02:00:00.1234567";
final String testValueDateTime = testValueDate + "T" + testValueTime;

stmt.executeUpdate(
"CREATE TABLE " + tableName + " (id INT PRIMARY KEY, dt2 DATETIME2)");
stmt.executeUpdate(
"INSERT INTO " + tableName + " (id, dt2) VALUES (1, '" + testValueDateTime + "')");

stmt.executeUpdate("CREATE TABLE " + tableName + " (id INT PRIMARY KEY, dt2 DATETIME2)");
stmt.executeUpdate("INSERT INTO " + tableName + " (id, dt2) VALUES (1, '" + testValueDateTime + "')");

try (ResultSet rs = stmt.executeQuery("SELECT dt2 FROM " + tableName + " WHERE id=1")) {
rs.next();

LocalDateTime expectedLocalDateTime = LocalDateTime.parse(testValueDateTime);
LocalDateTime actualLocalDateTime = rs.getObject(1, LocalDateTime.class);
assertEquals(expectedLocalDateTime, actualLocalDateTime);

LocalDate expectedLocalDate = LocalDate.parse(testValueDate);
LocalDate actualLocalDate = rs.getObject(1, LocalDate.class);
assertEquals(expectedLocalDate, actualLocalDate);

LocalTime expectedLocalTime = LocalTime.parse(testValueTime);
LocalTime actualLocalTime = rs.getObject(1, LocalTime.class);
assertEquals(expectedLocalTime, actualLocalTime);
Expand Down