Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added @deprecated tag to ISQLServerBulkRecord #1

Merged
merged 12 commits into from
Oct 4, 2019
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Bug report
about: Report a bug to help us improve
title: "[BUG]"
labels: bug
name: Incident report
about: Report an incident
title: ''
labels: ''
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Question
about: Discuss an idea to see if it would be an appropriate Issue.
about: Ask a question
title: "[QUESTION]"
labels: question
assignees: ''
Expand Down
21 changes: 13 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,35 @@ jobs:
Get-Content .\JavaKeyStoreBase.txt | Set-Content -Encoding utf8 JavaKeyStore.txt
Remove-Item –path .\JavaKeyStoreBase.txt
displayName: 'PowerShell Script'
- task: DownloadSecureFile@1
name: pkcs12_truststore
displayName: 'Download PKCS12 truststore file'
inputs:
secureFile: 'pkcs12_truststore'
- task: Maven@3
displayName: 'Maven build jre12'
displayName: 'Maven build jre13'
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean -Dmssql_jdbc_test_connection_properties=jdbc:sqlserver://$(Target_SQL)$(server_domain);$(database);$(user);$(password); install -Pjre12 -DuserNTLM=$(userNTLM) -DpasswordNTLM=$(passwordNTLM) -DdomainNTLM=$(domainNTLM) -DexcludedGroups=$(Ex_Groups)'
goals: 'clean -Dmssql_jdbc_test_connection_properties=jdbc:sqlserver://$(Target_SQL)$(server_domain);$(database);$(user);$(password); install -Pjre13 -DuserNTLM=$(userNTLM) -DpasswordNTLM=$(passwordNTLM) -DdomainNTLM=$(domainNTLM) -DexcludedGroups=$(Ex_Groups) -Dpkcs12_truststore_password=$(pkcs12_truststore_password) -Dpkcs12_truststore=$(pkcs12_truststore.secureFilePath)'
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Maven build jre12'
testRunTitle: 'Maven build jre13'
javaHomeOption: Path
jdkDirectory: $(JDK12)
jdkDirectory: $(JDK13)
- task: Maven@3
displayName: 'Maven build jre11'
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean -Dmssql_jdbc_test_connection_properties=jdbc:sqlserver://$(Target_SQL)$(server_domain);$(database);$(user);$(password); install -Pjre11 -DuserNTLM=$(userNTLM) -DpasswordNTLM=$(passwordNTLM) -DdomainNTLM=$(domainNTLM) -DexcludedGroups=$(Ex_Groups)'
goals: 'clean -Dmssql_jdbc_test_connection_properties=jdbc:sqlserver://$(Target_SQL)$(server_domain);$(database);$(user);$(password); install -Pjre11 -DuserNTLM=$(userNTLM) -DpasswordNTLM=$(passwordNTLM) -DdomainNTLM=$(domainNTLM) -DexcludedGroups=$(Ex_Groups) -Dpkcs12_truststore_password=$(pkcs12_truststore_password) -Dpkcs12_truststore=$(pkcs12_truststore.secureFilePath)'
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Maven build jre11'
javaHomeOption: Path
jdkDirectory: $(JDK12)
jdkDirectory: $(JDK13)
- task: Maven@3
displayName: 'Maven build jre8'
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean -Dmssql_jdbc_test_connection_properties=jdbc:sqlserver://$(Target_SQL)$(server_domain);$(database);$(user);$(password); install -Pjre8 -DuserNTLM=$(userNTLM) -DpasswordNTLM=$(passwordNTLM) -DdomainNTLM=$(domainNTLM) -DexcludedGroups=$(Ex_Groups)'
goals: 'clean -Dmssql_jdbc_test_connection_properties=jdbc:sqlserver://$(Target_SQL)$(server_domain);$(database);$(user);$(password); install -Pjre8 -DuserNTLM=$(userNTLM) -DpasswordNTLM=$(passwordNTLM) -DdomainNTLM=$(domainNTLM) -DexcludedGroups=$(Ex_Groups) -Dpkcs12_truststore_password=$(pkcs12_truststore_password) -Dpkcs12_truststore=$(pkcs12_truststore.secureFilePath)'
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Maven build jre8'
javaHomeOption: Path
jdkDirectory: $(JDK12)
jdkDirectory: $(JDK13)
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
****************************************************************
* Instruction for Building JDBC Driver:
* For building particular version of the driver, use commands:
* jre12 - - PS> gradle build
PS> gradle build -PbuildProfile=jre12
* jre13 - - PS> gradle build
PS> gradle build -PbuildProfile=jre13
* jre11 - - PS> gradle build -PbuildProfile=jre11
* jre8 - - PS> gradle build -PbuildProfile=jre8
*
Expand All @@ -31,21 +31,21 @@ allprojects {

test {
useJUnitPlatform {
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','NTLM')
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','reqExternalSetup','NTLM')
}
}

if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre12")){
if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre13")){

jreVersion = "jre12"
jreVersion = "jre13"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
jar {
manifest {
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
}
}
sourceCompatibility = 12
targetCompatibility = 12
sourceCompatibility = 13
targetCompatibility = 13
}

