Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
lilgreenbird committed Jan 15, 2024
2 parents dc3c006 + 066aeeb commit 562cd72
Show file tree
Hide file tree
Showing 22 changed files with 848 additions and 377 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Welcome to the Microsoft JDBC Driver for SQL Server project!

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs) available in the Java Platform, Enterprise Editions. The Driver provides access to Microsoft SQL Server and Azure SQL Database from any Java application, application server, or Java-enabled applet.

Releases can be found on the [GitHub Releases](https://github.com/microsoft/mssql-jdbc/releases) page, in the [Microsoft JDBC Documentation](https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver16), or via Maven. Starting from preview release 12.1.0, each release contains two versions of the driver. One for use with Java 8 (jre8), and one for use with version Java 11 and above (jre11).

We hope you enjoy using the Microsoft JDBC Driver for SQL Server.

Microsoft JDBC driver for SQL Server Team
Expand Down Expand Up @@ -82,7 +84,7 @@ We're now on the Maven Central Repository. Add the following to your POM file to
<version>12.4.1.jre11</version>
</dependency>
```
The driver can be downloaded from [Microsoft](https://aka.ms/downloadmssqljdbc).
The driver can be downloaded from [Microsoft](https://aka.ms/downloadmssqljdbc). For driver version 12.1.0 and greater, please use the jre11 version when using Java 11 or greater, and the jre8 version when using Java 8.

To get the latest version of the driver, add the following to your POM file:

Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,13 @@ final InetSocketAddress open(String host, int port, int timeoutMillis, boolean u
tcpSocket.setKeepAlive(true);
setSocketOptions(tcpSocket, this);

// set SO_TIMEOUT
int socketTimeout = con.getSocketTimeoutMilliseconds();

// socket timeout should be bounded by loginTimeout before connected
if (!con.isConnected()) {
socketTimeout = Math.min(con.timerRemaining(con.timerExpire), socketTimeout);
}

tcpSocket.setSoTimeout(socketTimeout);

inputStream = tcpInputStream = new ProxyInputStream(tcpSocket.getInputStream());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,19 @@ CallableStatement prepareCall(String sql, int nType, int nConcur, int nHold,
* A boolean that indicates if the driver should calculate precision from inputted big decimal values.
*/
void setCalcBigDecimalPrecision(boolean calcBigDecimalPrecision);

/**
* Specifies the flag for using Bulk Copy API for batch insert operations.
*
* @param useBulkCopyForBatchInsert
* boolean value for useBulkCopyForBatchInsert.
*/
void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) ;

/**
* Returns the useBulkCopyForBatchInsert value.
*
* @return flag for using Bulk Copy API for batch insert operations.
*/
boolean getUseBulkCopyForBatchInsert();
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,4 @@ private byte[] getLittleEndianBytesFromShort(short value) {
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
return byteBuffer.putShort(value).array();
}

/*
* Verify signature against certificate
*/
private boolean rsaVerifySignature(byte[] dataToVerify, byte[] signature,
CertificateDetails certificateDetails) throws InvalidKeyException, NoSuchAlgorithmException, SignatureException {
Signature sig = Signature.getInstance("SHA256withRSA");

sig.initSign((PrivateKey) certificateDetails.privateKey);
sig.update(dataToVerify);

byte[] signedHash = sig.sign();

sig.initVerify(certificateDetails.certificate.getPublicKey());
sig.update(dataToVerify);
return sig.verify(signature);
}
}
Loading

0 comments on commit 562cd72

Please sign in to comment.