if (hasProperty('buildProfile') && buildProfile == "jre11"){
Expand All @@ -70,7 +70,7 @@ if(hasProperty('buildProfile') && buildProfile == "jre8") {
targetCompatibility = 1.8
test {
useJUnitPlatform {
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','NTLM','xJDBC42')
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','NTLM','reqExternalSetup','xJDBC42')
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
xAzureSQLDB - - - - For tests not compatible with Azure SQL Database - -
xAzureSQLDW - - - - For tests not compatible with Azure Data Warehouse -
xAzureSQLMI - - - - For tests not compatible with Azure SQL Managed Instance
NTLM - - - - - - For tests using NTLM Authentication mode (excluded by default)
NTLM - - - - - - - For tests using NTLM Authentication mode (excluded by default)
reqExternalSetup - For tests requiring external setup (excluded by default)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Default testing enabled with SQL Server 2019 (SQLv14) -->
<excludedGroups>xSQLv15, NTLM</excludedGroups>
<excludedGroups>xSQLv15, NTLM, reqExternalSetup</excludedGroups>

<!-- Driver Dependencies -->
<azure.keyvault.version>1.2.1</azure.keyvault.version>
Expand Down Expand Up @@ -273,12 +274,12 @@
</build>
</profile>
<profile>
<id>jre12</id>
<id>jre13</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<finalName>${project.artifactId}-${project.version}.jre12-preview</finalName>
<finalName>${project.artifactId}-${project.version}.jre13-preview</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -288,8 +289,8 @@
<excludes>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java</exclude>
</excludes>
<source>12</source>
<target>12</target>
<source>13</source>
<target>13</target>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
* SQLServerBulkCopy class to write the data to SQL Server tables.
*
* This interface is implemented by {@link SQLServerBulkRecord} Class
*
* @deprecated as of 7.5.0, because the interface contains methods which are not called as part of actual bulk copy
* process. Use {@link ISQLServerBulkData}} instead.
*/
@Deprecated
public interface ISQLServerBulkRecord extends ISQLServerBulkData {
/**
* Returns whether the column represents an identity column.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,7 @@ void setDateTimeOffset(String parameterName, microsoft.sql.DateTimeOffset value,
* method is called on a closed <code>CallableStatement</code>
* @see #getTime
*/
void setTime(String parameterName, java.sql.Time value, int scale,
boolean forceEncrypt) throws SQLServerException;
void setTime(String parameterName, java.sql.Time value, int scale, boolean forceEncrypt) throws SQLServerException;

/**
* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. The driver converts this to an
Expand Down Expand Up @@ -592,8 +591,7 @@ void setTime(String parameterName, java.sql.Time value, int scale,
* if parameterName does not correspond to a named parameter; if a database access error occurs or this
* method is called on a closed <code>CallableStatement</code>
*/
void setDateTime(String parameterName, java.sql.Timestamp value,
boolean forceEncrypt) throws SQLServerException;
void setDateTime(String parameterName, java.sql.Timestamp value, boolean forceEncrypt) throws SQLServerException;

/**
* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. The driver converts this to an
Expand Down Expand Up @@ -796,8 +794,7 @@ void setSmallDateTime(String parameterName, java.sql.Timestamp value,
* if parameterName does not correspond to a named parameter; if a database access error occurs or this
* method is called on a closed <code>CallableStatement</code>
*/
void setBigDecimal(String parameterName, BigDecimal value, int precision,
int scale) throws SQLServerException;
void setBigDecimal(String parameterName, BigDecimal value, int precision, int scale) throws SQLServerException;

/**
* Sets the designated parameter to the given <code>java.math.BigDecimal</code> value. The driver converts this to
Expand Down Expand Up @@ -942,8 +939,7 @@ void setBigDecimal(String parameterName, BigDecimal value, int precision, int sc
* @throws SQLServerException
* when an error occurs
*/
void setStructured(String parameterName, String tvpName,
SQLServerDataTable tvpDataTable) throws SQLServerException;
void setStructured(String parameterName, String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException;

/**
* Populates a table valued parameter passed to a stored procedure with a ResultSet retrieved from another table
Expand All @@ -957,8 +953,7 @@ void setStructured(String parameterName, String tvpName,
* @throws SQLServerException
* when an error occurs
*/
void setStructured(String parameterName, String tvpName,
java.sql.ResultSet tvpResultSet) throws SQLServerException;
void setStructured(String parameterName, String tvpName, java.sql.ResultSet tvpResultSet) throws SQLServerException;

/**
* Populates a table valued parameter passed to a stored procedure with an ISQLServerDataRecord object.
Expand Down Expand Up @@ -1017,8 +1012,7 @@ void registerOutParameter(String parameterName, SQLType sqlType, int precision,
* @throws SQLServerException
* If any errors occur.
*/
void registerOutParameter(int parameterIndex, SQLType sqlType, int precision,
int scale) throws SQLServerException;
void registerOutParameter(int parameterIndex, SQLType sqlType, int precision, int scale) throws SQLServerException;

/**
* Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be
Expand All @@ -1039,8 +1033,7 @@ void registerOutParameter(int parameterIndex, SQLType sqlType, int precision,
* @throws SQLServerException
* If any errors occur.
*/
void registerOutParameter(int parameterIndex, int sqlType, int precision,
int scale) throws SQLServerException;
void registerOutParameter(int parameterIndex, int sqlType, int precision, int scale) throws SQLServerException;

/**
* Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be
Expand All @@ -1061,8 +1054,7 @@ void registerOutParameter(int parameterIndex, int sqlType, int precision,
* @throws SQLServerException
* If any errors occur.
*/
void registerOutParameter(String parameterName, int sqlType, int precision,
int scale) throws SQLServerException;
void registerOutParameter(String parameterName, int sqlType, int precision, int scale) throws SQLServerException;

/**
* Sets the value of the designated parameter with the given object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface ISQLServerConnection extends java.sql.Connection {

// Transaction types.
// TRANSACTION_SNAPSHOT corresponds to -> SET TRANSACTION ISOLATION LEVEL SNAPSHOT
final static int TRANSACTION_SNAPSHOT = 0x1000;
int TRANSACTION_SNAPSHOT = 0x1000;

/**
* Returns the connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ void setTimestamp(int parameterIndex, java.sql.Timestamp x, int scale,
* @throws SQLServerException
* when an error occurs
*/
void setDateTimeOffset(int parameterIndex, microsoft.sql.DateTimeOffset x,
int scale) throws SQLServerException;
void setDateTimeOffset(int parameterIndex, microsoft.sql.DateTimeOffset x, int scale) throws SQLServerException;

/**
* Sets the designated parameter to the given <code>microsoft.sql.DatetimeOffset</code> value.
Expand Down Expand Up @@ -640,8 +639,7 @@ void setDateTimeOffset(int parameterIndex, microsoft.sql.DateTimeOffset x, int s
* @throws SQLServerException
* when an error occurs
*/
void setSmallDateTime(int parameterIndex, java.sql.Timestamp x,
boolean forceEncrypt) throws SQLServerException;
void setSmallDateTime(int parameterIndex, java.sql.Timestamp x, boolean forceEncrypt) throws SQLServerException;

/**
* Sets the data table to populates a table valued parameter.
Expand All @@ -655,8 +653,7 @@ void setSmallDateTime(int parameterIndex, java.sql.Timestamp x,
* @throws SQLServerException
* when an error occurs
*/
void setStructured(int parameterIndex, String tvpName,
SQLServerDataTable tvpDataTable) throws SQLServerException;
void setStructured(int parameterIndex, String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException;

/**
* Sets the result set to populate a table-valued parameter.
Expand Down
37 changes: 15 additions & 22 deletions src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
*/
public interface ISQLServerResultSet extends java.sql.ResultSet {

static final int TYPE_SS_DIRECT_FORWARD_ONLY = 2003; // TYPE_FORWARD_ONLY + 1000
static final int TYPE_SS_SERVER_CURSOR_FORWARD_ONLY = 2004; // TYPE_FORWARD_ONLY + 1001
static final int TYPE_SS_SCROLL_STATIC = 1004; // TYPE_SCROLL_INSENSITIVE
static final int TYPE_SS_SCROLL_KEYSET = 1005; // TYPE_SCROLL_SENSITIVE
static final int TYPE_SS_SCROLL_DYNAMIC = 1006; // TYPE_SCROLL_SENSITIVE + 1
int TYPE_SS_DIRECT_FORWARD_ONLY = 2003; // TYPE_FORWARD_ONLY + 1000
int TYPE_SS_SERVER_CURSOR_FORWARD_ONLY = 2004; // TYPE_FORWARD_ONLY + 1001
int TYPE_SS_SCROLL_STATIC = 1004; // TYPE_SCROLL_INSENSITIVE
int TYPE_SS_SCROLL_KEYSET = 1005; // TYPE_SCROLL_SENSITIVE
int TYPE_SS_SCROLL_DYNAMIC = 1006; // TYPE_SCROLL_SENSITIVE + 1

/* SQL Server concurrency values */
static final int CONCUR_SS_OPTIMISTIC_CC = 1008; // CONCUR_UPDATABLE
static final int CONCUR_SS_SCROLL_LOCKS = 1009; // CONCUR_UPDATABLE + 1
static final int CONCUR_SS_OPTIMISTIC_CCVAL = 1010; // CONCUR_UPDATABLE + 2
int CONCUR_SS_OPTIMISTIC_CC = 1008; // CONCUR_UPDATABLE
int CONCUR_SS_SCROLL_LOCKS = 1009; // CONCUR_UPDATABLE + 1
int CONCUR_SS_OPTIMISTIC_CCVAL = 1010; // CONCUR_UPDATABLE + 2

/**
* Returns the value of the designated column in the current row of this ResultSet object as a
Expand Down Expand Up @@ -836,8 +836,7 @@ void updateBigDecimal(int index, BigDecimal x, Integer precision, Integer scale,
* @throws SQLServerException
* when an error occurs
*/
void updateTimestamp(int index, java.sql.Timestamp x, int scale,
boolean forceEncrypt) throws SQLServerException;
void updateTimestamp(int index, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException;

/**
* Updates the designated column with a <code>java.sql.Timestamp</code> value. The updater methods are used to
Expand Down Expand Up @@ -887,8 +886,7 @@ void updateTimestamp(int index, java.sql.Timestamp x, int scale,
* @throws SQLServerException
* when an error occurs
*/
void updateDateTime(int index, java.sql.Timestamp x, Integer scale,
boolean forceEncrypt) throws SQLServerException;
void updateDateTime(int index, java.sql.Timestamp x, Integer scale, boolean forceEncrypt) throws SQLServerException;

/**
* Updates the designated column with a <code>java.sql.Timestamp</code> value. The updater methods are used to
Expand Down Expand Up @@ -953,8 +951,7 @@ void updateSmallDateTime(int index, java.sql.Timestamp x, Integer scale,
* @throws SQLServerException
* when an error occurs
*/
void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x,
Integer scale) throws SQLServerException;
void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x, Integer scale) throws SQLServerException;

/**
* Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal.
Expand Down Expand Up @@ -1029,8 +1026,7 @@ void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x, Integer sca
* @throws SQLServerException
* when an error occurs
*/
void updateObject(int index, Object x, int precision, int scale,
boolean forceEncrypt) throws SQLServerException;
void updateObject(int index, Object x, int precision, int scale, boolean forceEncrypt) throws SQLServerException;

/**
* Updates the designated column with a <code>boolean</code> value. The updater methods are used to update column
Expand Down Expand Up @@ -1194,8 +1190,7 @@ void updateObject(int index, Object x, int precision, int scale,
* @throws SQLServerException
* If any errors occur.
*/
void updateBigDecimal(String columnName, BigDecimal x, Integer precision,
Integer scale) throws SQLServerException;
void updateBigDecimal(String columnName, BigDecimal x, Integer precision, Integer scale) throws SQLServerException;

/**
* Updates the designated column with a <code>java.sql.BigDecimal</code> value. The updater methods are used to
Expand Down Expand Up @@ -1311,8 +1306,7 @@ void updateBigDecimal(String columnName, BigDecimal x, Integer precision, Intege
* @throws SQLServerException
* If any errors occur.
*/
void updateTime(String columnName, java.sql.Time x, int scale,
boolean forceEncrypt) throws SQLServerException;
void updateTime(String columnName, java.sql.Time x, int scale, boolean forceEncrypt) throws SQLServerException;

/**
* Updates the designated column with a <code>java.sql.Timestamp</code> value. The updater methods are used to
Expand Down Expand Up @@ -1465,8 +1459,7 @@ void updateSmallDateTime(String columnName, java.sql.Timestamp x, int scale,
* @throws SQLServerException
* If any errors occur.
*/
void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset x,
int scale) throws SQLServerException;
void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset x, int scale) throws SQLServerException;

/**
* Updates the value of the column specified to the DateTimeOffset Class value, given a column name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ else if (null != sourceCryptoMeta) {
tdsWriter.writeDouble((float) colValue);
}
break;

case java.sql.Types.DOUBLE:
if (null == colValue) {
writeNullToTdsWriter(tdsWriter, bulkJdbcType, isStreaming);
Expand Down Expand Up @@ -3362,7 +3362,7 @@ private byte[] normalizedValue(JDBCType destJdbcType, Object value, JDBCType src
Float floatValue = (value instanceof String) ? Float.parseFloat((String) value) : (Float) value;
return ByteBuffer.allocate((Float.SIZE / Byte.SIZE)).order(ByteOrder.LITTLE_ENDIAN)
.putFloat(floatValue).array();

case FLOAT:
case DOUBLE:
Double doubleValue = (value instanceof String) ? Double.parseDouble((String) value)
Expand Down
Loading