From aed6d9593751a99fbbbe7e7115eefaa4bd05b72a Mon Sep 17 00:00:00 2001 From: v-ahibr Date: Wed, 30 Nov 2016 11:19:00 -0800 Subject: [PATCH] Fixing Javadocs This adds javadocs to public methods and fixes incorrect javadocs --- .../java/com/microsoft/sqlserver/jdbc/AE.java | 2 +- .../sqlserver/jdbc/ActivityCorrelator.java | 2 +- .../sqlserver/jdbc/AuthenticationJNI.java | 9 +- .../com/microsoft/sqlserver/jdbc/Column.java | 2 +- .../com/microsoft/sqlserver/jdbc/DDC.java | 14 +- .../sqlserver/jdbc/DLLException.java | 10 +- .../microsoft/sqlserver/jdbc/DataTypes.java | 6 +- .../sqlserver/jdbc/FailOverInfo.java | 2 +- .../sqlserver/jdbc/FailOverMapSingleton.java | 2 +- .../microsoft/sqlserver/jdbc/IOBuffer.java | 27 +- .../sqlserver/jdbc/ISQLServerBulkRecord.java | 5 +- .../jdbc/ISQLServerCallableStatement.java | 35 +- .../jdbc/ISQLServerCallableStatement42.java | 34 +- .../sqlserver/jdbc/ISQLServerConnection.java | 12 +- .../sqlserver/jdbc/ISQLServerDataRecord.java | 8 +- .../sqlserver/jdbc/ISQLServerDataSource.java | 277 ++++- .../jdbc/ISQLServerPreparedStatement.java | 11 +- .../jdbc/ISQLServerPreparedStatement42.java | 40 +- .../sqlserver/jdbc/ISQLServerResultSet.java | 31 +- .../sqlserver/jdbc/ISQLServerResultSet42.java | 37 +- .../sqlserver/jdbc/ISQLServerStatement.java | 21 +- .../sqlserver/jdbc/KerbAuthentication.java | 2 +- .../jdbc/KeyStoreProviderCommon.java | 2 +- .../sqlserver/jdbc/KeyVaultCredential.java | 13 +- .../sqlserver/jdbc/PLPInputStream.java | 16 +- .../microsoft/sqlserver/jdbc/Parameter.java | 2 +- .../sqlserver/jdbc/ParameterUtils.java | 2 +- .../sqlserver/jdbc/ReaderInputStream.java | 2 +- .../sqlserver/jdbc/SQLCollation.java | 2 +- ...QLServerAeadAes256CbcHmac256Algorithm.java | 2 +- ...rverAeadAes256CbcHmac256EncryptionKey.java | 2 +- .../SQLServerAeadAes256CbcHmac256Factory.java | 2 +- .../sqlserver/jdbc/SQLServerBlob.java | 27 +- .../jdbc/SQLServerBulkCSVFileRecord.java | 32 +- .../sqlserver/jdbc/SQLServerBulkCopy.java | 4 +- .../jdbc/SQLServerBulkCopy42Helper.java | 2 +- .../jdbc/SQLServerBulkCopyOptions.java | 18 +- .../jdbc/SQLServerCallableStatement.java | 681 ++++++++++++- .../jdbc/SQLServerCallableStatement42.java | 2 +- .../sqlserver/jdbc/SQLServerClob.java | 23 +- ...ColumnEncryptionAzureKeyVaultProvider.java | 8 +- ...umnEncryptionCertificateStoreProvider.java | 7 +- ...rColumnEncryptionJavaKeyStoreProvider.java | 13 +- ...erverColumnEncryptionKeyStoreProvider.java | 35 +- .../sqlserver/jdbc/SQLServerConnection.java | 280 ++++- .../SQLServerConnectionPoolDataSource.java | 2 +- .../jdbc/SQLServerConnectionPoolProxy.java | 278 ++++- .../sqlserver/jdbc/SQLServerDataColumn.java | 18 +- .../sqlserver/jdbc/SQLServerDataSource.java | 85 +- .../SQLServerDataSourceObjectFactory.java | 6 +- .../sqlserver/jdbc/SQLServerDataTable.java | 31 +- .../jdbc/SQLServerDatabaseMetaData.java | 7 +- .../sqlserver/jdbc/SQLServerDriver.java | 621 +---------- .../jdbc/SQLServerEncryptionAlgorithm.java | 6 +- .../SQLServerEncryptionAlgorithmFactory.java | 4 +- ...LServerEncryptionAlgorithmFactoryList.java | 2 +- .../jdbc/SQLServerEncryptionType.java | 2 +- .../sqlserver/jdbc/SQLServerException.java | 2 +- .../sqlserver/jdbc/SQLServerJdbc41.java | 2 +- .../sqlserver/jdbc/SQLServerJdbc42.java | 2 +- ...LServerKeyVaultAuthenticationCallback.java | 2 +- .../sqlserver/jdbc/SQLServerMetaData.java | 67 +- .../sqlserver/jdbc/SQLServerNClob.java | 2 +- .../jdbc/SQLServerParameterMetaData.java | 9 +- .../jdbc/SQLServerPooledConnection.java | 16 +- .../jdbc/SQLServerPreparedStatement.java | 444 +++++++- .../jdbc/SQLServerPreparedStatement42.java | 2 +- .../SQLServerPreparedStatement42Helper.java | 2 +- .../sqlserver/jdbc/SQLServerResource.java | 5 +- .../sqlserver/jdbc/SQLServerResultSet.java | 963 +++++++++++++++++- .../sqlserver/jdbc/SQLServerResultSet42.java | 7 +- .../jdbc/SQLServerResultSetMetaData.java | 5 +- .../sqlserver/jdbc/SQLServerSQLXML.java | 7 +- .../sqlserver/jdbc/SQLServerSavepoint.java | 8 +- .../jdbc/SQLServerSecurityUtility.java | 7 +- .../sqlserver/jdbc/SQLServerSortOrder.java | 7 +- .../sqlserver/jdbc/SQLServerStatement.java | 22 +- ...erverStatementColumnEncryptionSetting.java | 9 +- .../sqlserver/jdbc/SQLServerSymmetricKey.java | 2 +- .../jdbc/SQLServerSymmetricKeyCache.java | 2 +- .../sqlserver/jdbc/SQLServerXAConnection.java | 2 +- .../sqlserver/jdbc/SQLServerXADataSource.java | 6 +- .../sqlserver/jdbc/SQLServerXAResource.java | 7 +- .../sqlserver/jdbc/SSPIAuthentication.java | 2 +- .../sqlserver/jdbc/ScrollWindow.java | 2 +- .../sqlserver/jdbc/SimpleInputStream.java | 4 +- .../sqlserver/jdbc/StreamColInfo.java | 2 +- .../sqlserver/jdbc/StreamColumns.java | 2 +- .../microsoft/sqlserver/jdbc/StreamDone.java | 2 +- .../microsoft/sqlserver/jdbc/StreamError.java | 2 +- .../microsoft/sqlserver/jdbc/StreamInfo.java | 2 +- .../sqlserver/jdbc/StreamLoginAck.java | 2 +- .../sqlserver/jdbc/StreamPacket.java | 2 +- .../sqlserver/jdbc/StreamRetStatus.java | 2 +- .../sqlserver/jdbc/StreamRetValue.java | 2 +- .../microsoft/sqlserver/jdbc/StreamSSPI.java | 2 +- .../sqlserver/jdbc/StreamTabName.java | 2 +- .../com/microsoft/sqlserver/jdbc/TVP.java | 15 +- .../sqlserver/jdbc/UDTTDSHeader.java | 2 +- .../com/microsoft/sqlserver/jdbc/Util.java | 4 +- .../sqlserver/jdbc/XMLTDSHeader.java | 2 +- .../com/microsoft/sqlserver/jdbc/dtv.java | 127 ++- .../microsoft/sqlserver/jdbc/tdsparser.java | 2 +- .../java/microsoft/sql/DateTimeOffset.java | 14 +- src/main/java/microsoft/sql/Types.java | 29 +- 105 files changed, 3777 insertions(+), 885 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/AE.java b/src/main/java/com/microsoft/sqlserver/jdbc/AE.java index f26d9dae8..d24f6fe8e 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/AE.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/AE.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ActivityCorrelator.java b/src/main/java/com/microsoft/sqlserver/jdbc/ActivityCorrelator.java index 148e48fc3..184bb4153 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ActivityCorrelator.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ActivityCorrelator.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/AuthenticationJNI.java b/src/main/java/com/microsoft/sqlserver/jdbc/AuthenticationJNI.java index 63bc80934..f63f960c8 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/AuthenticationJNI.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/AuthenticationJNI.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -19,10 +19,6 @@ package com.microsoft.sqlserver.jdbc; -/** - * Encapsulation of the JNI native calls for trusted authentication. - */ - class FedAuthDllInfo{ byte[] accessTokenBytes = null; long expiresIn = 0; @@ -33,6 +29,9 @@ class FedAuthDllInfo{ } } +/** + * Encapsulation of the JNI native calls for trusted authentication. + */ final class AuthenticationJNI extends SSPIAuthentication { private final static int maximumpointersize = 128; // we keep the SNI_Sec pointer diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/Column.java b/src/main/java/com/microsoft/sqlserver/jdbc/Column.java index 087b5df56..35b22ec70 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/Column.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/Column.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/DDC.java b/src/main/java/com/microsoft/sqlserver/jdbc/DDC.java index d8b702291..3cf9fe55f 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/DDC.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/DDC.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -355,6 +355,14 @@ static final Object convertBigDecimalToObject(BigDecimal bigDecimalVal, JDBCType } } + /** + * Convert a Money object to desired target user type. + * @param bigDecimalVal the value to convert. + * @param jdbcType the jdbc type required. + * @param streamType the stream type. + * @param numberOfBytes the number of bytes to convert + * @return the required object. + */ static final Object convertMoneyToObject(BigDecimal bigDecimalVal, JDBCType jdbcType, StreamType streamType, int numberOfBytes) { switch (jdbcType) @@ -386,7 +394,7 @@ static final Object convertMoneyToObject(BigDecimal bigDecimalVal, JDBCType jdbc } } - //this is how fx framework converts big decimal to money and smallmoney + //converts big decimal to money and smallmoney private static byte[] convertToBytes(BigDecimal value, int scale, int numBytes) { boolean isNeg = value.signum() < 0; @@ -419,7 +427,7 @@ private static byte[] convertToBytes(BigDecimal value, int scale, int numBytes) * @param jdbcType the jdbc type required. * @param baseTypeInfo the type information associated with bytesValue. * @return the required object. - * @throws SQLServerException + * @throws SQLServerException when an error occurs. */ static final Object convertBytesToObject(byte[] bytesValue, JDBCType jdbcType, TypeInfo baseTypeInfo) throws SQLServerException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/DLLException.java b/src/main/java/com/microsoft/sqlserver/jdbc/DLLException.java index 54da6af2d..ff6328f77 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/DLLException.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/DLLException.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -21,9 +21,15 @@ import java.text.MessageFormat; - +/** + * + * This class is used to handle exceptions that may be recieved from + * sqljdbc_auth.dll and sqljdbc_xa.dll + * + */ class DLLException extends Exception { + private static final long serialVersionUID = -4498171382218222079L; // category status and state are always either -1 or a positive number // Internal Adal error category used in retry logic and building error message in managed code private int category = -9; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java b/src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java index 052b1a3f7..3c60dc157 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/DataTypes.java @@ -7,7 +7,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -886,6 +886,10 @@ private JDBCType(Category category, int intValue, String className) this.className = className; } + /** + * Gets the integer value of JDBCType + * @return integer representation of JDBCType + */ public int getIntValue() { return this.intValue; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/FailOverInfo.java b/src/main/java/com/microsoft/sqlserver/jdbc/FailOverInfo.java index 40540643e..c9afc8acf 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/FailOverInfo.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/FailOverInfo.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/FailOverMapSingleton.java b/src/main/java/com/microsoft/sqlserver/jdbc/FailOverMapSingleton.java index 9b7473724..e9d593551 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/FailOverMapSingleton.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/FailOverMapSingleton.java @@ -7,7 +7,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java b/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java index b176601c9..6f0d7e1df 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -2865,13 +2865,20 @@ void updateResult(Socket socket, IOException exception, String threadId) } - //Updates the selectedException if - //a) selectedException is null - //b) ex is a non-socketTimeoutException and selectedException is a socketTimeoutException - //If there are multiple exceptions, that are not related to socketTimeout - //the first non-socketTimeout exception is picked. - //If all exceptions are related to socketTimeout, the first exception is picked. - //Note: This method is not thread safe. The caller should ensure thread safety. + /** + * Updates the selectedException if + *

+ * a) selectedException is null + *

+ * b) ex is a non-socketTimeoutException and selectedException is a socketTimeoutException + *

+ * If there are multiple exceptions, that are not related to socketTimeout + * the first non-socketTimeout exception is picked. + * If all exceptions are related to socketTimeout, the first exception is picked. + * Note: This method is not thread safe. The caller should ensure thread safety. + * @param ex the IOException + * @param traceId the traceId of the thread + */ public void updateSelectedException(IOException ex, String traceId) { boolean updatedException = false; @@ -2898,7 +2905,8 @@ else if((!(ex instanceof SocketTimeoutException)) && (selectedException instance } /** - * Used for tracing + * Used fof tracing + * @return traceID string */ public String toString() { @@ -2994,6 +3002,7 @@ public void run() /** * Used for tracing + * @return traceID string */ public String toString() { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerBulkRecord.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerBulkRecord.java index a9caf4827..f94f2d16d 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerBulkRecord.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerBulkRecord.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -82,6 +82,7 @@ public interface ISQLServerBulkRecord * 'Understanding the JDBC Driver Data Types' for the appropriate mappings. * * @return The data for the row. + * @throws SQLServerException If there are any errors in obtaining the data. */ public Object[] getRowData() throws SQLServerException; @@ -89,7 +90,7 @@ public interface ISQLServerBulkRecord * Advances to the next data row. * * @return True if rows are available; false if there are no more rows - * @throws SQLServerException If there are any errors in obtaining the data. + * @throws SQLServerException If there are any errors in advancing to the next row. */ public boolean next() throws SQLServerException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java index c208b0561..04fc3f00a 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -20,10 +20,43 @@ package com.microsoft.sqlserver.jdbc; import java.sql.*; + +/** + * + * This interface is implemented by SQLServerCallableStatement Class. + * + */ public interface ISQLServerCallableStatement extends java.sql.CallableStatement, ISQLServerPreparedStatement { + /** + * Sets parameter parameterName to DateTimeOffset x + * @param parameterName the name of the parameter + * @param x DateTimeOffset value + * @throws SQLException if parameterName does not correspond to a named parameter; + * if the driver can detect that a data conversion error could occur; + * if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setDateTimeOffset(String parameterName, microsoft.sql.DateTimeOffset x) throws SQLException; + + /** + * Gets the DateTimeOffset value of parameter with index parameterIndex + * @param parameterIndex the first parameter is 1, the second is 2, and so on + * @return DateTimeOffset value + * @throws SQLException if parameterIndex is out of range; + * if a database access error occurs or + * this method is called on a closed CallableStatement + */ public microsoft.sql.DateTimeOffset getDateTimeOffset(int parameterIndex) throws SQLException; + + /** + * Gets the DateTimeOffset value of parameter with name parameterName + * @param parameterName the name of the parameter + * @return DateTimeOffset value + * @throws SQLException if parameterName does not correspond to a named parameter; + * if a database access error occurs or + * this method is called on a closed CallableStatement + */ public microsoft.sql.DateTimeOffset getDateTimeOffset(String parameterName) throws SQLException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java index 37cc3b4b2..ef7bd215f 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerCallableStatement42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -33,18 +33,50 @@ public interface ISQLServerCallableStatement42 extends ISQLServerCallableStateme public void registerOutParameter(int index, SQLType sqlType, int scale) throws SQLServerException; + /** + * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed. + *

+ * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter. + * + * @param index the first parameter is 1, the second is 2,... + * @param sqlType the JDBC type code defined by SQLType to use to register the OUT Parameter. + * @param precision the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. + * @param scale the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @throws SQLServerException If any errors occur. + */ public void registerOutParameter(int index, SQLType sqlType, int precision, int scale) throws SQLServerException; public void setObject(String sCol, Object obj, SQLType jdbcType) throws SQLServerException; public void setObject(String sCol, Object obj, SQLType jdbcType, int scale) throws SQLServerException; + /** + * Sets the value of the designated parameter with the given object. + * + * @param sCol the name of the parameter + * @param obj the object containing the input parameter value + * @param jdbcType the SQL type to be sent to the database + * @param scale scale the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @param forceEncrypt true if force encryption is on, false if force encryption is off + * @throws SQLServerException If any errors occur. + */ public void setObject(String sCol, Object obj, SQLType jdbcType, int scale, boolean forceEncrypt) throws SQLServerException; public void registerOutParameter(String parameterName, SQLType sqlType, String typeName) throws SQLServerException; public void registerOutParameter(String parameterName, SQLType sqlType, int scale) throws SQLServerException; + /** + * Registers the parameter in ordinal position index to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed. + *

+ * The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter. + * + * @param parameterName the name of the parameter + * @param sqlType the JDBC type code defined by SQLType to use to register the OUT Parameter. + * @param precision the sum of the desired number of digits to the left and right of the decimal point. It must be greater than or equal to zero. + * @param scale the desired number of digits to the right of the decimal point. It must be greater than or equal to zero. + * @throws SQLServerException If any errors occur. + */ public void registerOutParameter(String parameterName, SQLType sqlType, int precision, int scale) throws SQLServerException; public void registerOutParameter(String parameterName, SQLType sqlType) throws SQLServerException; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java index 2531287ae..29c9d33a7 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -23,14 +23,20 @@ /** * -* ALL THE non JDBC public methods of SQLServerConnection in should be defined here. +* This interface is implemented by SQLServerConnection Class. */ - public interface ISQLServerConnection extends java.sql.Connection { // Transaction types. // TRANSACTION_SNAPSHOT corresponds to -> SET TRANSACTION ISOLATION LEVEL SNAPSHOT public final static int TRANSACTION_SNAPSHOT = 0x1000; + + /** + * Gets the connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or failed. + * @return 16-byte GUID representing the connection ID of the most recent connection attempt. Or, NULL if there is a + * failure after the connection request is initiated and the pre-login handshake. + * @throws SQLException If any errors occur. + */ public UUID getClientConnectionId() throws SQLException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java index a27705bcc..8c35f5fa3 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataRecord.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -28,6 +28,11 @@ public interface ISQLServerDataRecord { + /** + * Get the column meta data + * @param column the first column is 1, the second is 2, and so on + * @return SQLServerMetaData of column + */ public SQLServerMetaData getColumnMetaData(int column); /** @@ -52,7 +57,6 @@ public interface ISQLServerDataRecord * Advances to the next data row. * * @return True if rows are available; false if there are no more rows - * @throws SQLServerException If there are any errors in obtaining the data. */ public boolean next(); } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java index 80d991b9f..e921948ef 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -22,63 +22,334 @@ /** -* This datasource lists properties specific for the SQLServerConnection class. +* A factory to create connections to the data source represented by this object. This interface was added in SQL Server JDBC Driver 3.0. */ public interface ISQLServerDataSource extends CommonDataSource { + /** + * Sets the application intent. + * @param applicationIntent A String that contains the application intent. + */ public void setApplicationIntent(String applicationIntent); + + /** + * Returns the application intent. + * @return A String that contains the application intent. + */ public String getApplicationIntent(); + + /** + * Sets the application name. + * @param applicationName A String that contains the name of the application. + */ public void setApplicationName(String applicationName); + + /** + * Returns the application name. + * @return A String that contains the application name, or "Microsoft JDBC Driver for SQL Server" if no value is set. + */ public String getApplicationName(); + + /** + * Sets the database name to connect to. + * @param databaseName A String that contains the database name. + */ public void setDatabaseName(String databaseName); + + /** + * Returns the database name. + * @return A String that contains the database name or null if no value is set. + */ public String getDatabaseName(); + + /** + * Sets the SQL Server instance name. + * @param instanceName A String that contains the instance name. + */ public void setInstanceName(String instanceName); + + /** + * Returns the SQL Server instance name. + * @return A String that contains the instance name, or null if no value is set. + */ public String getInstanceName(); + + /** + * Sets a Boolean value that indicates if the integratedSecurity property is enabled. + * @param enable true if integratedSecurity is enabled. Otherwise, false. + */ public void setIntegratedSecurity(boolean enable); + + /** + * Sets a Boolean value that indicates if the lastUpdateCount property is enabled. + * @param lastUpdateCount true if lastUpdateCount is enabled. Otherwise, false. + */ public void setLastUpdateCount(boolean lastUpdateCount); + + /** + * Returns a Boolean value that indicates if the lastUpdateCount property is enabled. + * @return true if lastUpdateCount is enabled. Otherwise, false. + */ public boolean getLastUpdateCount(); + + /** + * Sets a Boolean value that indicates if the encrypt property is enabled. + * @param encrypt true if the Secure Sockets Layer (SSL) encryption is enabled between the client and the SQL Server. Otherwise, false. + */ public void setEncrypt(boolean encrypt); + + /** + * Returns a Boolean value that indicates if the encrypt property is enabled. + * @return true if encrypt is enabled. Otherwise, false. + */ public boolean getEncrypt(); + + /** + * Sets a Boolean value that indicates if the trustServerCertificate property is enabled. + * @param e true if the server Secure Sockets Layer (SSL) certificate should be automatically trusted when the communication layer is encrypted using SSL. Otherwise, false. + */ public void setTrustServerCertificate(boolean e); + + /** + * Returns a Boolean value that indicates if the trustServerCertificate property is enabled. + * @return true if trustServerCertificate is enabled. Otherwise, false. + */ public boolean getTrustServerCertificate(); + + /** + * Sets the path (including file name) to the certificate trustStore file. + * @param st A String that contains the path (including file name) to the certificate trustStore file. + */ public void setTrustStore(String st); + + /** + * Returns the path (including file name) to the certificate trustStore file. + * @return A String that contains the path (including file name) to the certificate trustStore file, or null if no value is set. + */ public String getTrustStore(); + + /** + * Sets the password that is used to check the integrity of the trustStore data. + * @param p A String that contains the password that is used to check the integrity of the trustStore data. + */ public void setTrustStorePassword(String p); + + /** + * Sets the host name to be used in validating the SQL Server Secure Sockets Layer (SSL) certificate. + * @param host A String that contains the host name. + */ public void setHostNameInCertificate(String host); + + /** + * Returns the host name used in validating the SQL Server Secure Sockets Layer (SSL) certificate. + * @return A String that contains the host name, or null if no value is set. + */ public String getHostNameInCertificate(); + + /** + * Sets an int value that indicates the number of milliseconds to wait before the database reports a lock time out. + * @param lockTimeout An int value that contains the number of milliseconds to wait. + */ public void setLockTimeout(int lockTimeout); + + /** + * Returns an int value that indicates the number of milliseconds that the database will wait before reporting a lock time out. + * @return An int value that contains the number of milliseconds that the database will wait. + */ public int getLockTimeout(); + + /** + * Sets the password that will be used to connect to SQL Server. + * @param password A String that contains the password. + */ public void setPassword(String password); + + /** + * Sets the port number to be used to communicate with SQL Server. + * @param portNumber An int value that contains the port number. + */ public void setPortNumber(int portNumber); + + /** + * Returns the current port number that is used to communicate with SQL Server. + * @return An int value that contains the current port number. + */ public int getPortNumber(); + + /** + * Sets the default cursor type that is used for all result sets that are created by using this SQLServerDataSource object. + * @param selectMethod A String value that contains the default cursor type. + */ public void setSelectMethod(String selectMethod); + + /** + * Returns the default cursor type used for all result sets that are created by using this SQLServerDataSource object. + * @return A String value that contains the default cursor type. + */ public String getSelectMethod(); + + /** + * Sets the response buffering mode for connections created by using this SQLServerDataSource object. + * @param respo A String that contains the buffering and streaming mode. The valid mode can be one of the following case-insensitive Strings: full or adaptive. + */ public void setResponseBuffering(String respo); + + /** + * Returns the response buffering mode for this SQLServerDataSource object. + * @return A String that contains a lower-case full or adaptive. + */ public String getResponseBuffering(); + + /** + * Modifies the setting of the sendTimeAsDatetime connection property. + * @param sendTimeAsDatetime A Boolean value. When true, causes java.sql.Time values to be sent to the server as SQL Server datetime types. + * When false, causes java.sql.Time values to be sent to the server as SQL Server time types. + */ public void setSendTimeAsDatetime(boolean sendTimeAsDatetime); + + /** + * This method was added in SQL Server JDBC Driver 3.0. Returns the setting of the sendTimeAsDatetime connection property. + * @return true if java.sql.Time values will be sent to the server as a SQL Server datetime type. false if java.sql.Time values will be sent + * to the server as a SQL Server time type. + */ public boolean getSendTimeAsDatetime(); + + /** + * Sets a boolean value that indicates if sending string parameters to the server in UNICODE format is enabled. + * @param sendStringParametersAsUnicode true if string parameters are sent to the server in UNICODE format. Otherwise, false. + */ public void setSendStringParametersAsUnicode(boolean sendStringParametersAsUnicode); + + /** + * Returns a boolean value that indicates if sending string parameters to the server in UNICODE format is enabled. + * @return true if string parameters are sent to the server in UNICODE format. Otherwise, false. + */ public boolean getSendStringParametersAsUnicode(); + + /** + * Sets the name of the computer that is running SQL Server. + * @param serverName A String that contains the server name. + */ public void setServerName(String serverName); + + /** + * Returns the name of the SQL Server instance. + * @return A String that contains the server name or null if no value is set. + */ public String getServerName(); + + /** + * Sets the name of the failover server that is used in a database mirroring configuration. + * @param serverName A String that contains the failover server name. + */ public void setFailoverPartner(String serverName); + + /** + * Returns the name of the failover server that is used in a database mirroring configuration. + * @return A String that contains the name of the failover partner, or null if none is set. + */ public String getFailoverPartner(); + + /** + * Sets the value of the multiSubnetFailover connection property. + * @param multiSubnetFailover The new value of the multiSubnetFailover connection property. + */ public void setMultiSubnetFailover(boolean multiSubnetFailover); - public boolean getMultiSubnetFailover(); + + /** + * Returns the value of the multiSubnetFailover connection property. + * @return Returns true or false, depending on the current setting of the connection property. + */ + public boolean getMultiSubnetFailover(); + + /** + * Sets the user name that is used to connect the data source. + * @param user A String that contains the user name. + */ public void setUser(String user); + + /** + * Returns the user name that is used to connect the data source. + * @return A String that contains the user name. + */ public String getUser(); + + /** + * Sets the name of the client computer name that is used to connect to the data source. + * @param workstationID A String that contains the client computer name. + */ public void setWorkstationID(String workstationID); + + /** + * Returns the name of the client computer name that is used to connect to the data source. + * @return A String that contains the client computer name. + */ public String getWorkstationID(); + + /** + * Sets a Boolean value that indicates if converting SQL states to XOPEN compliant states is enabled. + * @param xopenStates true if converting SQL states to XOPEN compliant states is enabled. Otherwise, false. + */ public void setXopenStates(boolean xopenStates); + + /** + * Returns a boolean value that indicates if converting SQL states to XOPEN compliant states is enabled. + * @return true if converting SQL states to XOPEN compliant states is enabled. Otherwise, false. + */ public boolean getXopenStates(); + + /** + * Sets the URL that is used to connect to the data source. + * @param url A String that contains the URL. + */ public void setURL(String url); + + /** + * Returns the URL that is used to connect to the data source. + * @return A String that contains the URL. + */ public String getURL(); + + /** + * Sets the description of the data source. + * @param description A String that contains the description. + */ public void setDescription(String description); + + /** + * Returns a description of the data source. + * @return A String that contains the data source description or null if no value is set. + */ public String getDescription(); + + /** + * Sets the current network packet size used to communicate with SQL Server, specified in bytes. + * @param packetSize An int value containing the network packet size. + */ public void setPacketSize(int packetSize); + + /** + * Returns the current network packet size used to communicate with SQL Server, specified in bytes. + * @return An int value containing the current network packet size. + */ public int getPacketSize(); + + /** + * Indicates the kind of integrated security you want your application to use. + * @param authenticationScheme Values are "JavaKerberos" and the default "NativeAuthentication". + */ public void setAuthenticationScheme(String authenticationScheme); + + /** + * Sets the server spn + * @param serverSpn A String that contains the server spn + */ public void setServerSpn(String serverSpn); + + /** + * Returns the server spn + * @return A String that contains the server spn + */ public String getServerSpn(); } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java index 4571801b6..1712117d9 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -23,6 +23,15 @@ public interface ISQLServerPreparedStatement extends java.sql.PreparedStatement, ISQLServerStatement { + /** + * Sets the designated parameter to the given microsoft.sql.DateTimeOffset value. + * + * @param parameterIndex the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @throws SQLException if parameterIndex does not correspond to a parameter + * marker in the SQL statement; if a database access error occurs or + * this method is called on a closed PreparedStatement + */ public void setDateTimeOffset(int parameterIndex, microsoft.sql.DateTimeOffset x) throws SQLException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java index b680d0fbe..55f448304 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerPreparedStatement42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -31,7 +31,45 @@ public interface ISQLServerPreparedStatement42 extends ISQLServerPreparedStateme public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLServerException; + /** + * Sets the value of the designated parameter with the given object. + * + * This method is similar to {@link #setObject(int parameterIndex, + * Object x, SQLType targetSqlType, int scaleOrLength)}, + * except that it assumes a scale of zero. + *

+ * The default implementation will throw {@code SQLFeatureNotSupportedException} + * + * @param parameterIndex the first parameter is 1, the second is 2, ... + * @param x the object containing the input parameter value + * @param targetSqlType the SQL type to be sent to the database + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException if parameterIndex does not correspond to a + * parameter marker in the SQL statement; if a database access error occurs + * or this method is called on a closed {@code PreparedStatement} + */ public void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale) throws SQLServerException; + /** + * Sets the value of the designated parameter with the given object. + * + * This method is similar to {@link #setObject(int parameterIndex, + * Object x, SQLType targetSqlType, int scaleOrLength)}, + * except that it assumes a scale of zero. + *

+ * The default implementation will throw {@code SQLFeatureNotSupportedException} + * + * @param parameterIndex the first parameter is 1, the second is 2, ... + * @param x the object containing the input parameter value + * @param targetSqlType the SQL type to be sent to the database + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterIndex does not correspond to a + * parameter marker in the SQL statement; if a database access error occurs + * or this method is called on a closed {@code PreparedStatement} + */ public void setObject(int parameterIndex, Object x, SQLType targetSqlType, Integer precision, Integer scale, boolean forceEncrypt) throws SQLServerException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java index 8450c2d1c..b53e2f311 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -35,9 +35,36 @@ public interface ISQLServerResultSet extends java.sql.ResultSet public static final int CONCUR_SS_SCROLL_LOCKS = 1009; // CONCUR_UPDATABLE + 1 public static final int CONCUR_SS_OPTIMISTIC_CCVAL = 1010; // CONCUR_UPDATABLE + 2 + /** + * Retrieves the value of the designated column as a microsoft.sql.DateTimeOffset object, given a zero-based column ordinal. + * @param columnIndex The zero-based ordinal of a column. + * @return A DateTimeOffset Class object. + * @throws SQLException when an error occurs + */ public microsoft.sql.DateTimeOffset getDateTimeOffset(int columnIndex) throws SQLException; - public microsoft.sql.DateTimeOffset getDateTimeOffset(String columnName) throws SQLException; + + /** + * Retrieves the value of the column specified as a microsoft.sql.DateTimeOffset object, given a column name. + * @param columnName The name of a column. + * @return A DateTimeOffset Class object. + * @throws SQLException when an error occurs + */ + public microsoft.sql.DateTimeOffset getDateTimeOffset(String columnName) throws SQLException; + + /** + * Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal. + * @param index The zero-based ordinal of a column. + * @param x A DateTimeOffset Class object. + * @throws SQLException when an error occurs + */ public void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x) throws SQLException; + + /** + * Updates the value of the column specified to the DateTimeOffset Class value, given a column name. + * @param columnName The name of a column. + * @param x A DateTimeOffset Class object. + * @throws SQLException when an error occurs + */ public void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset x) throws SQLException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java index 320bb0170..87bb7e088 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerResultSet42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -31,10 +31,45 @@ public interface ISQLServerResultSet42 extends ISQLServerResultSet{ public void updateObject(int index, Object obj, SQLType targetSqlType, int scale) throws SQLServerException; + /** + * Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row. + * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. + * If the second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument + * is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will + * generate a SQLException when the statement is executed. + * The default implementation will throw SQLFeatureNotSupportedException + * @param index the first column is 1, the second is 2, ... + * @param obj the new column value + * @param targetSqlType the SQL type to be sent to the database + * @param scale for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and Reader, + * this is the length of the data in the stream or reader. For all other types, this value will be ignored. + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement.If the boolean forceEncrypt is set to false, the driver will not force + * encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateObject(int index, Object obj, SQLType targetSqlType, int scale, boolean forceEncrypt) throws SQLServerException; public void updateObject(String columnName, Object obj, SQLType targetSqlType, int scale) throws SQLServerException; + /** + * + * Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row. + * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. + * If the second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument + * is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will + * generate a SQLException when the statement is executed. + * The default implementation will throw SQLFeatureNotSupportedException + * @param columnName the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column + * @param obj the new column value + * @param targetSqlType the SQL type to be sent to the database + * @param scale for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and Reader, + * this is the length of the data in the stream or reader. For all other types, this value will be ignored. + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement.If the boolean forceEncrypt is set to false, the driver will not force + * encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateObject(String columnName, Object obj, SQLType targetSqlType, int scale, boolean forceEncrypt) throws SQLServerException; public void updateObject(String columnName, Object obj, SQLType targetSqlType) throws SQLServerException; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java index 0bad183ae..3d102061d 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerStatement.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -22,6 +22,25 @@ public interface ISQLServerStatement extends java.sql.Statement { + /** + * Sets the response buffering mode for this SQLServerStatement object to case-insensitive String full or adaptive. + *

+ * Response buffering controls the driver's buffering of responses from SQL Server. + *

+ * Possible values are: + *

+ * "full" - Fully buffer the response at execution time. + *

+ * "adaptive" - Data Pipe adaptive buffering + * @param value A String that contains the response buffering mode. The valid mode can be one of the following case-insensitive Strings: full or adaptive. + * @throws SQLServerException If there are any errors in setting the response buffering mode. + */ public void setResponseBuffering(String value) throws SQLServerException; + + /** + * Retrieves the response buffering mode for this SQLServerStatement object. + * @return A String that contains a lower-case full or adaptive. + * @throws SQLServerException If there are any errors in retrieving the response buffering mode. + */ public String getResponseBuffering() throws SQLServerException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java index 06ee22124..cf4af0233 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KeyStoreProviderCommon.java b/src/main/java/com/microsoft/sqlserver/jdbc/KeyStoreProviderCommon.java index 7cf0999c0..0050c6a61 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/KeyStoreProviderCommon.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/KeyStoreProviderCommon.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/KeyVaultCredential.java b/src/main/java/com/microsoft/sqlserver/jdbc/KeyVaultCredential.java index f7d0c915f..032b6db78 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/KeyVaultCredential.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/KeyVaultCredential.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -25,6 +25,11 @@ import com.microsoft.azure.keyvault.authentication.KeyVaultCredentials; import com.microsoft.windowsazure.core.pipeline.filter.ServiceRequestContext; +/** + * + * An implementation of ServiceClientCredentials that supports automatic bearer token refresh. + * + */ class KeyVaultCredential extends KeyVaultCredentials{ //this is the only supported access token type @@ -40,6 +45,12 @@ class KeyVaultCredential extends KeyVaultCredentials{ this.authenticationCallback = authenticationCallback; } + /** + * Authenticates the service request + * @param request the ServiceRequestContext + * @param challenge used to get the accessToken + * @return BasicHeader + */ @Override public Header doAuthenticate(ServiceRequestContext request, Map challenge) { assert null != challenge; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/PLPInputStream.java b/src/main/java/com/microsoft/sqlserver/jdbc/PLPInputStream.java index bdc1cdd25..9757ebe77 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/PLPInputStream.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/PLPInputStream.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -81,11 +81,13 @@ final static boolean isNull(TDSReader tdsReader) throws SQLServerException } /** - * Create a new input stream. - * @param tdsReader TDS reader pointing at the start of the PLP data - * @param discardValue - * @param dtv - */ + * Create a new input stream. + * @param tdsReader TDS reader pointing at the start of the PLP data + * @param discardValue boolean to represent if base input stream is adaptive and is streaming + * @param dtv DTV implementation for values set from the TDS response stream. + * @return PLPInputStream that is created + * @throws SQLServerException when an error occurs + */ final static PLPInputStream makeTempStream(TDSReader tdsReader, boolean discardValue, ServerDTVImpl dtv) throws SQLServerException { return makeStream(tdsReader, discardValue, discardValue, dtv); @@ -403,8 +405,10 @@ public void mark(int readLimit) setReadLimit(readLimit); } } + /** * Closes the stream releasing all resources held. + * @exception IOException if an I/O error occurs. */ public void close() throws IOException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java b/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java index e92ee9888..62c3de7a6 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/Parameter.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ParameterUtils.java b/src/main/java/com/microsoft/sqlserver/jdbc/ParameterUtils.java index 03eaaeae1..bfeeeb711 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ParameterUtils.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ParameterUtils.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ReaderInputStream.java b/src/main/java/com/microsoft/sqlserver/jdbc/ReaderInputStream.java index 623ca9d88..f0dd4749f 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ReaderInputStream.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ReaderInputStream.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java index 38ad09b05..76f1e79a9 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLCollation.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Algorithm.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Algorithm.java index b48fdc22d..2ef640f2b 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Algorithm.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Algorithm.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256EncryptionKey.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256EncryptionKey.java index d8b213aea..07a4bf92c 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256EncryptionKey.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256EncryptionKey.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Factory.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Factory.java index 94124ebd8..5fc02ca5f 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Factory.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerAeadAes256CbcHmac256Factory.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java index 1698ec437..f405f9818 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBlob.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -107,7 +107,7 @@ private synchronized static int nextInstanceID() /** * Frees this Blob object and releases the resources that it holds. - * + *

* After free() has been called, any attempt to invoke a method other than free() will * result in a SQLException being thrown. If free() is called multiple times, the subsequent * calls to free are treated as a no-op. @@ -154,11 +154,6 @@ private final void checkClosed() throws SQLServerException } } - /** - * Return an input stream to read data from this BLOB - * @throws SQLException - * @return the input stream to that contains the BLOB data - */ public InputStream getBinaryStream() throws SQLException { checkClosed(); @@ -232,7 +227,7 @@ public byte[] getBytes(long pos, int length) throws SQLException /** * Return the length of the BLOB - * @throws SQLException + * @throws SQLException when an error occurs * @return the data length */ public long length() throws SQLException @@ -321,7 +316,7 @@ public long position(byte[] bPattern, long start) throws SQLException /** * Truncate a BLOB * @param len the new length for the BLOB - * @throws SQLException + * @throws SQLException when an error occurs */ public void truncate(long len) throws SQLException { @@ -460,12 +455,14 @@ public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLExcep } -// SQLServerBlobOutputStream is a simple java.io.OutputStream interface implementing class that -// forwards all calls to SQLServerBlob.setBytes. This class is returned to caller by -// SQLServerBlob class when setBinaryStream is called. -// -// SQLServerBlobOutputStream starts writing at postion startPos and continues to write -// in a forward only manner. Reset/mark are not supported. +/** + * SQLServerBlobOutputStream is a simple java.io.OutputStream interface implementing class that + * forwards all calls to SQLServerBlob.setBytes. This class is returned to caller by + * SQLServerBlob class when setBinaryStream is called. + *

+ * SQLServerBlobOutputStream starts writing at postion startPos and continues to write + * in a forward only manner. Reset/mark are not supported. + */ final class SQLServerBlobOutputStream extends java.io.OutputStream { private SQLServerBlob parentBlob = null; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java index 8837e4255..5b04412b8 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCSVFileRecord.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -196,11 +196,32 @@ public SQLServerBulkCSVFileRecord(String fileToParse, boolean firstLineIsColumnN this(fileToParse,null,",", firstLineIsColumnNames); } + /** + * Adds metadata for the given column in the file. + * + * @param positionInFile Indicates which column the metadata is for. Columns start at 1. + * @param name Name for the column (optional if only using column ordinal in a mapping for SQLServerBulkCopy operation) + * @param jdbcType JDBC data type of the column + * @param precision Precision for the column (ignored for the appropriate data types) + * @param scale Scale for the column (ignored for the appropriate data types) + * @param dateTimeFormatter format to parse data that is sent + * @throws SQLServerException when an error occurs + */ public void addColumnMetadata(int positionInFile, String name, int jdbcType, int precision, int scale, DateTimeFormatter dateTimeFormatter) throws SQLServerException { addColumnMetadataInternal(positionInFile, name, jdbcType, precision, scale, dateTimeFormatter); } + /** + * Adds metadata for the given column in the file. + * + * @param positionInFile Indicates which column the metadata is for. Columns start at 1. + * @param name Name for the column (optional if only using column ordinal in a mapping for SQLServerBulkCopy operation) + * @param jdbcType JDBC data type of the column + * @param precision Precision for the column (ignored for the appropriate data types) + * @param scale Scale for the column (ignored for the appropriate data types) + * @throws SQLServerException when an error occurs + */ public void addColumnMetadata(int positionInFile, String name, int jdbcType, int precision, int scale) throws SQLServerException { addColumnMetadataInternal(positionInFile, name, jdbcType, precision, scale, null); @@ -215,7 +236,7 @@ public void addColumnMetadata(int positionInFile, String name, int jdbcType, int * @param precision Precision for the column (ignored for the appropriate data types) * @param scale Scale for the column (ignored for the appropriate data types) * @param dateTimeFormatter format to parse data that is sent - * @throws SQLServerException + * @throws SQLServerException when an error occurs */ void addColumnMetadataInternal(int positionInFile, String name, int jdbcType, int precision, int scale, DateTimeFormatter dateTimeFormatter) throws SQLServerException { @@ -299,7 +320,7 @@ public void setTimestampWithTimezoneFormat(String dateTimeFormat) /** * Set the format for reading in dates from the file. - * @param dateTimeFormat format to parse data sent as java.sql.Types.TIMESTAMP_WITH_TIMEZONE + * @param dateTimeFormatter format to parse data sent as java.sql.Types.TIMESTAMP_WITH_TIMEZONE */ public void setTimestampWithTimezoneFormat(DateTimeFormatter dateTimeFormatter) { @@ -314,7 +335,7 @@ public void setTimestampWithTimezoneFormat(DateTimeFormatter dateTimeFormatter) /** * Set the format for reading in dates from the file. - * @param dateTimeFormat format to parse data sent as java.sql.Types.TIME_WITH_TIMEZONE + * @param timeFormat format to parse data sent as java.sql.Types.TIME_WITH_TIMEZONE */ public void setTimeWithTimezoneFormat(String timeFormat) { @@ -328,7 +349,7 @@ public void setTimeWithTimezoneFormat(String timeFormat) /** * Set the format for reading in dates from the file. - * @param dateTimeFormat format to parse data sent as java.sql.Types.TIME_WITH_TIMEZONE + * @param dateTimeFormatter format to parse data sent as java.sql.Types.TIME_WITH_TIMEZONE */ public void setTimeWithTimezoneFormat(DateTimeFormatter dateTimeFormatter) { @@ -342,6 +363,7 @@ public void setTimeWithTimezoneFormat(DateTimeFormatter dateTimeFormatter) /** * Releases any resources associated with the file reader. + * @throws SQLServerException when an error occurs */ public void close() throws SQLServerException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java index aaa1af0d1..d9f6b49d7 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -600,7 +600,7 @@ public void writeToServer(RowSet sourceData) throws SQLServerException writeResultSet(sourceData, true); } - /* + /** * Copies all rows in the supplied ResultSet to a destination table specified by the destinationTableName property of the SQLServerBulkCopy object. * * @param sourceData ResultSet to read data rows from. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java index d965a0854..aa961ec8d 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopyOptions.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopyOptions.java index 9da3582e0..3bce3908b 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopyOptions.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopyOptions.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -293,11 +293,27 @@ public void setFireTriggers(boolean fireTriggers) this.fireTriggers = fireTriggers; } + /** + * Indicates if allowEncryptedValueModifications option is enabled or not + * @return True if allowEncryptedValueModification is set to true; false otherwise. + */ public boolean isAllowEncryptedValueModifications() { return allowEncryptedValueModifications; } + /** + * Sets whether the driver would send data as is or would decrypt the data and encrypt it again before sending to SQL Server + *

+ * Use caution when specifying allowEncryptedValueModifications as this may lead to corrupting the database + * because the driver does not check if the data is indeed encrypted, or if it is correctly encrypted using the + * same encryption type, algorithm and key as the target column. + * + * @param allowEncryptedValueModifications enables bulk copying of encrypted data between tables or databases, without + * decrypting the data. Typically, an application would select data from encrypted columns from one table without + * decrypting the data (the app would connect to the database with the column encryption setting keyword set to disabled) + * and then would use this option to bulk insert the data, which is still encrypted. + */ public void setAllowEncryptedValueModifications(boolean allowEncryptedValueModifications) { this.allowEncryptedValueModifications = allowEncryptedValueModifications; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java index 14a7ecea6..98ce85512 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -35,7 +35,7 @@ * CallableStatement allows the caller to specify the procedure name to call along with input parameter * value and output parameter types. Callable statement also allows the return of a return status with * the ? = call( ?, ..) JDBC syntax -*

  • +*

    * The API javadoc for JDBC API methods that this class implements are not repeated here. Please * see Sun's JDBC API interfaces javadoc for those details. */ @@ -851,6 +851,12 @@ public Timestamp getTimestamp(String name, Calendar cal) throws SQLServerExcepti return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param index the first column is 1, the second is 2, ... + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getDateTime(int index) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -861,6 +867,12 @@ public Timestamp getDateTime(int index) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param sCol the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getDateTime(String sCol) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getDateTime", sCol); @@ -870,6 +882,14 @@ public Timestamp getDateTime(String sCol) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does not store timezone information. + * @param index the first column is 1, the second is 2, ... + * @param cal the java.util.Calendar object to use in constructing the dateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getDateTime(int index, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -880,6 +900,14 @@ public Timestamp getDateTime(int index, Calendar cal) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does not store timezone information. + * @param name the name of the column + * @param cal the java.util.Calendar object to use in constructing the dateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getDateTime(String name, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -890,6 +918,12 @@ public Timestamp getDateTime(String name, Calendar cal) throws SQLServerExceptio return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param index the first column is 1, the second is 2, ... + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getSmallDateTime(int index) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -900,6 +934,12 @@ public Timestamp getSmallDateTime(int index) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param sCol The name of a column. + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getSmallDateTime(String sCol) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallDateTime", sCol); @@ -909,6 +949,13 @@ public Timestamp getSmallDateTime(String sCol) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param index the first column is 1, the second is 2, ... + * @param cal the java.util.Calendar object to use in constructing the smalldateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getSmallDateTime(int index, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -919,6 +966,13 @@ public Timestamp getSmallDateTime(int index, Calendar cal) throws SQLServerExcep return value; } + /** + * + * @param name The name of a column + * @param cal the java.util.Calendar object to use in constructing the smalldateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public Timestamp getSmallDateTime(String name, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -979,6 +1033,31 @@ public microsoft.sql.DateTimeOffset getDateTimeOffset(String sCol) throws SQLExc return bWasNull; } + /** + * Retrieves the value of the designated column in the current row + * of this ResultSet object as + * a stream of ASCII characters. The value can then be read in chunks from the + * stream. This method is particularly + * suitable for retrieving large LONGVARCHAR values. + * The JDBC driver will + * do any necessary conversion from the database format into ASCII. + * + *

    Note: All the data in the returned stream must be + * read prior to getting the value of any other column. The next + * call to a getter method implicitly closes the stream. Also, a + * stream may return 0 when the method + * InputStream.available + * is called whether there is data available or not. + * + * @param paramIndex the first column is 1, the second is 2, ... + * @return a Java input stream that delivers the database column value + * as a stream of one-byte ASCII characters; + * if the value is SQL NULL, the + * value returned is null + * @throws SQLServerException if the columnIndex is not valid; + * if a database access error occurs or this method is + * called on a closed result set + */ public final java.io.InputStream getAsciiStream(int paramIndex) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getAsciiStream", paramIndex); @@ -988,6 +1067,30 @@ public final java.io.InputStream getAsciiStream(int paramIndex) throws SQLServer return value; } + /** + * Retrieves the value of the designated column in the current row + * of this ResultSet object as a stream of + * ASCII characters. The value can then be read in chunks from the + * stream. This method is particularly + * suitable for retrieving large LONGVARCHAR values. + * The JDBC driver will + * do any necessary conversion from the database format into ASCII. + * + *

    Note: All the data in the returned stream must be + * read prior to getting the value of any other column. The next + * call to a getter method implicitly closes the stream. Also, a + * stream may return 0 when the method available + * is called whether there is data available or not. + * + * @param paramName the name of the parameter + * @return a Java input stream that delivers the database column value + * as a stream of one-byte ASCII characters. + * If the value is SQL NULL, + * the value returned is null. + * @throws SQLServerException if the columnLabel is not valid; + * if a database access error occurs or this method is + * called on a closed result set + */ public final java.io.InputStream getAsciiStream(String paramName) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getAsciiStream", paramName); @@ -1015,6 +1118,12 @@ public BigDecimal getBigDecimal(String sCol) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param index The zero-based ordinal of a column. + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public BigDecimal getMoney(int index) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getMoney", index); @@ -1024,6 +1133,12 @@ public BigDecimal getMoney(int index) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param sCol The name of a column. + * @return the column value; if the value is SQL NULL, the value returned is null. + * @throws SQLServerException when an error occurs + */ public BigDecimal getMoney(String sCol) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getMoney", sCol); @@ -1033,6 +1148,12 @@ public BigDecimal getMoney(String sCol) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param index The zero-based ordinal of a column. + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public BigDecimal getSmallMoney(int index) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallMoney", index); @@ -1042,6 +1163,12 @@ public BigDecimal getSmallMoney(int index) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param sCol The name of a column. + * @return the column value; if the value is SQL NULL, the value returned is null. + * @throws SQLServerException when an error occurs + */ public BigDecimal getSmallMoney(String sCol) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallMoney", sCol); @@ -1051,6 +1178,29 @@ public BigDecimal getSmallMoney(String sCol) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row + * of this ResultSet object as a stream of + * uninterpreted bytes. The value can then be read in chunks from the + * stream. This method is particularly + * suitable for retrieving large LONGVARBINARY values. + * + *

    Note: All the data in the returned stream must be + * read prior to getting the value of any other column. The next + * call to a getter method implicitly closes the stream. Also, a + * stream may return 0 when the method + * InputStream.available + * is called whether there is data available or not. + * + * @param paramIndex the first column is 1, the second is 2, ... + * @return a Java input stream that delivers the database column value + * as a stream of uninterpreted bytes; + * if the value is SQL NULL, the value returned is + * null + * @throws SQLServerException if the columnIndex is not valid; + * if a database access error occurs or this method is + * called on a closed result set + */ public final java.io.InputStream getBinaryStream(int paramIndex) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getBinaryStream", paramIndex); @@ -1060,6 +1210,29 @@ public final java.io.InputStream getBinaryStream(int paramIndex) throws SQLServe return value; } + /** + * Retrieves the value of the designated column in the current row + * of this ResultSet object as a stream of uninterpreted + * bytes. + * The value can then be read in chunks from the + * stream. This method is particularly + * suitable for retrieving large LONGVARBINARY + * values. + * + *

    Note: All the data in the returned stream must be + * read prior to getting the value of any other column. The next + * call to a getter method implicitly closes the stream. Also, a + * stream may return 0 when the method available + * is called whether there is data available or not. + * + * @param paramName the name of the parameter + * @return a Java input stream that delivers the database column value + * as a stream of uninterpreted bytes; + * if the value is SQL NULL, the result is null + * @throws SQLServerException if the columnLabel is not valid; + * if a database access error occurs or this method is + * called on a closed result set + */ public final java.io.InputStream getBinaryStream(String paramName) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getBinaryStream", paramName); @@ -1219,7 +1392,7 @@ public NClob getNClob(String parameterName) throws SQLException /** * Find a column's index given its name. * @param columnName the name - * @throws SQLServerException + * @throws SQLServerException when an error occurs * @return the index */ /*L3*/ private int findColumn(String columnName) throws SQLServerException @@ -1411,6 +1584,22 @@ public void setTimestamp(String sCol, java.sql.Timestamp x, Calendar c) throws S loggerExternal.exiting(getClassNameLogging(), "setTimeStamp"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver + * converts this to an SQL TIMESTAMP value when it sends it to the + * database. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @param c a java.util.Calendar + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getTimestamp + */ public void setTimestamp(String sCol, java.sql.Timestamp x, Calendar c, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1429,6 +1618,27 @@ public void setTime(String sCol, java.sql.Time x, Calendar c) throws SQLServerEx loggerExternal.exiting(getClassNameLogging(), "setTime"); } + /** + * Sets the designated parameter to the given java.sql.Time value, + * using the given Calendar object. The driver uses + * the Calendar object to construct an SQL TIME value, + * which the driver then sends to the database. With a + * a Calendar object, the driver can calculate the time + * taking into account a custom timezone. If no + * Calendar object is specified, the driver uses the default + * timezone, which is that of the virtual machine running the application. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @param c the Calendar object the driver will use + * to construct the time + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getTime + */ public void setTime(String sCol, java.sql.Time x, Calendar c, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1447,6 +1657,27 @@ public void setDate(String sCol, java.sql.Date x, Calendar c) throws SQLServerEx loggerExternal.exiting(getClassNameLogging(), "setDate"); } + /** + * Sets the designated parameter to the given java.sql.Date value, + * using the given Calendar object. The driver uses + * the Calendar object to construct an SQL DATE value, + * which the driver then sends to the database. With a + * a Calendar object, the driver can calculate the date + * taking into account a custom timezone. If no + * Calendar object is specified, the driver uses the default + * timezone, which is that of the virtual machine running the application. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @param c the Calendar object the driver will use + * to construct the date + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getDate + */ public void setDate(String sCol, java.sql.Date x, Calendar c, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1576,6 +1807,20 @@ public final void setNString(String parameterName, String value) throws SQLExcep loggerExternal.exiting(getClassNameLogging(), "setNString"); } + /** + * Sets the designated parameter to the given String object. + * The driver converts this to a SQL NCHAR or + * NVARCHAR or LONGNVARCHAR + * @param parameterName the name of the parameter to be set + * @param value the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException if parameterName does not correspond to a named + * parameter; if the driver does not support national + * character sets; if the driver can detect that a data conversion + * error could occur; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public final void setNString(String parameterName, String value, boolean forceEncrypt) throws SQLException { DriverJDBCVersion.checkSupportsJDBC4(); @@ -1632,6 +1877,40 @@ public void setObject(String sCol, Object o, int n, int m) throws SQLServerExcep loggerExternal.exiting(getClassNameLogging(), "setObject"); } + /** + * Sets the value of the designated parameter with the given object. + * + *

    The given Java object will be converted to the given targetSqlType + * before being sent to the database. + * + * If the object has a custom mapping (is of a class implementing the + * interface SQLData), + * the JDBC driver should call the method SQLData.writeSQL to write it + * to the SQL data stream. + * If, on the other hand, the object is of a class implementing + * Ref, Blob, Clob, NClob, + * Struct, java.net.URL, + * or Array, the driver should pass it to the database as a + * value of the corresponding SQL type. + *

    + * Note that this method may be used to pass datatabase- + * specific abstract data types. + * + * @param sCol the name of the parameter + * @param o the object containing the input parameter value + * @param n the SQL type (as defined in java.sql.Types) to be + * sent to the database. The scale argument may further qualify this type. + * @param m for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, + * this is the number of digits after the decimal point. For all other + * types, this value will be ignored. + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see Types + * @see #getObject + */ public void setObject(String sCol, Object o, int n, int m, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1658,6 +1937,37 @@ public void setObject(String sCol, Object o, int n, int m, boolean forceEncrypt) loggerExternal.exiting(getClassNameLogging(), "setObject"); } + /** + * Sets the value of the designated parameter with the given object. + * + *

    The given Java object will be converted to the given targetSqlType + * before being sent to the database. + * + * If the object has a custom mapping (is of a class implementing the + * interface SQLData), + * the JDBC driver should call the method SQLData.writeSQL to write it + * to the SQL data stream. + * If, on the other hand, the object is of a class implementing + * Ref, Blob, Clob, NClob, + * Struct, java.net.URL, + * or Array, the driver should pass it to the database as a + * value of the corresponding SQL type. + *

    + * Note that this method may be used to pass datatabase- + * specific abstract data types. + * + * @param sCol the name of the parameter + * @param x the object containing the input parameter value + * @param targetSqlType the SQL type (as defined in java.sql.Types) to be + * sent to the database. The scale argument may further qualify this type. + * @param precision the precision of the column. + * @param scale the scale of the column. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see Types + * @see #getObject + */ public final void setObject(String sCol, Object x, int targetSqlType, Integer precision, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1787,6 +2097,20 @@ public void setTimestamp(String sCol, java.sql.Timestamp t) throws SQLServerExce loggerExternal.exiting(getClassNameLogging(), "setTimestamp"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver + * converts this to an SQL TIMESTAMP value when it sends it to the + * database. + * + * @param sCol the name of the parameter + * @param t the parameter value + * @param scale the scale of the parameter + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getTimestamp + */ public void setTimestamp(String sCol, java.sql.Timestamp t, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1796,6 +2120,22 @@ public void setTimestamp(String sCol, java.sql.Timestamp t, int scale) throws SQ loggerExternal.exiting(getClassNameLogging(), "setTimestamp"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver + * converts this to an SQL TIMESTAMP value when it sends it to the + * database. + * + * @param sCol the name of the parameter + * @param t the parameter value + * @param scale the scale of the parameter + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getTimestamp + */ public void setTimestamp(String sCol, java.sql.Timestamp t, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1814,6 +2154,13 @@ public void setDateTimeOffset(String sCol, microsoft.sql.DateTimeOffset t) throw loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset"); } + /** + * Sets parameter parameterName to DateTimeOffset x + * @param sCol the name of the parameter + * @param t DateTimeOffset value + * @param scale the scale of the parameter + * @throws SQLException if an error occurs + */ public void setDateTimeOffset(String sCol, microsoft.sql.DateTimeOffset t, int scale) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1823,6 +2170,15 @@ public void setDateTimeOffset(String sCol, microsoft.sql.DateTimeOffset t, int s loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset"); } + /** + * Sets parameter parameterName to DateTimeOffset x + * @param sCol the name of the parameter + * @param t DateTimeOffset value + * @param scale the scale of the parameter + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException if an error occurs + */ public void setDateTimeOffset(String sCol, microsoft.sql.DateTimeOffset t, int scale, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1850,6 +2206,19 @@ public void setTime(String sCol, java.sql.Time t) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setTime"); } + /** + * Sets the designated parameter to the given java.sql.Time value. + * The driver converts this + * to an SQL TIME value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param t the parameter value + * @param scale the scale of the column + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getTime + */ public void setTime(String sCol, java.sql.Time t, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1859,6 +2228,21 @@ public void setTime(String sCol, java.sql.Time t, int scale) throws SQLServerExc loggerExternal.exiting(getClassNameLogging(), "setTime"); } + /** + * Sets the designated parameter to the given java.sql.Time value. + * The driver converts this + * to an SQL TIME value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param t the parameter value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + * @see #getTime + */ public void setTime(String sCol, java.sql.Time t, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1867,6 +2251,18 @@ public void setTime(String sCol, java.sql.Time t, int scale, boolean forceEncryp setValue(findColumn(sCol), JDBCType.TIME, t, JavaType.TIME, null, scale, forceEncrypt); loggerExternal.exiting(getClassNameLogging(), "setTime"); } + + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver converts this + * to an SQL DATETIME value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setDateTime(String sCol, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1876,6 +2272,19 @@ public void setDateTime(String sCol, java.sql.Timestamp x) throws SQLServerExce loggerExternal.exiting(getClassNameLogging(), "setDateTime"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver converts this + * to an SQL DATETIME value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setDateTime(String sCol, java.sql.Timestamp x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1885,6 +2294,17 @@ public void setDateTime(String sCol, java.sql.Timestamp x, boolean forceEncrypt) loggerExternal.exiting(getClassNameLogging(), "setDateTime"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver converts this + * to an SQL SMALLDATETIME value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setSmallDateTime(String sCol, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1894,6 +2314,19 @@ public void setSmallDateTime(String sCol, java.sql.Timestamp x) throws SQLServe loggerExternal.exiting(getClassNameLogging(), "setSmallDateTime"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver converts this + * to an SQL SMALLDATETIME value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setSmallDateTime(String sCol, java.sql.Timestamp x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1903,6 +2336,17 @@ public void setSmallDateTime(String sCol, java.sql.Timestamp x, boolean forceEnc loggerExternal.exiting(getClassNameLogging(), "setSmallDateTime"); } + /** + * Sets the designated parameter to the given String value. + * The driver converts this + * to an SQL uniqueIdentifier value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param guid the parameter value + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setUniqueIdentifier(String sCol, String guid) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1912,6 +2356,19 @@ public void setUniqueIdentifier(String sCol, String guid) throws SQLServerExcept loggerExternal.exiting(getClassNameLogging(), "setUniqueIdentifier"); } + /** + * Sets the designated parameter to the given String value. + * The driver converts this + * to an SQL uniqueIdentifier value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param guid the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setUniqueIdentifier(String sCol, String guid, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1930,6 +2387,21 @@ public void setBytes(String sCol, byte[] b) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setBytes"); } + /** + * Sets the designated parameter to the given Java array of bytes. + * The driver converts this to an SQL VARBINARY or + * LONGVARBINARY (depending on the argument's size relative + * to the driver's limits on VARBINARY values) when it sends + * it to the database. + * + * @param sCol the name of the parameter + * @param b the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setBytes(String sCol, byte[] b, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1948,6 +2420,19 @@ public void setByte(String sCol, byte b) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setByte"); } + /** + * Sets the designated parameter to the given Java byte value. + * The driver converts this + * to an SQL TINYINT value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param b the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setByte(String sCol, byte b, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1966,6 +2451,22 @@ public void setString(String sCol, String s) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setString"); } + /** + * Sets the designated parameter to the given Java String value. + * The driver converts this + * to an SQL VARCHAR or LONGVARCHAR value + * (depending on the argument's + * size relative to the driver's limits on VARCHAR values) + * when it sends it to the database. + * + * @param sCol the name of the parameter + * @param s the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setString(String sCol, String s, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1975,6 +2476,16 @@ public void setString(String sCol, String s, boolean forceEncrypt) throws SQLSer loggerExternal.exiting(getClassNameLogging(), "setString"); } + /** + * Sets the designated parameter to the given Java java.math.BigDecimal value. + * The driver converts this + * to an SQL Money value. + * @param sCol the name of the parameter + * @param bd the parameter value + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setMoney(String sCol, BigDecimal bd) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1984,6 +2495,18 @@ public void setMoney(String sCol, BigDecimal bd) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setMoney"); } + /** + * Sets the designated parameter to the given Java java.math.BigDecimal value. + * The driver converts this + * to an SQL Money value. + * @param sCol the name of the parameter + * @param bd the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setMoney(String sCol, BigDecimal bd, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1993,6 +2516,16 @@ public void setMoney(String sCol, BigDecimal bd, boolean forceEncrypt) throws SQ loggerExternal.exiting(getClassNameLogging(), "setMoney"); } + /** + * Sets the designated parameter to the given Java java.math.BigDecimal value. + * The driver converts this + * to an SQL smallMoney value. + * @param sCol the name of the parameter + * @param bd the parameter value + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setSmallMoney(String sCol, BigDecimal bd) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2002,6 +2535,18 @@ public void setSmallMoney(String sCol, BigDecimal bd) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setSmallMoney"); } + /** + * Sets the designated parameter to the given Java java.math.BigDecimal value. + * The driver converts this + * to an SQL smallMoney value. + * @param sCol the name of the parameter + * @param bd the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setSmallMoney(String sCol, BigDecimal bd, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2020,6 +2565,20 @@ public void setBigDecimal(String sCol, BigDecimal bd) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setBigDecimal"); } + /** + * Sets the designated parameter to the given + * java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param sCol the name of the parameter + * @param bd the parameter value + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setBigDecimal(String sCol, BigDecimal bd, int precision, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2029,6 +2588,22 @@ public void setBigDecimal(String sCol, BigDecimal bd, int precision, int scale) loggerExternal.exiting(getClassNameLogging(), "setBigDecimal"); } + /** + * Sets the designated parameter to the given + * java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param sCol the name of the parameter + * @param bd the parameter value + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setBigDecimal(String sCol, BigDecimal bd, int precision, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2047,6 +2622,19 @@ public void setDouble(String sCol, double d) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setDouble"); } + /** + * Sets the designated parameter to the given Java double value. + * The driver converts this + * to an SQL DOUBLE value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param d the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setDouble(String sCol, double d, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2065,6 +2653,19 @@ public void setFloat(String sCol, float f) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setFloat"); } + /** + * Sets the designated parameter to the given Java float value. + * The driver converts this + * to an SQL FLOAT value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param f the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setFloat(String sCol, float f, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2083,6 +2684,19 @@ public void setInt(String sCol, int i) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setInt"); } + /** + * Sets the designated parameter to the given Java int value. + * The driver converts this + * to an SQL INTEGER value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param i the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setInt(String sCol, int i, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2101,6 +2715,19 @@ public void setLong(String sCol, long l) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setLong"); } + /** + * Sets the designated parameter to the given Java long value. + * The driver converts this + * to an SQL BIGINT value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param l the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setLong(String sCol, long l, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2119,6 +2746,19 @@ public void setShort(String sCol, short s) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setShort"); } + /** + * Sets the designated parameter to the given Java short value. + * The driver converts this + * to an SQL SMALLINT value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param s the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setShort(String sCol, short s, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2137,6 +2777,19 @@ public void setBoolean(String sCol, boolean b) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setBoolean"); } + /** + * Sets the designated parameter to the given Java boolean value. + * The driver converts this + * to an SQL BIT or BOOLEAN value when it sends it to the database. + * + * @param sCol the name of the parameter + * @param b the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException if parameterName does not correspond to a named + * parameter; if a database access error occurs or + * this method is called on a closed CallableStatement + */ public void setBoolean(String sCol, boolean b, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2172,6 +2825,13 @@ public void setURL(String sCol, URL u) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setURL"); } + /** + * Populates a table valued parameter passed to a stored procedure with a data table. + * @param sCol the name of the parameter + * @param tvpName the name of the type TVP + * @param tvpDataTable the data table object + * @throws SQLServerException when an error occurs + */ public final void setStructured(String sCol, String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException { tvpName = getTVPNameIfNull(findColumn(sCol), tvpName); @@ -2182,6 +2842,13 @@ public final void setStructured(String sCol, String tvpName, SQLServerDataTable loggerExternal.exiting(getClassNameLogging(), "setStructured"); } + /** + * Populates a table valued parameter passed to a stored procedure with a ResultSet retrieved from another table + * @param sCol the name of the parameter + * @param tvpName the name of the type TVP + * @param tvpResultSet the source result set object + * @throws SQLServerException when an error occurs + */ public final void setStructured(String sCol, String tvpName, ResultSet tvpResultSet) throws SQLServerException { tvpName = getTVPNameIfNull(findColumn(sCol), tvpName); @@ -2192,6 +2859,14 @@ public final void setStructured(String sCol, String tvpName, ResultSet tvpResult loggerExternal.exiting(getClassNameLogging(), "setStructured"); } + /** + * Populates a table valued parameter passed to a stored procedure with an ISQLServerDataRecord object. + * @param sCol the name of the parameter + * @param tvpName the name of the type TVP + * @param tvpDataRecord ISQLServerDataRecord is used for streaming data and the user decides how to use it. + * tvpDataRecord is an ISQLServerDataRecord object.the source result set object + * @throws SQLServerException when an error occurs + */ public final void setStructured(String sCol, String tvpName, ISQLServerDataRecord tvpDataRecord) throws SQLServerException { tvpName = getTVPNameIfNull(findColumn(sCol), tvpName); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java index 26e908420..a5892d6d2 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerCallableStatement42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java index dae0a2944..2b84098ff 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -133,6 +133,8 @@ private String getDisplayClassName() * After free() has been called, any attempt to invoke a method other than free() will * result in a SQLException being thrown. If free() is called multiple times, the subsequent * calls to free are treated as a no-op. + * + * @throws SQLException when an error occurs */ public void free() throws SQLException { @@ -178,7 +180,7 @@ private final void checkClosed() throws SQLServerException /** * Materialize the CLOB as an ASCII stream. - * @throws SQLException + * @throws SQLException when an error occurs * @return the data as an input stream */ public InputStream getAsciiStream() throws SQLException @@ -210,6 +212,13 @@ public Reader getCharacterStream() throws SQLException return getterStream; } + /** + * Returns the Clob data as a java.io.Reader object or as a stream of characters with the specified position and length. + * @param pos A long that indicates the offset to the first character of the partial value to be retrieved. + * @param length A long that indicates the length in characters of the partial value to be retrieved. + * @return A Reader object that contains the Clob data. + * @throws SQLException when an error occurs. + */ public Reader getCharacterStream(long pos, long length) throws SQLException { DriverJDBCVersion.checkSupportsJDBC4(); @@ -263,7 +272,7 @@ public String getSubString(long pos, int length) throws SQLException /** * Retrieves the number of characters in the CLOB value designated by this Clob object. - * @throws SQLException + * @throws SQLException when an error occurs * @return length of the CLOB in characters */ public long length() throws SQLException @@ -337,7 +346,7 @@ public long position(String searchstr, long start) throws SQLException /** * Truncates the CLOB value that this Clob designates to have a length of len characters. * @param len the length, in characters, to which the CLOB value should be truncated - * @throws SQLException + * @throws SQLException when an error occurs */ public void truncate(long len) throws SQLException { @@ -358,7 +367,7 @@ public void truncate(long len) throws SQLException * Retrieves a stream to be used to write Ascii characters to the CLOB value that * this Clob object represents, starting at position pos. * @param pos the position at which to start writing to this CLOB object - * @throws SQLException + * @throws SQLException when an error occurs * @return the stream to which ASCII encoded characters can be written */ public java.io.OutputStream setAsciiStream(long pos) throws SQLException @@ -379,7 +388,7 @@ public java.io.OutputStream setAsciiStream(long pos) throws SQLException * Retrieves a stream to be used to write a stream of Unicode characters to * the CLOB value that this Clob object represents, at position pos. * @param pos the position at which to start writing to the CLOB value - * @throws SQLException + * @throws SQLException when an error occurs * @return a stream to which Unicode encoded characters can be written */ public java.io.Writer setCharacterStream(long pos) throws SQLException @@ -401,7 +410,7 @@ public java.io.Writer setCharacterStream(long pos) throws SQLException * at the position pos. * @param pos the position at which to start writing to the CLOB * @param s the string to be written to the CLOB value that this Clob designates - * @throws SQLException + * @throws SQLException when an error occurs * @return the number of characters written */ public int setString(long pos, String s) throws SQLException diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionAzureKeyVaultProvider.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionAzureKeyVaultProvider.java index e3be179d3..6489bf9d0 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionAzureKeyVaultProvider.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionAzureKeyVaultProvider.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -87,8 +87,8 @@ public String getName() * to authenticate to Azure Key Vault. * * @param authenticationCallback - Callback function used for authenticating to AAD. - * @param executorService - * @throws SQLServerException + * @param executorService - The ExecutorService used to create the keyVaultClient + * @throws SQLServerException when an error occurs */ public SQLServerColumnEncryptionAzureKeyVaultProvider(SQLServerKeyVaultAuthenticationCallback authenticationCallback, ExecutorService executorService) throws SQLServerException{ if(null == authenticationCallback){ @@ -555,7 +555,7 @@ private boolean AzureKeyVaultVerifySignature(byte[] dataToVerify, byte[] signatu * * @param masterKeyPath - Azure Key Vault Key path * @return Key size in bytes - * @throws SQLServerException + * @throws SQLServerException when an error occurs */ private int getAKVKeySize(String masterKeyPath) throws SQLServerException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionCertificateStoreProvider.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionCertificateStoreProvider.java index f68388818..438623f3f 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionCertificateStoreProvider.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionCertificateStoreProvider.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -42,7 +42,10 @@ import com.microsoft.sqlserver.jdbc.AuthenticationJNI; - +/** + * The implementation of the key store provider for the Windows Certificate Store. This class enables using keys stored in the Windows Certificate Store as column master keys. + * + */ public final class SQLServerColumnEncryptionCertificateStoreProvider extends SQLServerColumnEncryptionKeyStoreProvider { static final private java.util.logging.Logger windowsCertificateStoreLogger = diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionJavaKeyStoreProvider.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionJavaKeyStoreProvider.java index c94ea98bf..5818612d5 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionJavaKeyStoreProvider.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionJavaKeyStoreProvider.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -47,6 +47,11 @@ import static java.nio.charset.StandardCharsets.UTF_16LE; +/** + * + * The implementation of the key store provider for Java Key Store. This class enables using certificates stored in the Java keystore as column master keys. + * + */ public class SQLServerColumnEncryptionJavaKeyStoreProvider extends SQLServerColumnEncryptionKeyStoreProvider { String name = "MSSQL_JAVA_KEYSTORE"; @@ -66,6 +71,12 @@ public String getName() return this.name; } + /** + * Key store provider for the Java Key Store. + * @param keyStoreLocation specifies the location of the keystore + * @param keyStoreSecret specifies the secret used for keystore + * @throws SQLServerException when an error occurs + */ public SQLServerColumnEncryptionJavaKeyStoreProvider(String keyStoreLocation, char[] keyStoreSecret) throws SQLServerException { javaKeyStoreLogger.entering(SQLServerColumnEncryptionJavaKeyStoreProvider.class.getName(), "SQLServerColumnEncryptionJavaKeyStoreProvider"); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionKeyStoreProvider.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionKeyStoreProvider.java index aa1ed747b..094b93132 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionKeyStoreProvider.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionKeyStoreProvider.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -19,11 +19,44 @@ package com.microsoft.sqlserver.jdbc; +/** + * + * Extend this class to implement a custom key store provider. + * + */ public abstract class SQLServerColumnEncryptionKeyStoreProvider { + /** + * Sets the name of this key store provider. + * @param name value to be set for the key store provider. + */ public abstract void setName(String name); + + /** + * Retrieves the name of this key store provider. + * @return the name of this key store provider. + */ public abstract String getName(); + + /** + * Base class method for decrypting the specified encrypted value of a column encryption key. + * The encrypted value is expected to be encrypted using the column master key with the specified key path and using the specified algorithm. + * @param masterKeyPath The column master key path. + * @param encryptionAlgorithm the specific encryption algorithm. + * @param encryptedColumnEncryptionKey the encrypted column encryption key + * @return the decrypted value of column encryption key. + * @throws SQLServerException when an error occurs while decrypting the CEK + */ public abstract byte [] decryptColumnEncryptionKey(String masterKeyPath,String encryptionAlgorithm,byte [] encryptedColumnEncryptionKey) throws SQLServerException; + + /** + * Base class method for encrypting a column encryption key using the column master key with the specified key path and using the specified algorithm. + * @param masterKeyPath The column master key path. + * @param encryptionAlgorithm the specific encryption algorithm. + * @param columnEncryptionKey column encryption key to be encrypted. + * @return the encrypted column encryption key. + * @throws SQLServerException when an error occurs while encrypting the CEK + */ public abstract byte [] encryptColumnEncryptionKey(String masterKeyPath,String encryptionAlgorithm,byte [] columnEncryptionKey) throws SQLServerException; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java index 2c855c958..d7a9b4e5b 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -38,23 +38,22 @@ * SQLServerConnection implements a JDBC connection to SQL Server. * SQLServerConnections support JDBC connection pooling and may be either physical JDBC connections * or logical JDBC connections. - *

  • + *

    * SQLServerConnection manages transaction control for all statements that were created from it. * SQLServerConnection may participate in XA distributed transactions managed via an XAResource adapter. - *

  • + *

    * SQLServerConnection instantiates a new TDSChannel object for use by itself and all statement objects that * are created under this connection. SQLServerConnection is thread safe. - *

  • + *

    * SQLServerConnection manages a pool of prepared statement handles. Prepared statements are prepared * once and typically executed many times with different data values for their parameters. * Prepared statements are also maintained across logical (pooled) connection closes. - *

  • + *

    * SQLServerConnection is not thread safe, however multiple statements created from a single * connection can be processing simultaneously in concurrent threads. - *

  • - *
  • + *

    * This class's public functions need to be kept identical to the SQLServerConnectionPoolProxy's. - *

  • + *

    * The API javadoc for JDBC API methods that this class implements are not repeated here. Please * see Sun's JDBC API interfaces javadoc for those details. */ @@ -223,6 +222,10 @@ final ApplicationIntent getApplicationIntent() private boolean sendTimeAsDatetime = SQLServerDriverBooleanProperty.SEND_TIME_AS_DATETIME.getDefaultValue(); + /** + * Checks the sendTimeAsDatetime property. + * @return boolean value of sendTimeAsDatetime + */ public synchronized final boolean getSendTimeAsDatetime() { return !isKatmaiOrLater() || sendTimeAsDatetime; @@ -289,6 +292,11 @@ boolean getServerSupportsColumnEncryption() { Map systemColumnEncryptionKeyStoreProvider = new HashMap(); + /** + * Registers key store providers in the globalCustomColumnEncryptionKeyStoreProviders. + * @param clientKeyStoreProviders a map containing the store providers information. + * @throws SQLServerException when an error occurs + */ public static synchronized void registerColumnEncryptionKeyStoreProviders( Map clientKeyStoreProviders) throws SQLServerException { @@ -389,6 +397,10 @@ synchronized SQLServerColumnEncryptionKeyStoreProvider getSystemColumnEncryption private String trustedServerNameAE = null; private static Map> columnEncryptionTrustedMasterKeyPaths=new HashMap>(); + /** + * Sets Trusted Master Key Paths in the columnEncryptionTrustedMasterKeyPaths. + * @param trustedKeyPaths all master key paths that are trusted + */ public static synchronized void setColumnEncryptionTrustedMasterKeyPaths(Map> trustedKeyPaths) { loggerExternal.entering(SQLServerConnection.class.getName(), "setColumnEncryptionTrustedMasterKeyPaths", "Setting Trusted Master Key Paths"); @@ -403,6 +415,11 @@ public static synchronized void setColumnEncryptionTrustedMasterKeyPaths(Map trustedKeyPaths) { loggerExternal.entering(SQLServerConnection.class.getName(), "updateColumnEncryptionTrustedMasterKeyPaths", "Updating Trusted Master Key Paths"); @@ -413,6 +430,10 @@ public static synchronized void updateColumnEncryptionTrustedMasterKeyPaths(Stri loggerExternal.exiting(SQLServerConnection.class.getName(), "updateColumnEncryptionTrustedMasterKeyPaths", "Number of Trusted Master Key Paths: " + columnEncryptionTrustedMasterKeyPaths.size()); } + /** + * Removes the trusted Master key Path from the columnEncryptionTrustedMasterKeyPaths. + * @param server String server name + */ public static synchronized void removeColumnEncryptionTrustedMasterKeyPaths(String server) { loggerExternal.entering(SQLServerConnection.class.getName(), "removeColumnEncryptionTrustedMasterKeyPaths", "Removing Trusted Master Key Paths"); @@ -423,6 +444,10 @@ public static synchronized void removeColumnEncryptionTrustedMasterKeyPaths(Stri loggerExternal.exiting(SQLServerConnection.class.getName(), "removeColumnEncryptionTrustedMasterKeyPaths", "Number of Trusted Master Key Paths: " + columnEncryptionTrustedMasterKeyPaths.size()); } + /** + * Retrieves the Trusted Master Key Paths. + * @return columnEncryptionTrustedMasterKeyPaths. + */ public static synchronized Map> getColumnEncryptionTrustedMasterKeyPaths() { loggerExternal.entering(SQLServerConnection.class.getName(), "getColumnEncryptionTrustedMasterKeyPaths", "Getting Trusted Master Key Paths"); @@ -601,6 +626,10 @@ int getServerMajorVersion(){ private UUID clientConnectionId = null; + /** + * Retrieves the clientConnectionID. + * @throws SQLServerException when an error occurs + */ public UUID getClientConnectionId() throws SQLServerException { // If the connection is closed, we do not allow external application to get @@ -4426,9 +4455,9 @@ private void checkValidHoldability(int holdability) throws SQLServerException * to check the holdability of ResultSets that would be created, and/or * ResultSet.getHoldability to check the holdability of an existing ResultSet. */ - private void checkMatchesCurrentHoldability(int statementHoldability) throws SQLServerException + private void checkMatchesCurrentHoldability(int resultSetHoldability) throws SQLServerException { - if (statementHoldability != this.holdability) + if (resultSetHoldability != this.holdability) { SQLServerException.makeFromDriverError( this, this, @@ -4437,44 +4466,79 @@ private void checkMatchesCurrentHoldability(int statementHoldability) throws SQL } } - public Statement createStatement(int nType, int nConcur, int statementHoldability) throws SQLServerException + public Statement createStatement(int nType, int nConcur, int resultSetHoldability) throws SQLServerException { - loggerExternal.entering(getClassNameLogging(), "createStatement", new Object[]{new Integer(nType), new Integer(nConcur), statementHoldability}); - Statement st = createStatement(nType, nConcur, statementHoldability, SQLServerStatementColumnEncryptionSetting.UseConnectionSetting); + loggerExternal.entering(getClassNameLogging(), "createStatement", new Object[]{new Integer(nType), new Integer(nConcur), resultSetHoldability}); + Statement st = createStatement(nType, nConcur, resultSetHoldability, SQLServerStatementColumnEncryptionSetting.UseConnectionSetting); loggerExternal.exiting(getClassNameLogging(), "createStatement", st); return st; } - public Statement createStatement(int nType, int nConcur, int statementHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException + public Statement createStatement(int nType, int nConcur, int resultSetHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { - loggerExternal.entering(getClassNameLogging(), "createStatement", new Object[]{new Integer(nType), new Integer(nConcur), statementHoldability, stmtColEncSetting}); + loggerExternal.entering(getClassNameLogging(), "createStatement", new Object[]{new Integer(nType), new Integer(nConcur), resultSetHoldability, stmtColEncSetting}); checkClosed(); - checkValidHoldability(statementHoldability); - checkMatchesCurrentHoldability(statementHoldability); + checkValidHoldability(resultSetHoldability); + checkMatchesCurrentHoldability(resultSetHoldability); Statement st = new SQLServerStatement(this, nType, nConcur, stmtColEncSetting); loggerExternal.exiting(getClassNameLogging(), "createStatement", st); return st; } - /*L3*/ public PreparedStatement prepareStatement(java.lang.String sql, int nType, int nConcur, int statementHoldability) throws SQLServerException + /*L3*/ public PreparedStatement prepareStatement(java.lang.String sql, int nType, int nConcur, int resultSetHoldability) throws SQLServerException { - loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), statementHoldability}); + loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), resultSetHoldability}); PreparedStatement st = prepareStatement( sql, nType, nConcur, - statementHoldability, + resultSetHoldability, SQLServerStatementColumnEncryptionSetting.UseConnectionSetting); loggerExternal.exiting(getClassNameLogging(), "prepareStatement", st); return st; } - public PreparedStatement prepareStatement(java.lang.String sql, int nType, int nConcur, int statementHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException + /** + * Creates a PreparedStatement object that will generate + * ResultSet objects with the given type, concurrency, + * and holdability. + *

    + * This method is the same as the prepareStatement method + * above, but it allows the default result set + * type, concurrency, and holdability to be overridden. + * + * @param sql a String object that is the SQL statement to + * be sent to the database; may contain one or more '?' IN + * parameters + * @param nType one of the following ResultSet + * constants: + * ResultSet.TYPE_FORWARD_ONLY, + * ResultSet.TYPE_SCROLL_INSENSITIVE, or + * ResultSet.TYPE_SCROLL_SENSITIVE + * @param nConcur one of the following ResultSet + * constants: + * ResultSet.CONCUR_READ_ONLY or + * ResultSet.CONCUR_UPDATABLE + * @param resultSetHoldability one of the following ResultSet + * constants: + * ResultSet.HOLD_CURSORS_OVER_COMMIT or + * ResultSet.CLOSE_CURSORS_AT_COMMIT + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled SQL statement, that will generate + * ResultSet objects with the given type, + * concurrency, and holdability + * @throws SQLServerException if a database access error occurs, this + * method is called on a closed connection + * or the given parameters are not ResultSet + * constants indicating type, concurrency, and holdability + */ + public PreparedStatement prepareStatement(java.lang.String sql, int nType, int nConcur, int resultSetHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { - loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), statementHoldability, stmtColEncSetting}); + loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), resultSetHoldability, stmtColEncSetting}); checkClosed(); - checkValidHoldability(statementHoldability); - checkMatchesCurrentHoldability(statementHoldability); + checkValidHoldability(resultSetHoldability); + checkMatchesCurrentHoldability(resultSetHoldability); PreparedStatement st = null; @@ -4499,20 +4563,20 @@ public PreparedStatement prepareStatement(java.lang.String sql, int nType, int n return st; } - /*L3*/ public CallableStatement prepareCall(String sql, int nType, int nConcur, int statementHoldability) throws SQLServerException + /*L3*/ public CallableStatement prepareCall(String sql, int nType, int nConcur, int resultSetHoldability) throws SQLServerException { - loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), statementHoldability}); - CallableStatement st = prepareCall(sql, nType, nConcur, statementHoldability, SQLServerStatementColumnEncryptionSetting.UseConnectionSetting); + loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), resultSetHoldability}); + CallableStatement st = prepareCall(sql, nType, nConcur, resultSetHoldability, SQLServerStatementColumnEncryptionSetting.UseConnectionSetting); loggerExternal.exiting(getClassNameLogging(), "prepareCall", st); return st; } - public CallableStatement prepareCall(String sql, int nType, int nConcur, int statementHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetiing) throws SQLServerException + public CallableStatement prepareCall(String sql, int nType, int nConcur, int resultSetHoldability, SQLServerStatementColumnEncryptionSetting stmtColEncSetiing) throws SQLServerException { - loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), statementHoldability, stmtColEncSetiing}); + loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{new Integer(nType), new Integer(nConcur), resultSetHoldability, stmtColEncSetiing}); checkClosed(); - checkValidHoldability(statementHoldability); - checkMatchesCurrentHoldability(statementHoldability); + checkValidHoldability(resultSetHoldability); + checkMatchesCurrentHoldability(resultSetHoldability); CallableStatement st = null; @@ -4549,6 +4613,46 @@ public CallableStatement prepareCall(String sql, int nType, int nConcur, int sta return ps; } + /** + * Creates a default PreparedStatement object that has + * the capability to retrieve auto-generated keys. The given constant + * tells the driver whether it should make auto-generated keys + * available for retrieval. This parameter is ignored if the SQL statement + * is not an INSERT statement, or an SQL statement able to return + * auto-generated keys (the list of such statements is vendor-specific). + *

    + * Note: This method is optimized for handling + * parametric SQL statements that benefit from precompilation. If + * the driver supports precompilation, + * the method prepareStatement will send + * the statement to the database for precompilation. Some drivers + * may not support precompilation. In this case, the statement may + * not be sent to the database until the PreparedStatement + * object is executed. This has no direct effect on users; however, it does + * affect which methods throw certain SQLExceptions. + *

    + * Result sets created using the returned PreparedStatement + * object will by default be type TYPE_FORWARD_ONLY + * and have a concurrency level of CONCUR_READ_ONLY. + * The holdability of the created result sets can be determined by + * calling {@link #getHoldability}. + * + * @param sql an SQL statement that may contain one or more '?' IN + * parameter placeholders + * @param flag a flag indicating whether auto-generated keys + * should be returned; one of + * Statement.RETURN_GENERATED_KEYS or + * Statement.NO_GENERATED_KEYS + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled SQL statement, that will have the capability of + * returning auto-generated keys + * @throws SQLServerException if a database access error occurs, this + * method is called on a closed connection + * or the given parameter is not a Statement + * constant indicating whether auto-generated keys should be + * returned + */ public PreparedStatement prepareStatement(String sql, int flag, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{sql, new Integer(flag), stmtColEncSetting}); @@ -4568,6 +4672,48 @@ public PreparedStatement prepareStatement(String sql, int flag, SQLServerStateme return ps; } + /** + * Creates a default PreparedStatement object capable + * of returning the auto-generated keys designated by the given array. + * This array contains the indexes of the columns in the target + * table that contain the auto-generated keys that should be made + * available. The driver will ignore the array if the SQL statement + * is not an INSERT statement, or an SQL statement able to return + * auto-generated keys (the list of such statements is vendor-specific). + *

    + * An SQL statement with or without IN parameters can be + * pre-compiled and stored in a PreparedStatement object. This + * object can then be used to efficiently execute this statement + * multiple times. + *

    + * Note: This method is optimized for handling + * parametric SQL statements that benefit from precompilation. If + * the driver supports precompilation, + * the method prepareStatement will send + * the statement to the database for precompilation. Some drivers + * may not support precompilation. In this case, the statement may + * not be sent to the database until the PreparedStatement + * object is executed. This has no direct effect on users; however, it does + * affect which methods throw certain SQLExceptions. + *

    + * Result sets created using the returned PreparedStatement + * object will by default be type TYPE_FORWARD_ONLY + * and have a concurrency level of CONCUR_READ_ONLY. + * The holdability of the created result sets can be determined by + * calling {@link #getHoldability}. + * + * @param sql an SQL statement that may contain one or more '?' IN + * parameter placeholders + * @param columnIndexes an array of column indexes indicating the columns + * that should be returned from the inserted row or rows + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled statement, that is capable of returning the + * auto-generated keys designated by the given array of column + * indexes + * @throws SQLServerException if a database access error occurs + * or this method is called on a closed connection + */ public PreparedStatement prepareStatement(String sql, int[] columnIndexes, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{sql, columnIndexes, stmtColEncSetting}); @@ -4593,6 +4739,48 @@ public PreparedStatement prepareStatement(String sql, int[] columnIndexes, SQLSe return ps; } + /** + * Creates a default PreparedStatement object capable + * of returning the auto-generated keys designated by the given array. + * This array contains the names of the columns in the target + * table that contain the auto-generated keys that should be returned. + * The driver will ignore the array if the SQL statement + * is not an INSERT statement, or an SQL statement able to return + * auto-generated keys (the list of such statements is vendor-specific). + *

    + * An SQL statement with or without IN parameters can be + * pre-compiled and stored in a PreparedStatement object. This + * object can then be used to efficiently execute this statement + * multiple times. + *

    + * Note: This method is optimized for handling + * parametric SQL statements that benefit from precompilation. If + * the driver supports precompilation, + * the method prepareStatement will send + * the statement to the database for precompilation. Some drivers + * may not support precompilation. In this case, the statement may + * not be sent to the database until the PreparedStatement + * object is executed. This has no direct effect on users; however, it does + * affect which methods throw certain SQLExceptions. + *

    + * Result sets created using the returned PreparedStatement + * object will by default be type TYPE_FORWARD_ONLY + * and have a concurrency level of CONCUR_READ_ONLY. + * The holdability of the created result sets can be determined by + * calling {@link #getHoldability}. + * + * @param sql an SQL statement that may contain one or more '?' IN + * parameter placeholders + * @param columnNames an array of column names indicating the columns + * that should be returned from the inserted row or rows + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled statement, that is capable of returning the + * auto-generated keys designated by the given array of column + * names + * @throws SQLServerException if a database access error occurs + * or this method is called on a closed connection + */ public PreparedStatement prepareStatement(String sql, String[] columnNames, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "prepareStatement", new Object[]{sql, columnNames, stmtColEncSetting}); @@ -4812,6 +5000,16 @@ public void setSchema(String schema) throws SQLException loggerExternal.exiting(getClassNameLogging(), "setSchema"); } + /** + * Modifies the setting of the sendTimeAsDatetime connection property. + * When true, java.sql.Time values will be sent to the server as SQL Serverdatetime values. + * When false, java.sql.Time values will be sent to the server as SQL Servertime values. + * sendTimeAsDatetime can also be modified programmatically with SQLServerDataSource.setSendTimeAsDatetime. + * The default value for this property may change in a future release. + * @param sendTimeAsDateTimeValue enables/disables setting the sendTimeAsDatetime connection property. + * For more information about how the Microsoft JDBC Driver for SQL Server configures java.sql.Time values before sending + * them to the server, see Configuring How java.sql.Time Values are Sent to the Server. + */ public synchronized void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) { sendTimeAsDatetime = sendTimeAsDateTimeValue; @@ -5303,6 +5501,13 @@ void doSecurityCheck() // This variable holds the value in seconds. private static long columnEncryptionKeyCacheTtl = TimeUnit.SECONDS.convert(2, TimeUnit.HOURS); + /** + * Sets time-to-live for column encryption key entries in the column encryption key cache for the Always Encrypted feature. + * The default value is 2 hours. This variable holds the value in seconds. + * @param columnEncryptionKeyCacheTTL The timeunit in seconds + * @param unit The Timeunit. + * @throws SQLServerException when an error occurs + */ public static synchronized void setColumnEncryptionKeyCacheTtl (int columnEncryptionKeyCacheTTL, TimeUnit unit) throws SQLServerException { if (columnEncryptionKeyCacheTTL < 0 || unit.equals(TimeUnit.MILLISECONDS ) || unit.equals(TimeUnit.MICROSECONDS) || unit.equals(TimeUnit.NANOSECONDS ) ) @@ -5331,8 +5536,11 @@ final class SQLServerConnectionSecurityManager this.serverName = serverName; this.portNumber = portNumber; } - // checkConnect will throws a SecurityException if the calling thread is not - // allowed to open a socket connection to the specified serverName and portNumber. + + /** + * checkConnect will throws a SecurityException if the calling thread is not allowed to open a socket connection to the specified serverName and portNumber. + * @throws SecurityException when an error occurs + */ public void checkConnect() throws SecurityException { SecurityManager security = System.getSecurityManager(); @@ -5341,6 +5549,12 @@ public void checkConnect() throws SecurityException security.checkConnect(serverName, portNumber); } } + + /** + * Throws a SecurityException if the + * calling thread is not allowed to dynamic link the library code. + * @throws SecurityException when an error occurs + */ public void checkLink() throws SecurityException { SecurityManager security = System.getSecurityManager(); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolDataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolDataSource.java index 32cf12b21..d5c174291 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolDataSource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolDataSource.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolProxy.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolProxy.java index 0655caade..58464dc02 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolProxy.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolProxy.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -27,23 +27,24 @@ /** * SQLServerConnectionPoolProxy is a wrapper around SQLServerConnection object. * When returning a connection object from PooledConnection.getConnection we returnt this proxy per SPEC. -*

  • +*

    * This class's public functions need to be kept identical to the SQLServerConnection's. -*

  • +*

    * The API javadoc for JDBC API methods that this class implements are not repeated here. Please * see Sun's JDBC API interfaces javadoc for those details. */ class SQLServerConnectionPoolProxy implements ISQLServerConnection, java.io.Serializable { - private SQLServerConnection wrappedConnection; - private boolean bIsOpen; - static private int baseConnectionID=0; //connection id dispenser - final private String traceID ; + private static final long serialVersionUID = -6412542417798843534L; + private SQLServerConnection wrappedConnection; + private boolean bIsOpen; + static private int baseConnectionID=0; //connection id dispenser + final private String traceID ; - // Permission targets - // currently only callAbort is implemented - private static final String callAbortPerm = "callAbort"; + // Permission targets + // currently only callAbort is implemented + private static final String callAbortPerm = "callAbort"; /** * Generate the next unique connection id. @@ -302,6 +303,39 @@ public java.util.Map> getTypeMap() throws SQLServerException return wrappedConnection.createStatement(nType, nConcur, nHold); } + /** + * Creates a Statement object that will generate + * ResultSet objects with the given type, concurrency, + * and holdability. + * This method is the same as the createStatement method + * above, but it allows the default result set + * type, concurrency, and holdability to be overridden. + * + * @param nType one of the following ResultSet + * constants: + * ResultSet.TYPE_FORWARD_ONLY, + * ResultSet.TYPE_SCROLL_INSENSITIVE, or + * ResultSet.TYPE_SCROLL_SENSITIVE + * @param nConcur one of the following ResultSet + * constants: + * ResultSet.CONCUR_READ_ONLY or + * ResultSet.CONCUR_UPDATABLE + * @param nHold one of the following ResultSet + * constants: + * ResultSet.HOLD_CURSORS_OVER_COMMIT or + * ResultSet.CLOSE_CURSORS_AT_COMMIT + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new Statement object that will generate + * ResultSet objects with the given type, + * concurrency, and holdability + * @exception SQLException if a database access error occurs, this + * method is called on a closed connection + * or the given parameters are not ResultSet + * constants indicating type, concurrency, and holdability + * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * this method or this method is not supported for the specified result + * set type, result set holdability and result set concurrency. + */ public Statement createStatement( int nType, int nConcur, @@ -319,6 +353,44 @@ public Statement createStatement( return wrappedConnection.prepareStatement(sql, nType, nConcur, nHold); } + /** + * Creates a PreparedStatement object that will generate + * ResultSet objects with the given type, concurrency, + * and holdability. + *

    + * This method is the same as the prepareStatement method + * above, but it allows the default result set + * type, concurrency, and holdability to be overridden. + * + * @param sql a String object that is the SQL statement to + * be sent to the database; may contain one or more '?' IN + * parameters + * @param nType one of the following ResultSet + * constants: + * ResultSet.TYPE_FORWARD_ONLY, + * ResultSet.TYPE_SCROLL_INSENSITIVE, or + * ResultSet.TYPE_SCROLL_SENSITIVE + * @param nConcur one of the following ResultSet + * constants: + * ResultSet.CONCUR_READ_ONLY or + * ResultSet.CONCUR_UPDATABLE + * @param nHold one of the following ResultSet + * constants: + * ResultSet.HOLD_CURSORS_OVER_COMMIT or + * ResultSet.CLOSE_CURSORS_AT_COMMIT + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled SQL statement, that will generate + * ResultSet objects with the given type, + * concurrency, and holdability + * @exception SQLException if a database access error occurs, this + * method is called on a closed connection + * or the given parameters are not ResultSet + * constants indicating type, concurrency, and holdability + * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * this method or this method is not supported for the specified result + * set type, result set holdability and result set concurrency. + */ public PreparedStatement prepareStatement( String sql, int nType, @@ -336,8 +408,43 @@ public PreparedStatement prepareStatement( checkClosed(); return wrappedConnection.prepareCall(sql, nType, nConcur, nHold); } - - public CallableStatement prepareCall( + + /** + * Creates a CallableStatement object that will generate + * ResultSet objects with the given type and concurrency. + * This method is the same as the prepareCall method + * above, but it allows the default result set + * type, result set concurrency type and holdability to be overridden. + * + * @param sql a String object that is the SQL statement to + * be sent to the database; may contain on or more '?' parameters + * @param nType one of the following ResultSet + * constants: + * ResultSet.TYPE_FORWARD_ONLY, + * ResultSet.TYPE_SCROLL_INSENSITIVE, or + * ResultSet.TYPE_SCROLL_SENSITIVE + * @param nConcur one of the following ResultSet + * constants: + * ResultSet.CONCUR_READ_ONLY or + * ResultSet.CONCUR_UPDATABLE + * @param nHold one of the following ResultSet + * constants: + * ResultSet.HOLD_CURSORS_OVER_COMMIT or + * ResultSet.CLOSE_CURSORS_AT_COMMIT + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new CallableStatement object, containing the + * pre-compiled SQL statement, that will generate + * ResultSet objects with the given type, + * concurrency, and holdability + * @exception SQLException if a database access error occurs, this + * method is called on a closed connection + * or the given parameters are not ResultSet + * constants indicating type, concurrency, and holdability + * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * this method or this method is not supported for the specified result + * set type, result set holdability and result set concurrency. + */ + public CallableStatement prepareCall( String sql, int nType, int nConcur, @@ -356,7 +463,49 @@ public CallableStatement prepareCall( checkClosed(); return wrappedConnection.prepareStatement(sql, flag); } - + + /** + * Creates a default PreparedStatement object that has + * the capability to retrieve auto-generated keys. The given constant + * tells the driver whether it should make auto-generated keys + * available for retrieval. This parameter is ignored if the SQL statement + * is not an INSERT statement, or an SQL statement able to return + * auto-generated keys (the list of such statements is vendor-specific). + *

    + * Note: This method is optimized for handling + * parametric SQL statements that benefit from precompilation. If + * the driver supports precompilation, + * the method prepareStatement will send + * the statement to the database for precompilation. Some drivers + * may not support precompilation. In this case, the statement may + * not be sent to the database until the PreparedStatement + * object is executed. This has no direct effect on users; however, it does + * affect which methods throw certain SQLExceptions. + *

    + * Result sets created using the returned PreparedStatement + * object will by default be type TYPE_FORWARD_ONLY + * and have a concurrency level of CONCUR_READ_ONLY. + * The holdability of the created result sets can be determined by + * calling {@link #getHoldability}. + * + * @param sql an SQL statement that may contain one or more '?' IN + * parameter placeholders + * @param flag a flag indicating whether auto-generated keys + * should be returned; one of + * Statement.RETURN_GENERATED_KEYS or + * Statement.NO_GENERATED_KEYS + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled SQL statement, that will have the capability of + * returning auto-generated keys + * @exception SQLException if a database access error occurs, this + * method is called on a closed connection + * or the given parameter is not a Statement + * constant indicating whether auto-generated keys should be + * returned + * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * this method with a constant of Statement.RETURN_GENERATED_KEYS + */ public PreparedStatement prepareStatement(String sql, int flag, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { checkClosed(); @@ -369,6 +518,50 @@ public PreparedStatement prepareStatement(String sql, int flag, SQLServerStateme return wrappedConnection.prepareStatement(sql, columnIndexes); } + /** + * Creates a default PreparedStatement object capable + * of returning the auto-generated keys designated by the given array. + * This array contains the indexes of the columns in the target + * table that contain the auto-generated keys that should be made + * available. The driver will ignore the array if the SQL statement + * is not an INSERT statement, or an SQL statement able to return + * auto-generated keys (the list of such statements is vendor-specific). + *

    + * An SQL statement with or without IN parameters can be + * pre-compiled and stored in a PreparedStatement object. This + * object can then be used to efficiently execute this statement + * multiple times. + *

    + * Note: This method is optimized for handling + * parametric SQL statements that benefit from precompilation. If + * the driver supports precompilation, + * the method prepareStatement will send + * the statement to the database for precompilation. Some drivers + * may not support precompilation. In this case, the statement may + * not be sent to the database until the PreparedStatement + * object is executed. This has no direct effect on users; however, it does + * affect which methods throw certain SQLExceptions. + *

    + * Result sets created using the returned PreparedStatement + * object will by default be type TYPE_FORWARD_ONLY + * and have a concurrency level of CONCUR_READ_ONLY. + * The holdability of the created result sets can be determined by + * calling {@link #getHoldability}. + * + * @param sql an SQL statement that may contain one or more '?' IN + * parameter placeholders + * @param columnIndexes an array of column indexes indicating the columns + * that should be returned from the inserted row or rows + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled statement, that is capable of returning the + * auto-generated keys designated by the given array of column + * indexes + * @exception SQLException if a database access error occurs + * or this method is called on a closed connection + * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * this method + */ public PreparedStatement prepareStatement(String sql, int[] columnIndexes, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { checkClosed(); @@ -381,6 +574,50 @@ public PreparedStatement prepareStatement(String sql, int[] columnIndexes, SQLSe return wrappedConnection.prepareStatement(sql, columnNames); } + /** + * Creates a default PreparedStatement object capable + * of returning the auto-generated keys designated by the given array. + * This array contains the names of the columns in the target + * table that contain the auto-generated keys that should be returned. + * The driver will ignore the array if the SQL statement + * is not an INSERT statement, or an SQL statement able to return + * auto-generated keys (the list of such statements is vendor-specific). + *

    + * An SQL statement with or without IN parameters can be + * pre-compiled and stored in a PreparedStatement object. This + * object can then be used to efficiently execute this statement + * multiple times. + *

    + * Note: This method is optimized for handling + * parametric SQL statements that benefit from precompilation. If + * the driver supports precompilation, + * the method prepareStatement will send + * the statement to the database for precompilation. Some drivers + * may not support precompilation. In this case, the statement may + * not be sent to the database until the PreparedStatement + * object is executed. This has no direct effect on users; however, it does + * affect which methods throw certain SQLExceptions. + *

    + * Result sets created using the returned PreparedStatement + * object will by default be type TYPE_FORWARD_ONLY + * and have a concurrency level of CONCUR_READ_ONLY. + * The holdability of the created result sets can be determined by + * calling {@link #getHoldability}. + * + * @param sql an SQL statement that may contain one or more '?' IN + * parameter placeholders + * @param columnNames an array of column names indicating the columns + * that should be returned from the inserted row or rows + * @param stmtColEncSetting Specifies how data will be sent and received when reading and writing encrypted columns. + * @return a new PreparedStatement object, containing the + * pre-compiled statement, that is capable of returning the + * auto-generated keys designated by the given array of column + * names + * @exception SQLException if a database access error occurs + * or this method is called on a closed connection + * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * this method + */ public PreparedStatement prepareStatement(String sql, String[] columnNames, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException { checkClosed(); @@ -579,12 +816,27 @@ public UUID getClientConnectionId() throws SQLServerException return wrappedConnection.getClientConnectionId(); } + /** + * Modifies the setting of the sendTimeAsDatetime connection property. + * When true, java.sql.Time values will be sent to the server as SQL Serverdatetime values. + * When false, java.sql.Time values will be sent to the server as SQL Servertime values. + * sendTimeAsDatetime can also be modified programmatically with SQLServerDataSource.setSendTimeAsDatetime. + * The default value for this property may change in a future release. + * @param sendTimeAsDateTimeValue enables/disables setting the sendTimeAsDatetime connection property. + * For more information about how the Microsoft JDBC Driver for SQL Server configures java.sql.Time values before sending + * them to the server, see Configuring How java.sql.Time Values are Sent to the Server. + */ public synchronized void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) throws SQLServerException { checkClosed(); wrappedConnection.setSendTimeAsDatetime(sendTimeAsDateTimeValue); } + /** + * Returns the setting of the sendTimeAsDatetime connection property. + * @return if enabled, returns true. Otherwise, false. + * @throws SQLServerException when an error occurs. + */ public synchronized final boolean getSendTimeAsDatetime() throws SQLServerException { checkClosed(); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataColumn.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataColumn.java index 9beb03a09..a665901a3 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataColumn.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataColumn.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -27,6 +27,9 @@ import java.text.MessageFormat; import java.util.Map.Entry; +/** + * This class represents a column of the in-memory data table represented by SQLServerDataTable. + */ public final class SQLServerDataColumn { String columnName; @@ -34,17 +37,30 @@ public final class SQLServerDataColumn int precision = 0; int scale = 0; + /** + * Initializes a new instance of SQLServerDataColumn with the column name and type. + * @param columnName the name of the column + * @param sqlType the type of the column + */ public SQLServerDataColumn(String columnName, int sqlType) { this.columnName = columnName; this.javaSqlType = sqlType; } + /** + * Retrieves the column name. + * @return the name of the column. + */ public String getColumnName() { return columnName; } + /** + * Retrieves the column type. + * @return the column type. + */ public int getColumnType() { return javaSqlType; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java index f379a43d1..cd0d34173 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -47,6 +47,9 @@ public class SQLServerDataSource implements ISQLServerDataSource, DataSource, ja static private int baseDataSourceID = 0; // Unique id generator for each DataSource instance (used for logging). final private String traceID; + /** + * Initializes a new instance of the SQLServerDataSource class. + */ public SQLServerDataSource() { connectionProps = new Properties(); @@ -166,20 +169,36 @@ public void setAuthenticationScheme(String authenticationScheme) setStringProperty(connectionProps, SQLServerDriverStringProperty.AUTHENTICATION_SCHEME.toString(), authenticationScheme); } + /** + * sets the authentication mode + * @param authentication the authentication mode + */ public void setAuthentication(String authentication) { setStringProperty(connectionProps, SQLServerDriverStringProperty.AUTHENTICATION.toString(), authentication); } + /** + * Retrieves the authentication mode + * @return the authentication value + */ public String getAuthentication(){ return getStringProperty(connectionProps, SQLServerDriverStringProperty.AUTHENTICATION.toString(), SQLServerDriverStringProperty.AUTHENTICATION.getDefaultValue()); } + /** + * Sets the access token. + * @param accessToken to be set in the string property. + */ public void setAccessToken(String accessToken) { setStringProperty(connectionProps, SQLServerDriverStringProperty.ACCESS_TOKEN.toString(), accessToken); } + /** + * Retrieves the access token. + * @return the access token. + */ public String getAccessToken(){ return getStringProperty(connectionProps, SQLServerDriverStringProperty.ACCESS_TOKEN.toString(), null); } @@ -188,34 +207,66 @@ public String getAccessToken(){ // count from all the update counts returned by a batch. The default of false will // return all update counts. If lastUpdateCount is not set, getLastUpdateCount // returns the default value of false. - + /** + * Enables/disables Always Encrypted functionality for the data source object. The default is Disabled. + * @param columnEncryptionSetting Enables/disables Always Encrypted functionality for the data source object. The default is Disabled. + */ public void setColumnEncryptionSetting(String columnEncryptionSetting) { setStringProperty(connectionProps, SQLServerDriverStringProperty.COLUMN_ENCRYPTION.toString(), columnEncryptionSetting); } + + /** + * Retrieves the Always Encrypted functionality setting for the data source object. + * @return the Always Encrypted functionality setting for the data source object. + */ public String getColumnEncryptionSetting() { return getStringProperty(connectionProps, SQLServerDriverStringProperty.COLUMN_ENCRYPTION.toString(), SQLServerDriverStringProperty.COLUMN_ENCRYPTION.getDefaultValue()); } + /** + * Sets the name that identifies a key store. Only value supported is the "JavaKeyStorePassword" for identifying the Java Key Store. + * The default is null. + * @param keyStoreAuthentication the name that identifies a key store. + */ public void setKeyStoreAuthentication(String keyStoreAuthentication) { setStringProperty(connectionProps, SQLServerDriverStringProperty.KEY_STORE_AUTHENTICATION.toString(), keyStoreAuthentication); } + + /** + * Gets the value of the keyStoreAuthentication setting for the data source object. + * @return the value of the keyStoreAuthentication setting for the data source object. + */ public String getKeyStoreAuthentication() { return getStringProperty(connectionProps, SQLServerDriverStringProperty.KEY_STORE_AUTHENTICATION.toString(), SQLServerDriverStringProperty.KEY_STORE_AUTHENTICATION.getDefaultValue()); } + /** + * Sets the password for the Java keystore. Note that, for Java Key Store provider the password for the keystore and the key must be the same. + * Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword". + * @param keyStoreSecret the password to use for the keystore as well as for the key + */ public void setKeyStoreSecret(String keyStoreSecret) { setStringProperty(connectionProps, SQLServerDriverStringProperty.KEY_STORE_SECRET.toString(), keyStoreSecret); } + /** + * Sets the location including the file name for the Java keystore. Note that, keyStoreAuthentication must be set with "JavaKeyStorePassword". + * @param keyStoreLocation the location including the file name for the Java keystore. + */ public void setKeyStoreLocation(String keyStoreLocation) { setStringProperty(connectionProps, SQLServerDriverStringProperty.KEY_STORE_LOCATION.toString(), keyStoreLocation); } + + /** + * Retrieves the keyStoreLocation for the Java Key Store. + * @return the keyStoreLocation for the Java Key Store. + */ public String getKeyStoreLocation() { return getStringProperty(connectionProps, SQLServerDriverStringProperty.KEY_STORE_LOCATION.toString(), SQLServerDriverStringProperty.KEY_STORE_LOCATION.getDefaultValue()); @@ -240,10 +291,29 @@ public boolean getEncrypt() return getBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.ENCRYPT.toString(), SQLServerDriverBooleanProperty.ENCRYPT.getDefaultValue()); } + /** + * Beginning in version 6.0 of the Microsoft JDBC Driver for SQL Server, a new connection property transparentNetworkIPResolution + * (TNIR) is added for transparent connection to Always On availability groups or to a server which has multiple IP addresses + * associated. When transparentNetworkIPResolution is true, the driver attempts to connect to the first IP address available. + * If the first attempt fails, the driver tries to connect to all IP addresses in parallel until the timeout expires, discarding + * any pending connection attempts when one of them succeeds. + *

    + * transparentNetworkIPResolution is ignored if multiSubnetFailover is true + *

    + * transparentNetworkIPResolution is ignored if database mirroring is used + *

    + * transparentNetworkIPResolution is ignored if there are more than 64 IP addresses + * @param tnir if set to true, the driver attempts to connect to the first IP address available. It is true by default. + */ public void setTransparentNetworkIPResolution(boolean tnir) { setBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.TRANSPARENT_NETWORK_IP_RESOLUTION.toString(), tnir); } + + /** + * Retrieves the TransparentNetworkIPResolution value. + * @return if enabled, returns true. Otherwise, false. + */ public boolean getTransparentNetworkIPResolution() { return getBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.TRANSPARENT_NETWORK_IP_RESOLUTION.toString(), SQLServerDriverBooleanProperty.TRANSPARENT_NETWORK_IP_RESOLUTION.getDefaultValue()); @@ -378,11 +448,20 @@ public boolean getSendStringParametersAsUnicode() { return getBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.SEND_STRING_PARAMETERS_AS_UNICODE.toString(), SQLServerDriverBooleanProperty.SEND_STRING_PARAMETERS_AS_UNICODE.getDefaultValue()); } - // Translates the serverName from Unicode to ASCII Compatible Encoding (ACE) + + /** + * Translates the serverName from Unicode to ASCII Compatible Encoding (ACE) + * @param serverNameAsACE if enabled the servername will be translated to ASCII Compatible Encoding (ACE) + */ public void setServerNameAsACE(boolean serverNameAsACE) { setBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.SERVER_NAME_AS_ACE.toString(), serverNameAsACE); } + + /** + * Retrieves if the serverName should be translated from Unicode to ASCII Compatible Encoding (ACE) + * @return if enabled, will return true. Otherwise, false. + */ public boolean getServerNameAsACE() { return getBooleanProperty(connectionProps, SQLServerDriverBooleanProperty.SERVER_NAME_AS_ACE.toString(), SQLServerDriverBooleanProperty.SERVER_NAME_AS_ACE.getDefaultValue()); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSourceObjectFactory.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSourceObjectFactory.java index 0c81ba457..62f8ecaaf 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSourceObjectFactory.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSourceObjectFactory.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -33,6 +33,10 @@ public final class SQLServerDataSourceObjectFactory implements ObjectFactory { // NOTE: Per ObjectFactory spec, the ObjectFactory class requires a public // class with public constructor. + + /** + * Initializes a new instance of the SQLServerDataSourceObjectFactory class. + */ public SQLServerDataSourceObjectFactory() {} // getObjectInstance is a factory for rehydrating references to SQLServerDataSource and its child classes. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataTable.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataTable.java index 1a360537e..2a08c62f1 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataTable.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataTable.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -37,6 +37,8 @@ public final class SQLServerDataTable { /** * The constant in the Java programming language, sometimes referred to as a type code, * that identifies the type TVP. + * + * @throws SQLServerException when an error occurs */ // Name used in CREATE TYPE public SQLServerDataTable() throws SQLServerException @@ -45,6 +47,9 @@ public SQLServerDataTable() throws SQLServerException rows = new HashMap(); } + /** + * Clears this data table. + */ public synchronized void clear() { rowCount = 0; @@ -53,6 +58,10 @@ public synchronized void clear() rows.clear(); } + /** + * Retrieves an iterator on the rows of the data table. + * @return an iterator on the rows of the data table. + */ public synchronized Iterator> getIterator() { if ((null != rows) && (null != rows.entrySet())) @@ -62,6 +71,12 @@ public synchronized Iterator> getIterator() return null; } + /** + * Adds meta data for the specified column + * @param columnName the name of the column + * @param sqlType the sql type of the column + * @throws SQLServerException when an error occurs + */ public synchronized void addColumnMetadata(String columnName, int sqlType) throws SQLServerException { //column names must be unique @@ -69,6 +84,11 @@ public synchronized void addColumnMetadata(String columnName, int sqlType) throw columnMetadata.put(columnCount++, new SQLServerDataColumn(columnName,sqlType)); } + /** + * Adds meta data for the specified column + * @param column the name of the column + * @throws SQLServerException when an error occurs + */ public synchronized void addColumnMetadata(SQLServerDataColumn column) throws SQLServerException { //column names must be unique @@ -76,6 +96,11 @@ public synchronized void addColumnMetadata(SQLServerDataColumn column) throws SQ columnMetadata.put(columnCount++, column); } + /** + * Adds one row of data to the data table. + * @param values values to be added in one row of data to the data table. + * @throws SQLServerException when an error occurs + */ public synchronized void addRow(Object... values) throws SQLServerException { try @@ -241,6 +266,10 @@ public String getTvpName() return tvpName; } + /** + * Retrieves the column meta data of this data table. + * @return the column meta data of this data table. + */ public void setTvpName(String tvpName) { this.tvpName = tvpName; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java index 4c3b62d09..49f53e5e0 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -104,6 +104,11 @@ private synchronized static int nextInstanceID() baseID++; return baseID; } + + /** + * This is a helper function to provide an ID string suitable for tracing. + * @return traceID string + */ final public String toString() { return traceID; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java index 05272f9cb..8e5b7c478 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -16,617 +16,6 @@ // IN THE SOFTWARE. //--------------------------------------------------------------------------------------------------------------------------------- - -/* -Version History - -18Aug2000 2.03 DPM First Release - -31Aug2000 2.04 - Reduced packet size to 512 for SQL Server 6.5 - this is the maxl - Log reports 2.04 not 2.4 - Log Write and stram made static - replace SQLException with SQLServerExceptions to make sure they are logged - -05Sep2000 DPM 2.05 - New types added to handled 6.5 CHAR() and BINARY() not null definitions - Columns.java ArrayIndexException deriveType() sent native type negative - Allow binary, varbinary, image to be returned as result set getString() - Use correct code page to build string in result set getString() - All datatypes converted from byte to integer to avoid issues with bytes creating -ve integers during conversion - All SQLExceptions are SQLServerExceptions which log the exception to the log file with a stack trace - Callable return values now convert V6 data types and derive data types based on length - Switch to allow operations with new and old tds comms modules - Modified processing of return values for SQL 6.5 for StreamRetValue - -05Sep2000 DPM 2.06 - More work on new IO architecture and performance - Used SQL pieces to do prepared statements - Handle quotes correctly in prepared Statement setString() - Changed all public classes to SQLServer* otherwise ambiguity compile errors with Optional API - Dates before 1901 displayed as year 2037 - Property logfile now is independent log file than the one control by the driver manager - (which does not log multiple connections) - -14Sep2000 DPM 2.07 - Prepared stmd and select with a singe ' in SQL executed with createStatement(type, conc) got syntax error - must replace ' with " - Before first now sets rowset row = -1 and rowset.rows to 0 to force a rowset refresh. The previous setPostions were overwriting the contents of the rowset - Stmt default fetch size set to 20 (from 2000) since its only used bringing server side rowsets into memory. 2000 is way to high - Prefix N'..' to sp_cursoropen SQL stmts for V7 - Native type uniqueidentifier could not be returned via result set getXXX() - -19Sep2000 DPM 2.08 - Implement connection setCatalog - Allow TDS_ENV_CHG messages in getMoreResults loop for setCatalog. Just eat them.. - Any messages in getMoreResults are just logged. Previoulsy caused a bad packet error. - Clear in stream when the last packet of a command is sent out. Set in buffer len and index to 0. Previously this was not being done correctly everywhere - Dump in buffer when get bad packets - Removed warning message re JDK 1.2 required - -21Sep2000 DPM 2.09 - Finsihed replacement of original IO system. - Null TEXT, NTEXT and IMAGE in result set were reporting wasNull() as false - Callable statements did not return any null param back right. Driver hung for char() or varchar() - Fixed index errors when calling app set and registered out of range callable statment params - Checked for nulls returning params from callable statments - Logging moved back to driver since >1 connection needs to write to single log file - Connection passed into everything so SQLServerException can log the connection ID - Handle callable syntax like ?=Callxxx(?..) - Changed server side cursors to manage result set calls to sp_xxx() with JDBC callable statements - All callable statement output returned as result sets, not return value packets (SQL 2000 does not appear to write them) - -02Oct2000 DPM 2.10 - Changed connection pool to not use static vectors. Previously pool returned connections to DB2 from pool2 - Set resultset to null for every doExecute. Previously s1 doing a select then update would report result set generated on the executeUpdate() - Check NRSType and RSConcur not null in call to stmt.getResultSetType and Concurrency - Return false for scrolling specified if both concur and type are specified but specified as the default values - If a command other than select is issued with a statment that specifies concurrency and type then execute it normally - IE not via a cursor_open - Implemenet stmt.setMaxRows as pre and post append to the sql statement sent. SET ROWCOUNT=x - -18Oct2000 DPM 2.11 - PreparedStmt.setNull() and ResultSet.updateString() allow string of null. If so call setNull(), updateNull etc - Statment.getWarnings() now does not throw not implemented exception, just returns null - Fixed bug causing invalid packet header. Previously the code tried to form the packet size before it had read enough bytes - -31Oct2000 DPM 2.12 - Check all DONE packets for valid hasPacket() status before returning the row count from the packet - If no result set and no update count is available from getMoreResults set update count to -1 in accordance with JDBC spec - Support getErrorCode and getSQLState for SQLException - Support for BLOB and CLOB - Now deployed obfuscated and in one JAR file (removed 2nd Optional API JAR file) - Fixed updatable result set meta data returning a column count including the rowstat column. - Support BIGINT in SQL 2000 - Support Result Set refresh row - Once the input buffer exceeds its initial size increase it in big chunks to avoid excessive extensions of it for large result sets - -27Nov2000 DPM 2.13 - Max concurrent connections for unpaid licenses is down from 2 to 1. - Rowset Support - Distributed XA support - -01Dec2000 DPM 2.14 - 2.13 went out with 2.12 as the embedded version number.. - Used DONEINPROC transaction state flag to correctly handle combinations of result sets and update counts generated from a stored procedure - Generally reduced number of objects created for many operations. This reduces time to alloc object and garbage collect them. This gave ~15% speed gain. Use OptimizeIt. - Removed finalizers that only set variables to null. These take time to register and fire and do nothing useful - IO buffers for input and output merged as one buffer - An object can specify its original IOBuffer size. Connections required less than statements. - IOBuffer - Removed temporary char[] used to send commands - IOBuffer - reduced temporary byte[] used to build StreamXXX packets - Reduce result set IOBuffer extension size for first extension but then double buffer extension size each time an extension is required. Better for large result sets - getRowsetField returns Strings, not StringBuffers now. - Building the String to send for a prepared statement is now done with a common StringBuffer rather than concatenating may strings - Fixed bug where number of columns returned in ResultSetMetaData was one too few for server side cursors - -09Dec2000 DPM 2.15 - Removed indexing of whole result set when it is first read. Now index the current row only - Upped default fetch size for server side cursors 20->100 - Allow client side cursors to scroll. - Fix bug where negative shorts were returned positive. - If a stored proc returns update counts before a result set skip them if the app called executeQuery() - -20Dec2000-29Dec2000 DPM 2.16 - Drop the 'N' national character prefix when the length of data > 4000 chars. Else get //More than this get error - 'Error converting data type ntext to text' - Statement parameters - handle single quote in LONGVARCHAR (CLOB) as well as CHAR (String). - Prepared params for large binary object - ensure statment string has extra 1K of bytes to avoid realloc of string buffer during conversion to hex - When sending string command (IE not login) send from the command string itself rather than copying the string into the extendable IO buffer. Previously attempted inserts of >5MB images failed - Version V7 flag was not propagated to cloned connections during pooling. This caused pooling to SQL 6.5 db's to fail - -04Jan2001- DPM 2.17 - Catch no such method on DBComms.setReceiveBufferSize since it fails on some JVM 1.2's - Result set insert row, update row and delete row now read for TDS_DONEPROC to check successful operation or else throw SQLException - EG data too long - Obey setMaxRows() for server side cursors in addition to client side cursors. - Fixed bug that reported zero length TEXT, NTEXT or IMAGE as null - Make data source property names consistent with JDBC spec serverName instead of host etc. - Start of JDBC 3.0 features - Savepoints - Close server cursors - server side cursors were never being closed. - -24Jan2001 - DPM 2.18 - Moved command logging to IOBuffer.sendCommand to get log of everything sent - When get 'exhausted input ..' exception dump the in buffer. - For output params: if app specifies registerOutParam(CHAR) register it as VARCHAR instead. Its hard to think of cases where this would not be correct and it takes the onus off the app to specify VARCHAR instead of char - Made connection thread safe. Database comms now synchronized between >1 statement on the connection. NOTE * Result set and statement are not thread safe. - Fixed rs.getBinaryStream & getAsciiStream which generated a null pointer exception if the column data was null. - -5Feb2001 - 20Feb01 DPM 2.19 - For versions >= 7.0 use 'SID', not 'SUID' in schema queries in db meta data. SQL 2000 deprecated SUID. - Fixed bug returning datetimes's out by an hour in daylight savings hours. - Fixed bug where a pending transaction on the previous use of a pooled connection handle propagated to the next use of the connection handle - -22Feb01 - DPM 2.20 - If a client side cursor hit end with a next() then any subsequent next() must return false - Stored procs returning multiple result sets. If one of the results sets has 0 rows got 'input exhausted' message. Need to search for DONEINPROC as well as DONEPROC to mark end of result set - -07Mar2001 - DPM 2.21 - Datasource setSqlversion changed to setSqlVersion(). Added setDatabase() and getDatabase() - Support setURL() and getURL() in datasources. Popular (but not mandatory) property.. - Remove parsing for escape '\'. Parsing a constant string in a prepare() or prepareCall() threw a count parameters exception - Implemenent JDBC 3.0 pool management in SQLServerPoolingDataSource - serverName and portNumber were not processed by SQLServerDriver. Previously only worked for data sources, now work via driver manager - Support setObject(o) where o is a Short. - getObject() for a smallint should return object type Short. integerToObject returns short for short and tiny types - Added support for cancel a statement and query timeouts - Support for Driver Manager and Data source connection login timeout - Changed Datasource setPort(String) to setPort(int) - Added support for getInt, Long, Float() etc where the source column is CHAR or VARCHAR - -22Mar2001 - DPM 2.22 - Changed sp_cursor to allow update of null on updatable result sets. Now this call uses declare @param=value etc. From SQL 7.0 SP2 and SQL 2000 on, the syntax exec sp_cursor ..., @column1 = null gives 'Incorrect syntax near type' - Allow result sets from callable statements to use absolute positioning. IE make them not "serverSide()=true" - Another attempt at getting datestamps to return correctly. Datetimes out by 1 hours as daylight savings changed in some time zones. Use complained some time stamps still out by 60 minutes - JDBC 3.0 Connector code - start. - Ensure new JDBC 3.0 connector code does not ship in 2.0 and then get class not found errors at runtime. - -03Apr2001 - DPM 2.23 - Fixes to run JDBCCTS certification tests :- - DBMeta - attempt to change to different catalog if its specified in the call. - DBMeta - return a non null, empty result instead of null for no tables, columns etc calls - DBMeta - make connection.getCatalog and dbmeta.getCatalogs() return upper case to match between them - ResultSet - throw exception for negative setFetchSize. - ResultSet - allow char to timestamp and char to bit conversion for reads. - BatchUpdate - If the batch is cleared should return result int[0] to caller, dont throw exception - BatchUpdate - Propagate the result int[] to any BatchUpdateException - BatchUpdate - disallow select in batch - throw BatchUpdateException - EscapeSyntax- return "" to query for functions supported. - Stmt - throw exceptions for -ve set of query timeout, max column size or max rows - Stmt - Fix for empty result set generated followed by call to getMoreResults() - - Changed checkLicense - previous method of selecting connections from DB was not thread safe for many threads starting up connections simulataneously - Bugs in precsion and scale - reviewed and corrected for all data types - -19Apr2001 - DPM 2.24 - Renamed SQLServerPoolingDataSource to SQLServerConnectionPool. This class is no longer derived from datasource - Positions indexes in Blob and CLob must start at 1, not 0 - see JDBC spec - If auto commit is on and the app calls commit() dont execute a begin transaction. - Remove difference in logic callable statement vs prepared stmt in getNextResult(). - This is required to ensure update counts are correctly returned for stored procedures executed via a prepared stmt with an "EXEC" - Summary: 2.23 allows exec via prepared statements, 2.24 returns correct update counts for exec - DBMeta.getMaxStatements() changed to return 0 unlimited not 1 - Fix 'DBComms.negative data length'. Sometimes SQL Server does not return the full packet length for packets before the last packet - Licenses are now version specific. IE a 2.x license will fail in a 3.x driver - -04May2001 - DPM 2.25 - A single space from a char() column was returned as null. This behaviour should only be true in SQL 6.5 mode - If updateByte(n) and n is < 0 make n = 256+n. Required to pass inet performance test - Allow situation with no actual column updates. Required to pass inet performance test - stmt.indexRow() - fixed bug where a prepared statement was executed with some params to create a result set with rows, then executed with new params which returned a null result set. However the 2nd row of the first result set was returned in error. checked indexRow does not go beyond end of receieved data from dbms. - CallableStatement.getObject did not use correct index to retrieve the parameters type if some input only params were in the param list before the out params - Added new property to specify character set for single byte columns. 'codepage' - License check for 2.x driver incorrectly checked if the license is version specific. USers installing old licenses (before version aware) into current releases failed the check - Performance analysis again : - - make most classes final, those not finalizable - make most methods final - - replace use of Vector with ArrayList - - use RPC to execute all sp_cursors to insert, update and delete from server side cursors - - rewrote the building of SQL cmds to send to db. Minimized use of string concatenation to expand prepared statements. USed global char[] buffer instead - Catch SocketException if setTcpNoDelay fails on socket creation - this is not supported in Oracle App Server - Try to set socket KeepAlive on to resolve the numerous reports of 'connection reset by peer' - Updates to result sets now done with a new temporary statement from the result set. Previously the building of the sp_cursor call and subsequent packets back from the db corrupted the original result set which was using the same io buffer - -30May2001 - DPM 2.251 - 2.25 was corrupting the result of rs.getString(n) with the value of rs.getString(n-1). Caused read corruption with VARCHAR - -30May2001 - DPM 2.26 - Use sp_prepare, column parsing and sp_execute to handle prepared statements - Generate correct call stmt params numbers for param count 1->99, 2.25 created a syntax error if the param number was > 30 - Setting the "portNumber" via connection properties (therefore datasources etc) was ignored - Execute callable statements with RPC. Rewrite of large parts of stored procedures - TDS_DONE and DONEPROC are returned only if they contain an update count or are final. Removed more convoluted logic for processing these packets - DbComms.receive could read some of the packet's data bytes if it had to read the packet header in >1 chunk. Code was changed to stop this - Connection setCatalog changed the database but did not set sCatalog that is used to return connection.getCatalog(). Also getTables gave error if the user was connected to any database, EG none specified on the connect URL - ResultSet.Close() no longer sets its stmt to null. The statement is still required because the result set's statement needs to be able to move to the end of the result set to retrieve more results. Previoulsy application received a null pointer using absolute to move to the end of the result set if the user app closed the result set. See test ResultSetMoreAfterClose. - Added optimized handling of result set getString() if the default encoding is US Ascii - Database meta data now creates a new statement and result set instance to handle nested calling of result set functions. Eg get all columns of all tables in the database. User reported this failed with IDE Forte's capture database schema feature. - Ensure logon failure exceptions contain the specific SQL Server error code and state. - Codepage setting was not being propagated to pooled connections. - Allow datasource setXXX() properties to override the values set in datasource.setURL(). Previously if setURL() was used, no other property set with setXXX() was examined - Commit/Rollback and start new transaction now separate methods. - XADataSource does not begin a transaction now, XAResource.start begins the transaction since for 'never' setting of container managed transactions app server will never start a transaction. In that case the app server will never call XAResource.start() - Add JDBC 3.0 pooling parameters to data source and connection pool. Doc with JAva doc for user HTML - If executeUpdate generates a result set thow the exception but do not display it to System.out - When a paramter is set clear its bNull flag. Websphere resues prepared statements across bean activations and clears their params after each execute - -30May2001 - DPM 2.261 - Converting timestamps to datetime for dates < 1970 created incorrect dates and times since the ms values was < 0 - Allow prepared insert expressions with mixed constants and ? to pass parsing. EG INSERT INTO TABLE (COL1, COL2) VALUES (1, ?) - Ensure '?' embedded in literals do not get replaced with parameter markers when preparing statements - Use a smaller char[] to expand parameter markers for long sql statements. Previously the expanded statement was x4 the original which caused SQL Server to close the connection socket. - ALlow Types.NUMERIC as a type for registering out params with RPC. - -24Jul2001 - DPM 2.262 - Connection property "disablePrePrepare" to disable use of new pre preparation of prepared statements. - Statement.sendParamsByRPC did not include switch for all the java.sql.Types.* possibly registered with registerOutParam - registerOutPram now maps them to types suported ty preparedStatment.setXXX() -26Jul2001 - DPM 2.263 - Disable sp_prepare until statement pooling is implemented to reduce memory usage - Add N prefix to char data > 4000 characters for text mode parameter expansion. Previously CHAR or VARCHAR params were sent to DBMS without the N national character prefix when the data was > 4000 chars due to reported "'Error converting data type ntext to text'". Customer complained wrong unicode > 4000 chars and this convert error cannot be recreated..so N is prefixed to all char data now -26Jul2001 - DPM 2.264 - Moved prepared statement preparation to connection for prepared handle pooling - Ensure all java.sql.Types.* can be set using prepStmt.setNull(n, *); -30Jul2001 - DPM 2.265 - Do not search for TDS_DONE when bOnlyResultSets is true (for executeQuery()) -30Jul2001 - DPM 2.266 - Correct 0 index in prepared statement setClob() and setBlob() - If string data length is > 4000 (not 8000) send as LONGCHAR data -07Aug2001 - DPM 2.267 - Fix fatal comms errors notifications. Previously a connection pool was not notified about a fatal comms error on a connection. - When a pooled connection is closed only reset it to CLOSED (available) if errors occurred on the connection - Prepared and callable statement setNull(n, Types.BIGINT) resulted in 0 , not null being passed. - Pooled connections that have experienced fatal IO errors removed from pool list - Renamed disablePrePrepare property to disableStatementPooling - New IOBuffer method to try to extend the buffer (by disk file) in low memory conditions - -10Aug 2001 - DPM 2.268 - Dont allow setAutoCommit() to generate more than one level of transaction since a single rollback will leave the transaction uncomitted. IE @@TRANCOUNT should never be > 1 - Leave Debug.class obfuscated in build. - Allow SQLServerConnectionPool to pool connections for a SQLServerXADataSource, not just SQLServerConnectionPoolDataSource - Non XA pooled connections now issue a rollback when the connection is closed to dispose of any uncommited transactions - The use of DBComms.LAST_PKT_NO caused index of out bounds exceptions - Logging for RPC throws out of bounds exception if the log is on when sending a binary stream (or other large data) whereby the logging expected the length of the procedure name in the first 2 bytes but the 1st packet of the command has already be sent - Catch a security exception if we cannot read the JVM's character encoding to set bCp1252. - -10Aug2001 - DPM 2.269 - Blob.getBinaryStream issued a call for Blob.getBytes with a zero index (the index of the first byte is 1). Ditto for Clob. - Expand propertyInfo in getPropertyInfo from size 7 to 9. Previously an array index exception was thrown just by calling this method. - Remove all explicit calls to Runtime garbage collection - Timeout thread now uses interrupt (not stop) to end a timeout thread. Stop is deprecated because its not threadsafe - Added SQL_UNICODE_VARCHAR (-96) as a valid type for a null RPC paramter. IBM Persistence builder uses setNull(n, -96). Reported by HP - -22Aug2001 - DPM 2.2610 - Dont attempt to send stored procedure calls with static parameters via RPC, send by batch instead. RPC can only be used if all parameters are set by setXXX() - Connection.getCatalog should not return the db name in upper case. Ensure that if the cat was never set its returned as "master" - -23Aug2001 - DPM 2.2611 - Timestamps with >0 times before 1970 were stored wrongly with RPC prepared statements. EG 12/20/1969 13:08:52 was stored 12/21/1969 13:08:52 - Database meta data buildColumns() returned non java.sql.Types values for the data type (col5) for NCHAR, NVARCHAR and NTEXT - Prepared batch statement with setLong(). The long value was not copied to each batch param set. - Sending a stream (binary or char/ text or RPC) now checks if less than the requested number bytes was read from the stream. Previously the code expected that all bytes requested were read. IE now the stream may provide the requested number of bytes in chunks - -23Aug2001 - DPM 2.2612 - The call to callableStatement.execute() had the static param/output param check commented? The comment was removed. An attempt to call a stored procedure with static params mixed with output params now throws an exception. Static params cannot be sent via RPC and output params cannot be processed via non-RPC stored proc calls. That is because the required RET_VAL's do not appear before the final DONEPROC that the code uses to identify the end of the procedure - If the file name is null or zero length do not attempt to set the custom log file in logger.setCustomLogger() - If an unknown column type is reported in connection.buildParamDefinitions abort the preparation of the statement. If the showParseErrors is on display the text of the 'unknown type' exception - Handle DataTypes.BIT1 (bit not null) when building the parameter types string for the sp_prepare in prepared statement preparation - If an attempt is made to use setNull with jdbcType 0, use the jdbc type Types.CHAR - If an attempt is made to set parameters on a closed prepared statement, throw the exception "stmt is closed", dont generate a null pointer exception - -10Sep2001 - DPM 2.2613 - Non CallableStatements should not process DONEINPROC's since they may be generated from triggers etc. If the DONEINPROC is processed (rather than the final DONE) we loose the update count in the DONE. - dbMetaData.getSystemFunctions() reinstated after CTS certification complete. The CTS certification tried to exercise them if they were returned as supported. - Dont process DONEINPROC for non prepared statements - see code comments. This partially fixes a customer problem getting wrong update counts when triggers are fired. - Datasource - dont override any username, password set via setURL() if the username/password was not set with setUsername, setPassword etc. Previoulsy a username/pass set in the URL would be overidden with "" if setUsername was not called. - -170Sep2001 - DPM 2.2614 - Statement.cancel() did not work. - Stored procedure that returns say 2 resultsets, the first of which has 0 rows. The first row of the 2nd result set is returned then we get an unknown packet error - The variable userSQL was moved from PreparedStatement to Statement. Its now used by cachedResultSet to obtain the table name if the rowset is populated by a resultset - ResultSet.getCharacterStream() - if the data is null return null, dont allow the null pointer exception of the previous version - -02Oct2001 - DPM 2.2615 - Revised detection of DONEINPROCs again to allow correct operation of a prepared statement that executes a "execute procname" - IE a prepared statement that cannot be executed with sp_prepare, sp_execute - Statment.targetColumnType() did not consider the case where the updating statement was a callable statement - attempts to set stored procedure params >4000 chars failed - Cloning parameters for batcing prepared statements did not copy the values of any binary or character streams, byte arrays or big decimals - -10Oct2001 - DPM 2.2616 - BLOB/CLOB and referenced classes Connection, IOBuffer, Packet Requestor etc) all made serializable or included constructors to make them serializalbe. Requested via Thought Inc Coco Base - RPCAppendDouble did not allocate extend the out buffer by enough bytes for the 8 byte bit pattern. Caused an index out of bounds exception - Support setObject using java.util.Date as well as java.sql.Date. - -15Oct2001 - DPM 2.2617 - Cached rowset - Only report the inability to determine the underlying table name when updating it. For example, the rowset may have been populated from a callable statement and the user just wants to browser (not update) it. - Prepared Stmt.setObject(timestamp). Move the timestamp test before the java.util.Date test. Timestamps are java.util.Dates but must be processed with timestamp specific code to retain the HH:mm:SS -16Oct2001 - DPM 2.2618 - statement.getMoreResults() call after no result set returned and updatecount=-1 returned caused a "No TDS_RET_STATUS found for stored procedure output params". - If the syntax for a callable statement is invalid try to execute it as a preparedStatement call. This is the way 2.25 used to work - Statement.getNextResult() - set update count to -1 if we go beyond the end of the receive buffer - closeAllConnections() - new API added to connection pool to close connections before the pool is finalized. - -16Oct2001 - DPM 2.2619 - StreamError - new mapping of some specific error numbers to state strings. -13Nov2001 - DPM 2.2620 - Some conditional code to allow compile/operation with JDK 1.1.8 -27Nov2001 - DPM 2.2621 - Changed rounding arithmetic for sending timestamp paramters via RPC to avoid rounding errors -19Nov2001 - DPM 2.2622 - Changed PreparedStatement.setTimestamp. timestamp.getTime() did not include the millisecs of the timestamp for JDK <= 1.3 - For RPC for < SQL 7.0 send byte array correct tds 6.5 protocol - datatypes, data length size etc. - Send RPC String params with maximum target type column size, not the size of the actual target column in the table - For SQLServerJDBCRowset if the username/passw are not set for the rowset use any username/pass specified for the rowset's datasource -13Dec2001 - DPM 2.2623 - Cached rowset - when populating the rowset with a result set rewind the result set before populating the rowset in case the use app was laready at the end of the result set -19Dec2001 - DPM 2.2624 - Propagate the statement's QueryTimeout (if set) to any statements used to fetch result set cursors for server side result sets - Handle exception if app if driver cannot call System.getProperties() to get the JDK version -02Jan2002 - DPM 2.2625 - Support the setMaxRows() call if the statement is a callable statement. This stopped working when the move was made to RPC for callable statements -07Jan2002 - DPM 2.2626 - Add support for SQLWarnings - CallableStatement - Allow case where no parenthesis are around the callable statement params, Previously got procedure not found xxx ?,?,? - Added calendar support for get/set timezone, time and date - If a decimal is returned as long drop any decimal places, dont throw a number format exception - -18Jan2002 - DPM 2.27 - Remove connection finalizer. See notes in code - Support for JTA via MS DTC - Handles the use of "{call" escape sequence using a non callable statment. - -24Jan2002 - DPM 2.2701 - Corrected count of parameters with an escape sequence in a string -29Jan2002 - DPM 2.2702 - Send prepared stmts > 4000 chars via long strings in RPC - Dont try to close the connection's prepared handles if the finalizer thread has closed the socket already -06Feb2002 - DPM 2.2703 - Dont use zSQL to build sp_prepare for prepared statements. Previously syntax that could not be parsed was execute as non-prepared. - Dont close prepared handles when the connection is closed. SQL Server will do it automatically. - Dont read the entire BLOB/CLOB in PreparedStatement.setBlob/Clob() - SQLServerDataSourceObjectFactory.stringToBoolean had thrown invalid index exception. - Calls to SQLServerConnectConnectionPoolDataSource.setManagementCycleTime() now call setPropertyCycle(). THe SQLServerConnect pool is now driven by the propertyCycleTime, not the ManagementCycleTime -06Feb2002 - DPM 2.2704 - Change message when a param value for a prepared stmt is not set. This is generated now by Connection.buildParamTypeDefinitions() - If the prepared stmt parameter definition > 4000 send it as long text. - Generate a connection pool notfiy error if there are packet errors in the db comms. Tell the pool to remove the physical connection -06Feb2002 - DPM 2.2705 - If there a >1 LONGVARCHAR (or CLOB) in a single row for insert/update dealy between sending the data for each to the DB - SQLServerException now serializable - Added some new state codes mappings for SQL exceptions -06Feb2002 - DPM 3.2706 - Changes to allow JDBC 3 mulitple open result sets - New connection property to control lock timeouts 'lockTimeout'. - ResultSet.last() now uses LAST (not absolute) for server side cursors since absolute -1 failed on dynamic cursors. - Data source support various flavours of setProperty(String, value) - ResultSet.isLast() caused the field offset tables to be replaced with the value for the last row - ';' is a connection preoperty delimiter - String (not byte[]) is now the type returned by getObject() for GUIDs. Required for GUID reading in cached rowsets - Implemeted connection Failover -20Mar2002 - DPM 3.2707 - Added state code for network failure based exceptions -20Mar2002 - DPM 3.2708 - After ResultSet.updateRow() set all column params to PARAM_NOT_SET so previous row parram values are not applied to the current row to be updated (if they are not explicitly set for that row) -20Mar2002 - DPM 3.2709 - Subtle changes in thread timeout handling, suggested by customer. - Changed ResultSet.updatedTimestamp. timestamp.getTime() did not include the millisecs of the timestamp for JDK <= 1.3 -20Mar2002 - DPM 3.2710 - Reprepare stmt if the execute params values are incompatible with the prepared stmt. EG A long string needs to inserted with a prpeared stmt prepared for a short string - Once memory is exhausted on receiving large result sets send all subsequent db input to a file buffer. - Avoid creating another byte[] when reading large BLOBs. Memory saving. - Check for null stmt in dbmeta.getTables() - Support property sendStringParametersAsUnicode to allow string params to be sent in native TDS collation format, not UNICODE for performance - Support all numeric database names by adding single quotes in its "USE" statement -30May2002 - DPM 3.2711 - Map "FOR UPDATE" to HOLDLOCK in a select. This option will lock the select rows - Report state "08S01" when connection fails because db not up -30May2002 - DPM 3.2712 - SQLServerConnectionPool cycled thru all physical connections in the pool, pinging each one when it should have issued the first eligible connection - SQLServerConnectionPool did not ping conncections automatically created by the connection pool (EG intial connection or top up connections) - Detect auto-increment on numerics as well as integer columns -18Jul2002 - DPM 3.2713 - Dont override cached rowset command if its been previously set - ALlow >1 space between 'call' and procedure name, previously this sytnax caused the call stmt to be sent as batch, not RPC - Remove attempted mapping of "FOR UPDATE". This generates incorrect syntax if there is a WHERE CLAUSE. SELECT * FROM TEST WHERE COl0 then return it as big decimal, not bigint - Stmt.initRowset initialize index tables each call, customer reports null ptr exception in this code but cannot recreate it - Resultset.insert and update row. Check result set is updatable. Dont throw 'The cursor identifier value provided (0) is not valid' - Add new test to detected end of resultset for server side cursor. See notes in code - -08Oct2002 - DPM 3.2721 - New 7.0 logon packet - New connection property applicationName - Allow setDate value to be a null date in cachedrowset - -09Dec2002 - DPM 3.3000 - Support for NT Authentication - Implement TDS 0x71 protocol - Change BIGINT, NUMERIC, DECIMAL to use TDS protocol 0x71 type values - connection pre-verify implemented in connection pools - Datasource print writer can now be enabled and disabled (set to null) during the application running. - setTransactionIsolation - check connection and socket not closed already. - Allow prepStmt.setObject(obj) where obj is an input stream - Add connection/thread context to DBComms network exceptions - All getObject() now return Long (not BIGINT) for BIGINT db column types. Also applies to any data conversion that previoulsy returned BIGINTs - -13Jan2003 - DPM 3.3001 - Must map user's sql to use (case col=null else..) to distinguish null values using textptr's - Further changes to sending RPC streams to ensure no interim short packets are generated -21Jan2003 - DPM 3.3002 - Change to textptr syntax for Cognos -05Feb2003 - DPM 3.3003 - Discard any result set updates not applied with ResultSet.updateRow() when the application moves off the row. - Enforce single machine name check. License handled is now version 'A' of license - An expired license still allowed unlimited connections since the SQL to check existing connections used the wrong 'program name' -24Feb2003 - DPM 3.3004 - Flush db network send for statement cancel API call - SQLServerLicense.class now required instead of License.class. Required to allow >1 Microsoft product to exist in a JVM without tripping over each others licenses (and failing on license product ID) - If a TDS_ERR is present at the end of a result set (instead of TDS_DONE) throw the exception. Customer (Nobilis) reported that a deadlock was not reported - ResultSet getString() from a BIGINT threw a Long() class cast exception. - DBComms.eatCancel added to remove unprocessed cancelled packets -24Feb2003 - DPM 3.3005 - SQL Type uniqueidentifier (GUID) now returned as a String from getObject(). Previously was byte[]. - ResultSetMetaData and DatabaseMetaData returns GUID column type as Types.CHAR. - Allow port numbers larger than short() number value. -11Mar2003 - DPM 3.3006 - DBComms.eatCancel() must wait in some cases for arrival of cancel packet. - Authentication listener now listens on port 1533 - Lookup for named instance port for a specified named instance - commit/rollback the current trans and start the new one in one (not 2) db round trips - Added compile time option to synchronize setting of auto commit, see notes in code. BEA project -18Mar2003 - DPM 3.3007 - IoBuffer.bufferAppendRPCInputStream -01Apr2003 - DPM 3.3008 - Trusted connections are now closed via OleDB DLL, not the java socket level. This is required to avoid depletion of network resources ultimately causing a failure to connect. -01Apr2003 - DPM 3.3009 - Trusted connections are now implemented using ODBC. The permanent proxy socket listnener was replaced by a temporary listener on the same thread as the connection attempt -10Apr2003 - 30Apr03 DPM 3.3010 - SQLServerException handling changed to centralize errNum->state mapping - Support for con property XOPENStates=true - Check for and throw exception for a statement that is zero length. EG stmt.executeUpdate(""); This causes the recv from the db to wait forever. - Disabled autoCommit optimization that was added for the BEA transaction tests. - Trusted authentication reverted back to use OleDB since ODBC did not improve the BMC stability problems - Trusted connection now made by calling the DLL on the main thread (not a new thread) since BMC changes the credentials of the main thread only -01May2003 - DPM 3.3011 - Password encryption on SQL Server authentication corrected to handle unicode characters - Allow trusted authetnication with SQL 7.0 which requires two connections to connect. The first is rejected to downstep the TDS version -14May2003 - DPM 3.3012 - notifyEventMethod in connection changed from static to non static. If there are >1 connection objects they may have come from different BasePooledConnections - notifyEventMethod must be propagated in connection cloning. -21May2003 - DPM 3.3013 - Connection.getTypeMap must not throw exception for WAS 5.0 - Map the "FOR UPDATE" syntax to use an updatable cursor (using sp_cursoropen) -21May2003 - DPM 3.3014 - Ensure that a prepared statement reprepares if a decimal parameter is encounted with a higher scale than the value the statement was prepared with - Numerous changes to improve efficiency of how a prepared statement can access the original parameters it was prepared with - Ensure translateBooleanLiterals works with stmt.executeUpdate(). Test for syntax translation was not present in this method - Boolean literal processing did not correctly handle >1 boolean literal in the SQL syntax. Replace the logic -24Jun2003 - DPM 3.3015 - Only attempt InetAddress.getLocalHost() call if the license specifies a specific machine name. This call has failed with an internal NPE at a customers site -01Jul2003 - DPM 3.3016 - Do not attempt to use server side cursors if the statement is prepared with specifc Result set type and concurrency but the application does not ultimately execute a SELECT. This fix required for use with KODO JDO -01Jul2003 - DPM 3.3017 - Calendar was ignored by some changed code to convert date, timestamp etc to/from MS SQL format. -04Aug2003 - DPM 3.3018 - Start work to handle data type SQL_VARIANT string values EG generated from a EXEC sp_executesql 'some command' within a stored procedure - Correct database IO bug where the database's packet size is set to a high value EG 32K. -08Aug2003 - DPM 3.3019 - GetPropertyInfo generated an arrayIndex exception. The array must be expanded as new properties are added. - Changes to cancel logic to avoid driver waiting forever when a statement on a connection was cancelled and that connection was later reissued from the connection pool -03Oct2003 - DPM 3.3020 - Add a connection property to enable failover support. Previously the driver interpreted '%' in a connection propery (eg pwd) as a failover sequence (BMC reported issue) -06Nov2003 - DPM 3.3021 - New licensing structure specifies machine name, max connections and license mode (client or server). - Discontinue old single connection mode after trial expires. Once trial expires product is now no longer usable. - -29Jan2004 - DPM 3.3022 KR - Code checked into CVS - -03Feb2004 - DPM 3.3023 KR - ProductName- instead of just ProductName. The previous version would have failed if multiple - Group Licenses will try to connect to the same SQLServer. - -09 April2004 - 4.0000 KR - Create a new Driver property called "selectMethod". - Full support for Blob/Clob classes. - Improved performance for BatchUpdates -- both Statement and PreparedStatement. - Changes made in 3.3023 have been reverted back. The new licensing scheme will take - care of the bug. - No more SQLServerConnect 2.0 and SQLServerConnect 3.0 -- Just one product with both drivers JDBC 2.0 - and JDBC 3.0 Compliant. - New Documentation -- All old logos replaced. - -23 April2004 - 4.0100 KR - New property 'iterativeBatching' to support batchUpdate backward compatibility. - -27 May2004 - 4.0200 KR - Fixed a bug for SET Statements.The isSelect() method in SQLServerStatement used to - determine if a statement is Select or not just by the first letter of the query. Thus - a set command would be assumed to be a select query. This has caused problems internally where - isSelect() method is used. Fixed to look for the whole "select" word. - New Batch implementation never cleared the statements in batch after processing them. Fixed. - -18 Jun2004 - 4.0300 KR - Removed Upper() function in DatabaseMetaData.getCatalogs(). Now return the original case. Refer Bugz-416 - -29 Oct2004 - 4.0300 DPM - -Added new properties to allow connection retries. This is introduced to try to solve SBC very rapid creation of connections issue - -Ensure connection IDs issued in a thread safe manner. - -Have all log entries show the connection instance ID. Previously connection attempts did not. - setCursorName. Allow a null value to be compliant with WAS 5.0 adapter com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper - -Added datasource property maxConnectionBacklog to limit the number of concurrent connections in progress. Resolves an SBC issue where many connections where created in a short time period. Typically only used when a server is under very heavy load - -09 Nov2004 - 4.0400 DPM - Comments Added by KR - -Code changed in AuthenticationProcessor run() method and the JDBC3.0 driver will use the - methods available in JDK 1.4 and up for reusing the ServerSockets that were closed recently. - -Reusing recently closed sockets by the authentication proxy avoids depletion of the socket pool - -Added case for error code to state mapping. Error 2627 maps to SQL 92 state "23000" (Violation of primary key constraint) - -retryConnectionCount > 0 caused >1 connection to be created in error. Now when a connection is made successfully the retry loop exits. - - A connection thread is now guaranteed to not start a new trusted connection proxy listener before - Reusing recently closed sockets by the authentication proxy avoids depletion of the socket pool - the proxy instance thread of a previous connection exits - New property trustedAuthenticationPort was added to enable the trusted authentication proxy to - listen on a unique port for every JVM instance on a single machine. Otherwise the proxy listener - is not multi process safe on >1 JVM on a single machine - -08 Dec 04 - 4.50 KR - Got J2EE 1.4 Certified. NTLM code changes have been merged but not made public. Will be made - public in the next major version. - Fixed a bug in CallableStatement and removed stack trace outputs left uncommented inadvertently. - -01 Jan 05 - 4.51 KR - NTLM Authentication implemented.New Connection properties "ntlmAuthentication" and "domain" have been - added. "domain" property is required whenever ntlmAuthentication is turned on. - NOTE :- THE SETTERS AND GETTERS IN SQLServerDataSource for these properties are PRIVATE, as they are - not supposed to be made public in 4.50. AT THE RELEASE OF 5.0 MAKE SURE TO MAKE THEM PUBLIC. - Added case for error code to state mapping. Error 2627 maps to SQL 92 state "23000" (Violation of primary key constraint) - retryConnectionCount > 0 caused >1 connection to be created in error. Now when a connection is made successfully the retry loop exits. - -02 Feb 05 - 4.52 DPM - Provide ability to return prepared statement meta data prior to the execution of the statement - Driver must use max precision of 38 for all decimals for SQL 2000, previously was hard coded to 28. - prepStmt.setObject(type) added additional code to convert data to target type before sending to db - A db datetime returned as a JDBC time now has the date component zeroed - A callable statement param used for IN and OUT may have a different type registered for output versus the input data type supplied by a setXXX(). - DATETIME output params from a stored proc must be converted to the user's registered out type - Prep statements sp_prepare datatype NTEXT must be modified to TEXT when using ascii string parameters property - IOBuffer.bufferAppendRPCStringAscii did not preallocate enough bytes causing an IndexArrayOutOfBounds exception periodically - Added 3 new classes to begin support for SSL via SQLServerConnect. - For logging of RPC data convert the binary data to hex representation. Existing code could throw a NegativeArrayIndex exception - -02 Mar 05 - 4.53 DPM - Have the SQLServerNTAuthentication.dll issue a unique authentication proxy listening port for the driver in each JVM instance. This is required since there is no inter-JVM synchronization. -*/ package com.microsoft.sqlserver.jdbc; import java.sql.*; @@ -743,8 +132,6 @@ else if (value.toLowerCase(Locale.US).equalsIgnoreCase(ColumnEncryptionSetting.D enum KeyStoreAuthentication { JavaKeyStorePassword; - // CertificateStore is not supported for the 6.0 release. - //CertificateStore; static KeyStoreAuthentication valueOfString(String value) throws SQLServerException { @@ -754,10 +141,6 @@ static KeyStoreAuthentication valueOfString(String value) throws SQLServerExcept { method = KeyStoreAuthentication.JavaKeyStorePassword; } -// else if (value.toLowerCase(Locale.US).equalsIgnoreCase(KeyStoreAuthentication.CertificateStore.toString())) -// { -// method = KeyStoreAuthentication.CertificateStore; -// } else { MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_InvalidConnectionSetting")); @@ -990,7 +373,7 @@ public final class SQLServerDriver implements java.sql.Driver new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.WORKSTATION_ID.toString(), SQLServerDriverStringProperty.WORKSTATION_ID.getDefaultValue(), false, null), new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.XOPEN_STATES.toString(), Boolean.toString(SQLServerDriverBooleanProperty.XOPEN_STATES.getDefaultValue()), false, TRUE_FALSE), new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.AUTHENTICATION_SCHEME.toString(), SQLServerDriverStringProperty.AUTHENTICATION_SCHEME.getDefaultValue(), false, new String[] {AuthenticationScheme.javaKerberos.toString(),AuthenticationScheme.nativeAuthentication.toString()}), - new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.AUTHENTICATION.toString(), SQLServerDriverStringProperty.AUTHENTICATION.getDefaultValue(), false, new String[] {SqlAuthentication.NotSpecified.toString(),SqlAuthentication.SqlPassword.toString(),SqlAuthentication.ActiveDirectoryPassword.toString(),SqlAuthentication.ActiveDirectoryIntegrated.toString()}), + new SQLServerDriverPropertyInfo(SQLServerDriverStringProperty.AUTHENTICATION.toString(), SQLServerDriverStringProperty.AUTHENTICATION.getDefaultValue(), false, new String[] {SqlAuthentication.NotSpecified.toString(),SqlAuthentication.SqlPassword.toString(),SqlAuthentication.ActiveDirectoryPassword.toString(),SqlAuthentication.ActiveDirectoryIntegrated.toString()}), }; //Properties that can only be set by using Properties. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithm.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithm.java index 540d72db1..3a6af227d 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithm.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithm.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -29,13 +29,13 @@ abstract class SQLServerEncryptionAlgorithm { /** * Perform encryption of the plain text * @param plainText data to be encrypted - * @return cipher text + * @return cipher text after encryption */ abstract byte [] encryptData(byte [] plainText) throws SQLServerException; /** * Decrypt cipher text to plain text - * @param cipherText + * @param cipherText data to be decrypted * @return plain text after decryption */ abstract byte [] decryptData(byte [] cipherText) throws SQLServerException; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactory.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactory.java index f916f1228..e4ac50a39 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactory.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactory.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -32,7 +32,7 @@ abstract class SQLServerEncryptionAlgorithmFactory { * @param encryptionType specifies kind of encryption * @param encryptionAlgorithm name of encryption algorithm * @return created SQLServerEncryptionAlgorithm instance - * @throws SQLServerException + * @throws SQLServerException when an error occurs */ abstract SQLServerEncryptionAlgorithm create (SQLServerSymmetricKey columnEncryptionKey,SQLServerEncryptionType encryptionType,String encryptionAlgorithm) throws SQLServerException; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactoryList.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactoryList.java index b1b87aac0..8527d288c 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactoryList.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionAlgorithmFactoryList.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionType.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionType.java index b6c5fe258..886c064ef 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionType.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerEncryptionType.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerException.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerException.java index 0b8f0fb2f..c8390dc9d 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerException.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerException.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java index 5ab7c3738..5a428e5a4 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java index 649feeda1..fbebd8965 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerKeyVaultAuthenticationCallback.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerKeyVaultAuthenticationCallback.java index a8f15b0b2..844d6ec8e 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerKeyVaultAuthenticationCallback.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerKeyVaultAuthenticationCallback.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerMetaData.java index 0a0c97d5f..d95d7ead2 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerMetaData.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerMetaData.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -21,6 +21,11 @@ import java.text.MessageFormat; +/** + * + * This class represents metadata for a column. It is used in the ISQLServerDataRecord interface to pass column metadata to the table-valued parameter. + * + */ public class SQLServerMetaData { String columnName = null; @@ -34,6 +39,11 @@ public class SQLServerMetaData { static final int defaultSortOrdinal = -1; + /** + * Creates a new SQLServerMetaData + * @param columnName the name of the column + * @param sqlType the SQL type of the column + */ public SQLServerMetaData( String columnName, int sqlType) @@ -42,6 +52,13 @@ public SQLServerMetaData( this.javaSqlType = sqlType; } + /** + * creates a new SQLServerMetaData + * @param columnName the name of the column + * @param sqlType the SQL type of the column + * @param precision the precision of the column + * @param scale the scale of the column + */ public SQLServerMetaData( String columnName, int sqlType, @@ -54,6 +71,18 @@ public SQLServerMetaData( this.scale = scale; } + /** + * Creates a new SQLServerMetaData + * @param columnName the name of the column + * @param sqlType the sql type of the column + * @param precision the precision of the column + * @param scale the scale of the column + * @param useServerDefault specifies if this column should use the default server value; Default value is false. + * @param isUniqueKey indicates if the column in the table-valued parameter is unique; Default value is false. + * @param sortOrder indicates the sort order for a column; Default value is SQLServerSortOrder.Unspecified. + * @param sortOrdinal specifies ordinal of the sort column; sortOrdinal starts from 0; Default value is -1. + * @throws SQLServerException when an error occurs + */ public SQLServerMetaData( String columnName, int sqlType, @@ -75,6 +104,10 @@ public SQLServerMetaData( validateSortOrder(); } + /** + * Initializes a new instance of SQLServerMetaData from another SQLServerMetaData object. + * @param sqlServerMetaData the object passed to initialize a new instance of SQLServerMetaData + */ public SQLServerMetaData(SQLServerMetaData sqlServerMetaData) { this.columnName = sqlServerMetaData.columnName; @@ -87,41 +120,73 @@ public SQLServerMetaData(SQLServerMetaData sqlServerMetaData) this.sortOrdinal = sqlServerMetaData.sortOrdinal; } + /** + * + * @return Retrieves the column name. + */ public String getColumName() { return columnName; } + /** + * + * @return Retrieves the java sql type. + */ public int getSqlType() { return javaSqlType; } + /** + * + * @return retrieves the precision of the type passed to the column. + */ public int getPrecision() { return precision; } + /** + * + * @return retrieves the scale of the type passed to the column. + */ public int getScale() { return scale; } + /** + * + * @return returns whether the column uses the default server value. + */ public boolean useServerDefault() { return useServerDefault; } + /** + * + * @return retrieves the whether the column is unique. + */ public boolean isUniqueKey() { return isUniqueKey; } + /** + * + * @return retrieves the sort order. + */ public SQLServerSortOrder getSortOrder() { return sortOrder; } + /** + * + * @return retrieves the sort ordinal. + */ public int getSortOrdinal() { return sortOrdinal; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerNClob.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerNClob.java index 74993d214..9f357ddd9 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerNClob.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerNClob.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java index 7f4a33032..160f19b5c 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerParameterMetaData.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -62,6 +62,11 @@ private synchronized static int nextInstanceID() baseID++; return baseID; } + + /** + * This is a helper function to provide an ID string suitable for tracing. + * @return traceID string + */ final public String toString() { return traceID; @@ -869,7 +874,7 @@ public T unwrap(Class iface) throws SQLException /** * Verify a supplied parameter index is valid * @param param the param index - * @throws SQLServerException + * @throws SQLServerException when an error occurs * @return boolean */ /*L2*/ public boolean isSigned(int param) throws SQLServerException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPooledConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPooledConnection.java index f49c48dcd..9ef8c50fb 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPooledConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPooledConnection.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -64,6 +64,7 @@ public class SQLServerPooledConnection implements PooledConnection { /** * This is a helper function to provide an ID string suitable for tracing. + * @return traceID String */ public String toString() { @@ -78,7 +79,8 @@ private SQLServerConnection createNewConnection() throws SQLException /** * Creates an object handle for the physical connection that this PooledConnection object represents. - * @throws SQLException + * @throws SQLException when an error occurs + * @return a Connection object that is a handle to this PooledConnection object */ public Connection getConnection() throws SQLException { if (pcLogger.isLoggable(Level.FINER)) @@ -174,10 +176,6 @@ void notifyEvent(SQLServerException e) } } - /** - * Registers the given event listener so that it will be notified when an event occurs on this - * PooledConnection object. - */ public void addConnectionEventListener(ConnectionEventListener listener) { if (pcLogger.isLoggable(Level.FINER)) pcLogger.finer(toString() + safeCID()); @@ -187,9 +185,6 @@ public void addConnectionEventListener(ConnectionEventListener listener) { } } - /** - * Closes the physical connection that this PooledConnection object represents. - */ public void close() throws SQLException { if (pcLogger.isLoggable(Level.FINER)) pcLogger.finer(toString() + " Closing physical connection, " + safeCID()); @@ -213,9 +208,6 @@ public void close() throws SQLException { } - /** - * Remove a listener. - */ public void removeConnectionEventListener(ConnectionEventListener listener){ if (pcLogger.isLoggable(Level.FINER)) pcLogger.finer(toString() + safeCID()); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java index dcda8af09..727edbc56 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -30,17 +30,17 @@ * SQLServerPreparedStatement provides JDBC prepared statement functionality. * SQLServerPreparedStatement provides methods for the user to supply parameters as any native * Java type and many Java object types. -*

  • +*

    * SQLServerPreparedStatement prepares a statement using SQL Server's sp_prepexec and re-uses the * returned statement handle for each subsequent execution of the statement (typically * using different parameters provided by the user) -*

  • +*

    * SQLServerPreparedStatement supports batching whereby a set of prepared statements are executed * in a single database round trip to improve runtime performance. -*

  • +*

    * The API javadoc for JDBC API methods that this class implements are not repeated here. Please * see Sun's JDBC API interfaces javadoc for those details. -*

  • +*

    */ public class SQLServerPreparedStatement extends SQLServerStatement implements ISQLServerPreparedStatement @@ -107,7 +107,7 @@ String getClassNameInternal() * @param nRSType the result set type * @param nRSConcur the result set concurrency * @param stmtColEncSetting the statement column encryption setting - * @throws SQLServerException + * @throws SQLServerException when an error occurs */ SQLServerPreparedStatement(SQLServerConnection conn, String sql, int nRSType, int nRSConcur, SQLServerStatementColumnEncryptionSetting stmtColEncSetting) throws SQLServerException @@ -261,8 +261,8 @@ private final boolean buildPreparedStrings(Parameter[] params, boolean renewDefi * Build the parameter type definitons for a JDBC prepared statement that will * be used to prepare the statement. * @param params the statement parameters - * @param renewDefinition - * @throws SQLServerException + * @param renewDefinition True if renewing parameter definition, False otherwise + * @throws SQLServerException when an error occurs. * @return the required data type defintions. */ private String buildParamTypeDefinitions(Parameter[] params, boolean renewDefinition) throws SQLServerException @@ -303,7 +303,7 @@ private String buildParamTypeDefinitions(Parameter[] params, boolean renewDefini /** * Execute a query. * - * @throws SQLServerException + * @throws SQLServerException when an error occurs * @return ResultSet */ public java.sql.ResultSet executeQuery() throws SQLServerException @@ -318,6 +318,7 @@ public java.sql.ResultSet executeQuery() throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "executeQuery"); return resultSet; } + /** * Execute a query without cursoring for metadata. * @@ -331,10 +332,6 @@ final java.sql.ResultSet executeQueryInternal() throws SQLServerException return resultSet; } - /** - * Execute a non query statement - * @return the update count of rows - */ public int executeUpdate() throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "executeUpdate"); @@ -373,7 +370,7 @@ public long executeLargeUpdate() throws SQLServerException /** * Execute a query or non query statement. - * @throws SQLServerException + * @throws SQLServerException when an error occurs * @return true if the statement returned a result set */ public boolean execute() throws SQLServerException @@ -1050,6 +1047,17 @@ public final void setBigDecimal(int n, BigDecimal x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setBigDecimal"); } + /** + * Sets the designated parameter to the given java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public final void setBigDecimal(int n, BigDecimal x, int precision, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1059,6 +1067,19 @@ public final void setBigDecimal(int n, BigDecimal x, int precision, int scale) t loggerExternal.exiting(getClassNameLogging(), "setBigDecimal"); } + /** + * Sets the designated parameter to the given java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setBigDecimal(int n, BigDecimal x, int precision, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1068,6 +1089,15 @@ public final void setBigDecimal(int n, BigDecimal x, int precision, int scale, b loggerExternal.exiting(getClassNameLogging(), "setBigDecimal"); } + /** + * Sets the designated parameter to the given java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @throws SQLServerException when an error occurs + */ public final void setMoney(int n, BigDecimal x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1077,6 +1107,17 @@ public final void setMoney(int n, BigDecimal x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setMoney"); } + /** + * Sets the designated parameter to the given java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setMoney(int n, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1086,6 +1127,15 @@ public final void setMoney(int n, BigDecimal x, boolean forceEncrypt) throws SQL loggerExternal.exiting(getClassNameLogging(), "setMoney"); } + /** + * Sets the designated parameter to the given java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @throws SQLServerException when an error occurs + */ public final void setSmallMoney(int n, BigDecimal x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1095,6 +1145,17 @@ public final void setSmallMoney(int n, BigDecimal x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setSmallMoney"); } + /** + * Sets the designated parameter to the given java.math.BigDecimal value. + * The driver converts this to an SQL NUMERIC value when + * it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setSmallMoney(int n, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1142,6 +1203,17 @@ public final void setBoolean(int n, boolean x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setBoolean"); } + /** + * Sets the designated parameter to the given Java boolean value. + * The driver converts this + * to an SQL BIT or BOOLEAN value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setBoolean(int n, boolean x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1160,6 +1232,17 @@ public final void setByte(int n, byte x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setByte"); } + /** + * Sets the designated parameter to the given Java byte value. + * The driver converts this + * to an SQL TINYINT value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setByte(int n, byte x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1178,6 +1261,18 @@ public final void setBytes(int n, byte x[]) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setBytes"); } + /** + * Sets the designated parameter to the given Java array of bytes. The driver converts + * this to an SQL VARBINARY or LONGVARBINARY + * (depending on the argument's size relative to the driver's limits on + * VARBINARY values) when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setBytes(int n, byte x[], boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1187,6 +1282,13 @@ public final void setBytes(int n, byte x[], boolean forceEncrypt) throws SQLServ loggerExternal.exiting(getClassNameLogging(), "setBytes"); } + /** + * Sets the designated parameter to the given String. The driver converts + * this to an SQL GUID + * @param index the first parameter is 1, the second is 2, ... + * @param guid string representation of the uniqueIdentifier value + * @throws SQLServerException when an error occurs + */ public final void setUniqueIdentifier(int index, String guid) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1196,6 +1298,15 @@ public final void setUniqueIdentifier(int index, String guid) throws SQLServerEx loggerExternal.exiting(getClassNameLogging(), "setUniqueIdentifier"); } + /** + * Sets the designated parameter to the given String. The driver converts + * this to an SQL GUID + * @param index the first parameter is 1, the second is 2, ... + * @param guid string representation of the uniqueIdentifier value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setUniqueIdentifier(int index, String guid, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1214,6 +1325,17 @@ public final void setDouble(int n, double x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setDouble"); } + /** + * Sets the designated parameter to the given Java double value. + * The driver converts this + * to an SQL DOUBLE value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setDouble(int n, double x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1232,6 +1354,17 @@ public final void setFloat(int n, float x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setFloat"); } + /** + * Sets the designated parameter to the given Java float value. + * The driver converts this + * to an SQL REAL value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setFloat(int n, float x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1250,6 +1383,17 @@ public final void setInt(int n, int value) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setInt"); } + /** + * Sets the designated parameter to the given Java int value. + * The driver converts this + * to an SQL INTEGER value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param value the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setInt(int n, int value, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1268,6 +1412,17 @@ public final void setLong(int n, long x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setLong"); } + /** + * Sets the designated parameter to the given Java long value. + * The driver converts this + * to an SQL BIGINT value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setLong(int n, long x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1375,6 +1530,33 @@ public final void setObject(int parameterIndex, Object x, int targetSqlType, int loggerExternal.exiting(getClassNameLogging(), "setObject"); } + /** + *

    Sets the value of the designated parameter with the given object. + * + *

    The given Java object will be converted to the given targetSqlType + * before being sent to the database. + * + * If the object has a custom mapping (is of a class implementing the + * interface SQLData), + * the JDBC driver should call the method SQLData.writeSQL to + * write it to the SQL data stream. + * If, on the other hand, the object is of a class implementing + * Ref, Blob, Clob, NClob, + * Struct, java.net.URL, + * or Array, the driver should pass it to the database as a + * value of the corresponding SQL type. + * + *

    Note that this method may be used to pass database-specific + * abstract data types. + * + * @param parameterIndex the first parameter is 1, the second is 2, ... + * @param x the object containing the input parameter value + * @param targetSqlType the SQL type (as defined in java.sql.Types) to be + * sent to the database. The scale argument may further qualify this type. + * @param precision the precision of the column + * @param scale scale of the column + * @throws SQLServerException when an error occurs + */ public final void setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1405,6 +1587,35 @@ public final void setObject(int parameterIndex, Object x, int targetSqlType, Int loggerExternal.exiting(getClassNameLogging(), "setObject"); } + /** + *

    Sets the value of the designated parameter with the given object. + * + *

    The given Java object will be converted to the given targetSqlType + * before being sent to the database. + * + * If the object has a custom mapping (is of a class implementing the + * interface SQLData), + * the JDBC driver should call the method SQLData.writeSQL to + * write it to the SQL data stream. + * If, on the other hand, the object is of a class implementing + * Ref, Blob, Clob, NClob, + * Struct, java.net.URL, + * or Array, the driver should pass it to the database as a + * value of the corresponding SQL type. + * + *

    Note that this method may be used to pass database-specific + * abstract data types. + * + * @param parameterIndex the first parameter is 1, the second is 2, ... + * @param x the object containing the input parameter value + * @param targetSqlType the SQL type (as defined in java.sql.Types) to be + * sent to the database. The scale argument may further qualify this type. + * @param precision the precision of the column + * @param scale scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setObject(int parameterIndex, Object x, int targetSqlType, Integer precision, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1515,6 +1726,17 @@ public final void setShort(int index, short x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setShort"); } + /** + * Sets the designated parameter to the given Java short value. + * The driver converts this + * to an SQL SMALLINT value when it sends it to the database. + * + * @param index the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setShort(int index, short x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1533,6 +1755,20 @@ public final void setString(int index, String str) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setString"); } + /** + * Sets the designated parameter to the given Java String value. + * The driver converts this + * to an SQL VARCHAR or LONGVARCHAR value + * (depending on the argument's + * size relative to the driver's limits on VARCHAR values) + * when it sends it to the database. + * + * @param index the first parameter is 1, the second is 2, ... + * @param str the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setString(int index, String str, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1552,6 +1788,20 @@ public final void setNString(int parameterIndex, String value) throws SQLExcepti loggerExternal.exiting(getClassNameLogging(), "setNString"); } + /** + * Sets the designated parameter to the given String object. + * The driver converts this to a SQL NCHAR or + * NVARCHAR or LONGNVARCHAR value + * (depending on the argument's + * size relative to the driver's limits on NVARCHAR values) + * when it sends it to the database. + * + * @param parameterIndex of the first parameter is 1, the second is 2, ... + * @param value the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException when an error occurs + */ public final void setNString(int parameterIndex, String value, boolean forceEncrypt) throws SQLException { DriverJDBCVersion.checkSupportsJDBC4(); @@ -1571,6 +1821,14 @@ public final void setTime(int n, java.sql.Time x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setTime"); } + /** + * Sets the designated parameter to the given java.sql.Time value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public final void setTime(int n, java.sql.Time x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1580,6 +1838,16 @@ public final void setTime(int n, java.sql.Time x, int scale) throws SQLServerExc loggerExternal.exiting(getClassNameLogging(), "setTime"); } + /** + * Sets the designated parameter to the given java.sql.Time value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setTime(int n, java.sql.Time x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1598,6 +1866,14 @@ public final void setTimestamp(int n, java.sql.Timestamp x) throws SQLServerExc loggerExternal.exiting(getClassNameLogging(), "setTimestamp"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public final void setTimestamp(int n, java.sql.Timestamp x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1607,6 +1883,16 @@ public final void setTimestamp(int n, java.sql.Timestamp x, int scale) throws S loggerExternal.exiting(getClassNameLogging(), "setTimestamp"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setTimestamp(int n, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1616,6 +1902,13 @@ public final void setTimestamp(int n, java.sql.Timestamp x, int scale, boolean f loggerExternal.exiting(getClassNameLogging(), "setTimestamp"); } + /** + * Sets the designated parameter to the given microsoft.sql.DatetimeOffset value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @throws SQLException if an error occurs. + */ public final void setDateTimeOffset(int n, microsoft.sql.DateTimeOffset x) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1625,6 +1918,14 @@ public final void setDateTimeOffset(int n, microsoft.sql.DateTimeOffset x) thro loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset"); } + /** + * Sets the designated parameter to the given microsoft.sql.DatetimeOffset value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param scale the scale of the column + * @throws SQLException when an error occurs + */ public final void setDateTimeOffset(int n, microsoft.sql.DateTimeOffset x, int scale) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1634,6 +1935,16 @@ public final void setDateTimeOffset(int n, microsoft.sql.DateTimeOffset x, int s loggerExternal.exiting(getClassNameLogging(), "setDateTimeOffset"); } + /** + * Sets the designated parameter to the given microsoft.sql.DatetimeOffset value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException when an error occurs + */ public final void setDateTimeOffset(int n, microsoft.sql.DateTimeOffset x, int scale, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1652,6 +1963,13 @@ public final void setDate(int n, java.sql.Date x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "setDate"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @throws SQLServerException when an error occurs + */ public final void setDateTime(int n, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1661,6 +1979,15 @@ public final void setDateTime(int n, java.sql.Timestamp x) throws SQLServerExce loggerExternal.exiting(getClassNameLogging(), "setDateTime"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setDateTime(int n, java.sql.Timestamp x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1670,6 +1997,13 @@ public final void setDateTime(int n, java.sql.Timestamp x, boolean forceEncrypt) loggerExternal.exiting(getClassNameLogging(), "setDateTime"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @throws SQLServerException when an error occurs + */ public final void setSmallDateTime(int n, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1679,6 +2013,15 @@ public final void setSmallDateTime(int n, java.sql.Timestamp x) throws SQLServe loggerExternal.exiting(getClassNameLogging(), "setSmallDateTime"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setSmallDateTime(int n, java.sql.Timestamp x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -1688,16 +2031,32 @@ public final void setSmallDateTime(int n, java.sql.Timestamp x, boolean forceEnc loggerExternal.exiting(getClassNameLogging(), "setSmallDateTime"); } - public final void setStructured(int n, String tvpName, SQLServerDataTable tvpDataTbale) throws SQLServerException + /** + * Populates a table valued parameter with a data table + * + * @param n the first parameter is 1, the second is 2, ... + * @param tvpName the name of the table valued parameter + * @param tvpDataTable the source datatable object + * @throws SQLServerException when an error occurs + */ + public final void setStructured(int n, String tvpName, SQLServerDataTable tvpDataTable) throws SQLServerException { tvpName = getTVPNameIfNull (n, tvpName); if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) - loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[]{n, tvpName, tvpDataTbale}); + loggerExternal.entering(getClassNameLogging(), "setStructured", new Object[]{n, tvpName, tvpDataTable}); checkClosed(); - setValue(n, JDBCType.TVP, tvpDataTbale, JavaType.TVP, tvpName); + setValue(n, JDBCType.TVP, tvpDataTable, JavaType.TVP, tvpName); loggerExternal.exiting(getClassNameLogging(), "setStructured"); } + /** + * Populates a table valued parameter with a data table + * + * @param n the first parameter is 1, the second is 2, ... + * @param tvpName the name of the table valued parameter + * @param tvpResultSet the source resultset object + * @throws SQLServerException when an error occurs + */ public final void setStructured(int n, String tvpName, ResultSet tvpResultSet) throws SQLServerException { tvpName = getTVPNameIfNull (n, tvpName); @@ -1708,6 +2067,14 @@ public final void setStructured(int n, String tvpName, ResultSet tvpResultSet) t loggerExternal.exiting(getClassNameLogging(), "setStructured"); } + /** + * Populates a table valued parameter with a data table + * + * @param n the first parameter is 1, the second is 2, ... + * @param tvpName the name of the table valued parameter + * @param tvpBulkRecord an ISQLServerDataRecord object + * @throws SQLServerException when an error occurs + */ public final void setStructured(int n, String tvpName, ISQLServerDataRecord tvpBulkRecord) throws SQLServerException { tvpName = getTVPNameIfNull (n, tvpName); @@ -2238,6 +2605,24 @@ public final void setDate(int n, java.sql.Date x, java.util.Calendar cal) throws loggerExternal.exiting(getClassNameLogging(), "setDate"); } + /** + * Sets the designated parameter to the given java.sql.Date value, + * using the given Calendar object. The driver uses + * the Calendar object to construct an SQL DATE value, + * which the driver then sends to the database. With + * a Calendar object, the driver can calculate the date + * taking into account a custom timezone. If no + * Calendar object is specified, the driver uses the default + * timezone, which is that of the virtual machine running the application. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param cal the Calendar object the driver will use + * to construct the date + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setDate(int n, java.sql.Date x, java.util.Calendar cal, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2256,6 +2641,18 @@ public final void setTime(int n, java.sql.Time x, java.util.Calendar cal) throws loggerExternal.exiting(getClassNameLogging(), "setTime"); } + /** + * Sets the designated parameter to the given java.sql.Time value. + * The driver converts this + * to an SQL TIME value when it sends it to the database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param cal the Calendar object the driver will use to construct the date + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setTime(int n, java.sql.Time x, java.util.Calendar cal, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2274,6 +2671,19 @@ public final void setTimestamp(int n, java.sql.Timestamp x, java.util.Calendar c loggerExternal.exiting(getClassNameLogging(), "setTimestamp"); } + /** + * Sets the designated parameter to the given java.sql.Timestamp value. + * The driver + * converts this to an SQL TIMESTAMP value when it sends it to the + * database. + * + * @param n the first parameter is 1, the second is 2, ... + * @param x the parameter value + * @param cal the Calendar object the driver will use to construct the date + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public final void setTimestamp(int n, java.sql.Timestamp x, java.util.Calendar cal, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42.java index ce99fa33e..8b9c5b2c0 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42Helper.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42Helper.java index 902b80057..5867bfd18 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42Helper.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement42Helper.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java index 776b6f184..0d41dcf36 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -377,9 +377,6 @@ protected Object[][] getContents() {"R_certificateStorePlatformInvalid", "Cannot set \"keyStoreAuthentication=CertificateStore\" on a Windows operating system."}, {"R_invalidKeyStoreFile", "Cannot parse \"{0}\". Either the file format is not valid or the password is not correct."}, // for JKS/PKCS {"R_invalidCEKCacheTtl", "Invalid column encryption key cache time-to-live specified. The columnEncryptionKeyCacheTtl value cannot be negative and timeUnit can only be DAYS, HOURS, MINUTES or SECONDS."}, - - // END OF MATERIAL TO LOCALIZE - {"R_sendTimeAsDateTimeForAE", "Use sendTimeAsDateTime=false with Always Encrypted."}, {"R_invalidServerCursorForTVP" , "Use different Connection for source ResultSet and prepared query, if selectMethod is set to cursor for Table-Valued Parameter."}, diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet.java index 1891b3482..8def1cbad 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -630,8 +630,8 @@ public void close() throws SQLServerException /** * Find a column index given a column name - * @param columnName the name - * @throws SQLServerException + * @param columnName the name of the column + * @throws SQLServerException If any errors occur. * @return the column index */ public int findColumn(String columnName) throws SQLServerException @@ -783,7 +783,7 @@ private final Column loadColumn(int index) throws SQLServerException /** * Clear result set warnings - * @throws SQLServerException + * @throws SQLServerException when an error occurs */ /*L0*/ public void clearWarnings() throws SQLServerException { @@ -2467,6 +2467,12 @@ public String getNString(String columnLabel) throws SQLException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a microsoft.sql.datetimeoffset object in the Java programming language. + * @param columnIndex the first column is 1, the second is 2, ... + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLException when an error occurs + */ public String getUniqueIdentifier(int columnIndex) throws SQLException { loggerExternal.entering(getClassNameLogging(), "getUniqueIdentifier", columnIndex); @@ -2476,6 +2482,12 @@ public String getUniqueIdentifier(int columnIndex) throws SQLException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a microsoft.sql.datetimeoffset object in the Java programming language. + * @param columnLabel the name of the column + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLException when an error occurs + */ public String getUniqueIdentifier(String columnLabel) throws SQLException { loggerExternal.entering(getClassNameLogging(), "getUniqueIdentifier", columnLabel); @@ -2561,6 +2573,12 @@ public java.sql.Timestamp getTimestamp(String colName, Calendar cal) throws SQLS return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param columnIndex the first column is 1, the second is 2, ... + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public java.sql.Timestamp getDateTime(int columnIndex) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getDateTime", columnIndex); @@ -2570,6 +2588,12 @@ public java.sql.Timestamp getDateTime(int columnIndex) throws SQLServerException return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param columnName is the name of the column + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public java.sql.Timestamp getDateTime(String columnName) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getDateTime", columnName); @@ -2579,6 +2603,14 @@ public java.sql.Timestamp getDateTime(String columnName) throws SQLServerExcepti return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does not store timezone information. + * @param columnIndex the first column is 1, the second is 2, ... + * @param cal the java.util.Calendar object to use in constructing the dateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public java.sql.Timestamp getDateTime(int columnIndex, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2589,6 +2621,14 @@ public java.sql.Timestamp getDateTime(int columnIndex, Calendar cal) throws SQLS return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * This method uses the given calendar to construct an appropriate millisecond value for the timestamp if the underlying database does not store timezone information. + * @param colName the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column + * @param cal the java.util.Calendar object to use in constructing the dateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public java.sql.Timestamp getDateTime(String colName, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2599,6 +2639,12 @@ public java.sql.Timestamp getDateTime(String colName, Calendar cal) throws SQLSe return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param columnIndex the first column is 1, the second is 2, ... + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public java.sql.Timestamp getSmallDateTime(int columnIndex) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallDateTime", columnIndex); @@ -2608,6 +2654,12 @@ public java.sql.Timestamp getSmallDateTime(int columnIndex) throws SQLServerExce return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param columnName is the name of a column. + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public java.sql.Timestamp getSmallDateTime(String columnName) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallDateTime", columnName); @@ -2617,6 +2669,13 @@ public java.sql.Timestamp getSmallDateTime(String columnName) throws SQLServerEx return value; } + /** + * Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Timestamp object in the Java programming language. + * @param columnIndex the first column is 1, the second is 2, ... + * @param cal the java.util.Calendar object to use in constructing the smalldateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public java.sql.Timestamp getSmallDateTime(int columnIndex, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2627,6 +2686,13 @@ public java.sql.Timestamp getSmallDateTime(int columnIndex, Calendar cal) throws return value; } + /** + * + * @param colName The name of a column + * @param cal the java.util.Calendar object to use in constructing the smalldateTime + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public java.sql.Timestamp getSmallDateTime(String colName, Calendar cal) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -2846,6 +2912,12 @@ public BigDecimal getBigDecimal(String columnName) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param columnIndex The zero-based ordinal of a column. + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException when an error occurs + */ public BigDecimal getMoney(int columnIndex) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getMoney", columnIndex); @@ -2855,6 +2927,12 @@ public BigDecimal getMoney(int columnIndex) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param columnName is the name of a column. + * @return the column value; if the value is SQL NULL, the value returned is null. + * @throws SQLServerException If any errors occur. + */ public BigDecimal getMoney(String columnName) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getMoney", columnName); @@ -2864,6 +2942,12 @@ public BigDecimal getMoney(String columnName) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param columnIndex The zero-based ordinal of a column. + * @return the column value; if the value is SQL NULL, the value returned is null + * @throws SQLServerException If any errors occur. + */ public BigDecimal getSmallMoney(int columnIndex) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallMoney", columnIndex); @@ -2873,6 +2957,12 @@ public BigDecimal getSmallMoney(int columnIndex) throws SQLServerException return value; } + /** + * Retrieves the value of the column specified as a java.math.BigDecimal object. + * @param columnName is the name of a column. + * @return the column value; if the value is SQL NULL, the value returned is null. + * @throws SQLServerException If any errors occur. + */ public BigDecimal getSmallMoney(String columnName) throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getSmallMoney", columnName); @@ -3168,6 +3258,19 @@ public void updateBoolean(int index, boolean x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateBoolean"); } + /** + * Updates the designated column with a boolean value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateBoolean(int index, boolean x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3199,6 +3302,19 @@ public void updateByte(int index, byte x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateByte"); } + /** + * Updates the designated column with a byte value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateByte(int index, byte x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3231,6 +3347,19 @@ public void updateShort(int index, short x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateShort"); } + /** + * Updates the designated column with a short value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateShort(int index, short x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3263,6 +3392,19 @@ public void updateInt(int index, int x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateInt"); } + /** + * Updates the designated column with an int value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateInt(int index, int x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3295,6 +3437,19 @@ public void updateLong(int index, long x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateLong"); } + /** + * Updates the designated column with a long value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateLong(int index, long x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3327,6 +3482,19 @@ public void updateFloat(int index, float x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateFloat"); } + /** + * Updates the designated column with a float value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateFloat(int index, float x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3359,6 +3527,19 @@ public void updateDouble(int index, double x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateDouble"); } + /** + * Updates the designated column with a double value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateDouble(int index, double x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3375,6 +3556,17 @@ public void updateDouble(int index, double x, boolean forceEncrypt) throws SQLSe loggerExternal.exiting(getClassNameLogging(), "updateDouble"); } + /** + * Updates the designated column with a money value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @throws SQLServerException when an error occurs + */ public void updateMoney(int index, BigDecimal x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3390,6 +3582,19 @@ public void updateMoney(int index, BigDecimal x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateMoney"); } + /** + * Updates the designated column with a money value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateMoney(int index, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3405,6 +3610,17 @@ public void updateMoney(int index, BigDecimal x, boolean forceEncrypt) throws SQ loggerExternal.exiting(getClassNameLogging(), "updateMoney"); } + /** + * Updates the designated column with a money value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the column name + * @param x the new column value + * @throws SQLServerException If any errors occur. + */ public void updateMoney(String columnName, BigDecimal x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3420,6 +3636,19 @@ public void updateMoney(String columnName, BigDecimal x) throws SQLServerExcepti loggerExternal.exiting(getClassNameLogging(), "updateMoney"); } + /** + * Updates the designated column with a money value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName the column name + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateMoney(String columnName, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3435,6 +3664,17 @@ public void updateMoney(String columnName, BigDecimal x, boolean forceEncrypt) t loggerExternal.exiting(getClassNameLogging(), "updateMoney"); } + /** + * Updates the designated column with a smallmoney value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @throws SQLServerException when an error occurs + */ public void updateSmallMoney(int index, BigDecimal x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3450,6 +3690,19 @@ public void updateSmallMoney(int index, BigDecimal x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateSmallMoney"); } + /** + * Updates the designated column with a smallmoney value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateSmallMoney(int index, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3465,6 +3718,17 @@ public void updateSmallMoney(int index, BigDecimal x, boolean forceEncrypt) thro loggerExternal.exiting(getClassNameLogging(), "updateSmallMoney"); } + /** + * Updates the designated column with a smallmoney value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName the column name + * @param x the new column value + * @throws SQLServerException If any errors occur. + */ public void updateSmallMoney(String columnName, BigDecimal x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3480,6 +3744,19 @@ public void updateSmallMoney(String columnName, BigDecimal x) throws SQLServerEx loggerExternal.exiting(getClassNameLogging(), "updateSmallMoney"); } + /** + * Updates the designated column with a smallmoney value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName the column name + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateSmallMoney(String columnName, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3511,6 +3788,20 @@ public void updateBigDecimal(int index, BigDecimal x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateBigDecimal"); } + /** + * Updates the designated column with a java.math.BigDecimal + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public void updateBigDecimal(int index, BigDecimal x, Integer precision, Integer scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3529,6 +3820,22 @@ public void updateBigDecimal(int index, BigDecimal x, Integer precision, Integer loggerExternal.exiting(getClassNameLogging(), "updateBigDecimal"); } + /** + * Updates the designated column with a java.math.BigDecimal + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateBigDecimal(int index, BigDecimal x, Integer precision, Integer scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3563,6 +3870,19 @@ public void updateString(int columnIndex, String stringValue) throws SQLServerEx loggerExternal.exiting(getClassNameLogging(), "updateString"); } + /** + * Updates the designated column with a String value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnIndex the first column is 1, the second is 2, ... + * @param stringValue the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateString(int columnIndex, String stringValue, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3596,6 +3916,21 @@ public void updateNString(int columnIndex, String nString) throws SQLException loggerExternal.exiting(getClassNameLogging(), "updateNString"); } + /** + * Updates the designated column with a String value. + * It is intended for use when updating NCHAR,NVARCHAR + * and LONGNVARCHAR columns. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnIndex the first column is 1, the second 2, ... + * @param nString the value for the column to be updated + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted and Always Encrypted is enabled on the connection or on the statement. + * If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException when an error occurs + */ public void updateNString(int columnIndex, String nString, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3630,6 +3965,22 @@ public void updateNString(String columnLabel, String nString) throws SQLExceptio loggerExternal.exiting(getClassNameLogging(), "updateNString"); } + /** + * Updates the designated column with a String value. + * It is intended for use when updating NCHAR,NVARCHAR + * and LONGNVARCHAR columns. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the + * name of the column + * @param nString the value for the column to be updated + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException when an error occurs + */ public void updateNString(String columnLabel, String nString, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3663,6 +4014,19 @@ public void updateBytes(int index, byte x[]) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateBytes"); } + /** + * Updates the designated column with a byte array value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateBytes(int index, byte x[], boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3695,6 +4059,19 @@ public void updateDate(int index, java.sql.Date x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateDate"); } + /** + * Updates the designated column with a java.sql.Date value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateDate(int index, java.sql.Date x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3727,6 +4104,18 @@ public void updateTime(int index, java.sql.Time x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateTime"); } + /** + * Updates the designated column with a java.sql.Time value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public void updateTime(int index, java.sql.Time x, Integer scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3745,6 +4134,20 @@ public void updateTime(int index, java.sql.Time x, Integer scale) throws SQLServ loggerExternal.exiting(getClassNameLogging(), "updateTime"); } + /** + * Updates the designated column with a java.sql.Time value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateTime(int index, java.sql.Time x, Integer scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3779,6 +4182,19 @@ public void updateTimestamp(int index, java.sql.Timestamp x) throws SQLServerExc loggerExternal.exiting(getClassNameLogging(), "updateTimestamp"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public void updateTimestamp(int index, java.sql.Timestamp x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3797,6 +4213,21 @@ public void updateTimestamp(int index, java.sql.Timestamp x, int scale) throws S loggerExternal.exiting(getClassNameLogging(), "updateTimestamp"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateTimestamp(int index, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3815,6 +4246,18 @@ public void updateTimestamp(int index, java.sql.Timestamp x, int scale, boolean loggerExternal.exiting(getClassNameLogging(), "updateTimestamp"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @throws SQLServerException when an error occurs + */ public void updateDateTime(int index, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3831,6 +4274,19 @@ public void updateDateTime(int index, java.sql.Timestamp x) throws SQLServerExce loggerExternal.exiting(getClassNameLogging(), "updateDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public void updateDateTime(int index, java.sql.Timestamp x, Integer scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3849,6 +4305,21 @@ public void updateDateTime(int index, java.sql.Timestamp x, Integer scale) throw loggerExternal.exiting(getClassNameLogging(), "updateDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateDateTime(int index, java.sql.Timestamp x, Integer scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3867,6 +4338,18 @@ public void updateDateTime(int index, java.sql.Timestamp x, Integer scale, boole loggerExternal.exiting(getClassNameLogging(), "updateDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @throws SQLServerException when an error occurs + */ public void updateSmallDateTime(int index, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3883,6 +4366,19 @@ public void updateSmallDateTime(int index, java.sql.Timestamp x) throws SQLServe loggerExternal.exiting(getClassNameLogging(), "updateSmallDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public void updateSmallDateTime(int index, java.sql.Timestamp x, Integer scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3901,6 +4397,21 @@ public void updateSmallDateTime(int index, java.sql.Timestamp x, Integer scale) loggerExternal.exiting(getClassNameLogging(), "updateSmallDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateSmallDateTime(int index, java.sql.Timestamp x, Integer scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3935,6 +4446,13 @@ public void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x) thro loggerExternal.exiting(getClassNameLogging(), "updateDateTimeOffset"); } + /** + * Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal. + * @param index The zero-based ordinal of a column. + * @param x A DateTimeOffset Class object. + * @param scale scale of the column + * @throws SQLException when an error occurs + */ public void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x, Integer scale) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3953,6 +4471,15 @@ public void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x, Inte loggerExternal.exiting(getClassNameLogging(), "updateDateTimeOffset"); } + /** + * Updates the value of the column specified to the DateTimeOffset Class value, given a zero-based column ordinal. + * @param index The zero-based ordinal of a column. + * @param x A DateTimeOffset Class object. + * @param scale scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException when an error occurs + */ public void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x, Integer scale, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3971,6 +4498,17 @@ public void updateDateTimeOffset(int index, microsoft.sql.DateTimeOffset x, Inte loggerExternal.exiting(getClassNameLogging(), "updateDateTimeOffset"); } + /** + * Updates the designated column with a String + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * @param index The zero-based ordinal of a column. + * @param x the new column value + * @throws SQLException when an error occurs + */ public void updateUniqueIdentifier(int index, String x) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -3988,6 +4526,19 @@ public void updateUniqueIdentifier(int index, String x) throws SQLException loggerExternal.exiting(getClassNameLogging(), "updateUniqueIdentifier"); } + /** + * Updates the designated column with a String + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * @param index The zero-based ordinal of a column. + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException when an error occurs + */ public void updateUniqueIdentifier(int index, String x, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4395,6 +4946,20 @@ public void updateObject(int index, Object x, int scale) throws SQLServerExcepti loggerExternal.exiting(getClassNameLogging(), "updateObject"); } + /** + * Updates the designated column with an {@code Object} value. + * + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the {@code updateRow} or + * {@code insertRow} methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException when an error occurs + */ public void updateObject(int index, Object x, int precision, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4406,6 +4971,22 @@ public void updateObject(int index, Object x, int precision, int scale) throws S loggerExternal.exiting(getClassNameLogging(), "updateObject"); } + /** + * Updates the designated column with an {@code Object} value. + * + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the {@code updateRow} or + * {@code insertRow} methods are called to update the database. + * + * @param index the first column is 1, the second is 2, ... + * @param x the new column value + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateObject(int index, Object x, int precision, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4535,6 +5116,19 @@ public void updateBoolean(String columnName, boolean x) throws SQLServerExceptio loggerExternal.exiting(getClassNameLogging(), "updateBoolean"); } + /** + * Updates the designated column with a boolean value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException when an error occurs + */ public void updateBoolean(String columnName, boolean x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4567,6 +5161,20 @@ public void updateByte(String columnName, byte x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateByte"); } + /** + * Updates the designated column with a byte value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * + * @param columnName the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateByte(String columnName, byte x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4599,6 +5207,19 @@ public void updateShort(String columnName, short x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateShort"); } + /** + * Updates the designated column with a short value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateShort(String columnName, short x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4631,6 +5252,19 @@ public void updateInt(String columnName, int x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateInt"); } + /** + * Updates the designated column with an int value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateInt(String columnName, int x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4663,6 +5297,19 @@ public void updateLong(String columnName, long x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateLong"); } + /** + * Updates the designated column with a long value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateLong(String columnName, long x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4695,6 +5342,19 @@ public void updateFloat(String columnName, float x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateFloat"); } + /** + * Updates the designated column with a float value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateFloat(String columnName, float x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4727,6 +5387,19 @@ public void updateDouble(String columnName, double x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateDouble"); } + /** + * Updates the designated column with a double value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateDouble(String columnName, double x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4759,6 +5432,20 @@ public void updateBigDecimal(String columnName, BigDecimal x) throws SQLServerEx loggerExternal.exiting(getClassNameLogging(), "updateBigDecimal"); } + /** + * Updates the designated column with a java.sql.BigDecimal + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateBigDecimal(String columnName, BigDecimal x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4775,6 +5462,21 @@ public void updateBigDecimal(String columnName, BigDecimal x, boolean forceEncry loggerExternal.exiting(getClassNameLogging(), "updateBigDecimal"); } + /** + * Updates the designated column with a java.sql.BigDecimal + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @param x BigDecimal value + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateBigDecimal(String columnName, BigDecimal x, Integer precision, Integer scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4793,6 +5495,23 @@ public void updateBigDecimal(String columnName, BigDecimal x, Integer precision, loggerExternal.exiting(getClassNameLogging(), "updateBigDecimal"); } + /** + * Updates the designated column with a java.sql.BigDecimal + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @param x BigDecimal value + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateBigDecimal(String columnName, BigDecimal x, Integer precision, Integer scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4827,6 +5546,19 @@ public void updateString(String columnName, String x) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateString"); } + /** + * Updates the designated column with a String value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateString(String columnName, String x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4859,6 +5591,20 @@ public void updateBytes(String columnName, byte x[]) throws SQLServerException loggerExternal.exiting(getClassNameLogging(), "updateBytes"); } + /** + * Updates the designated column with a byte array value. + * + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow + * or insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateBytes(String columnName, byte x[], boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4891,6 +5637,19 @@ public void updateDate(String columnName, java.sql.Date x) throws SQLServerExcep loggerExternal.exiting(getClassNameLogging(), "updateDate"); } + /** + * Updates the designated column with a java.sql.Date value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateDate(String columnName, java.sql.Date x, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4923,6 +5682,18 @@ public void updateTime(String columnName, java.sql.Time x) throws SQLServerExcep loggerExternal.exiting(getClassNameLogging(), "updateTime"); } + /** + * Updates the designated column with a java.sql.Time value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateTime(String columnName, java.sql.Time x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4941,6 +5712,20 @@ public void updateTime(String columnName, java.sql.Time x, int scale) throws SQL loggerExternal.exiting(getClassNameLogging(), "updateTime"); } + /** + * Updates the designated column with a java.sql.Time value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateTime(String columnName, java.sql.Time x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4975,6 +5760,19 @@ public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLS loggerExternal.exiting(getClassNameLogging(), "updateTimestamp"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateTimestamp(String columnName, java.sql.Timestamp x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -4993,6 +5791,21 @@ public void updateTimestamp(String columnName, java.sql.Timestamp x, int scale) loggerExternal.exiting(getClassNameLogging(), "updateTimestamp"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateTimestamp(String columnName, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5011,6 +5824,18 @@ public void updateTimestamp(String columnName, java.sql.Timestamp x, int scale, loggerExternal.exiting(getClassNameLogging(), "updateTimestamp"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @throws SQLServerException If any errors occur. + */ public void updateDateTime(String columnName, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5027,6 +5852,19 @@ public void updateDateTime(String columnName, java.sql.Timestamp x) throws SQLSe loggerExternal.exiting(getClassNameLogging(), "updateDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateDateTime(String columnName, java.sql.Timestamp x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5045,6 +5883,21 @@ public void updateDateTime(String columnName, java.sql.Timestamp x, int scale) t loggerExternal.exiting(getClassNameLogging(), "updateDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateDateTime(String columnName, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5063,6 +5916,18 @@ public void updateDateTime(String columnName, java.sql.Timestamp x, int scale, b loggerExternal.exiting(getClassNameLogging(), "updateDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @throws SQLServerException If any errors occur. + */ public void updateSmallDateTime(String columnName, java.sql.Timestamp x) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5079,6 +5944,19 @@ public void updateSmallDateTime(String columnName, java.sql.Timestamp x) throws loggerExternal.exiting(getClassNameLogging(), "updateSmallDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateSmallDateTime(String columnName, java.sql.Timestamp x, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5097,6 +5975,21 @@ public void updateSmallDateTime(String columnName, java.sql.Timestamp x, int sca loggerExternal.exiting(getClassNameLogging(), "updateSmallDateTime"); } + /** + * Updates the designated column with a java.sql.Timestamp + * value. + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the updateRow or + * insertRow methods are called to update the database. + * + * @param columnName is the name of the column + * @param x the new column value + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateSmallDateTime(String columnName, java.sql.Timestamp x, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5131,6 +6024,13 @@ public void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset loggerExternal.exiting(getClassNameLogging(), "updateDateTimeOffset"); } + /** + * Updates the value of the column specified to the DateTimeOffset Class value, given a column name. + * @param columnName The name of a column. + * @param x A DateTimeOffset Class object. + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset x, int scale) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5149,6 +6049,15 @@ public void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset loggerExternal.exiting(getClassNameLogging(), "updateDateTimeOffset"); } + /** + * Updates the value of the column specified to the DateTimeOffset Class value, given a column name. + * @param columnName The name of a column. + * @param x A DateTimeOffset Class object. + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException If any errors occur. + */ public void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset x, int scale, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5167,6 +6076,13 @@ public void updateDateTimeOffset(String columnName, microsoft.sql.DateTimeOffset loggerExternal.exiting(getClassNameLogging(), "updateDateTimeOffset"); } + /** + * Updates the designated column with a Stringvalue. The updater methods are used to update column values in the current row or the insert row. + * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. + * @param columnName The name of a column. + * @param x the new column value + * @throws SQLException If any errors occur. + */ public void updateUniqueIdentifier(String columnName, String x) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5184,6 +6100,15 @@ public void updateUniqueIdentifier(String columnName, String x) throws SQLExcept loggerExternal.exiting(getClassNameLogging(), "updateUniqueIdentifier"); } + /** + * Updates the designated column with a Stringvalue. The updater methods are used to update column values in the current row or the insert row. + * The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. + * @param columnName The name of a column. + * @param x the new column value + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLException If any errors occur. + */ public void updateUniqueIdentifier(String columnName, String x, boolean forceEncrypt) throws SQLException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5218,6 +6143,20 @@ public void updateObject(String columnName, Object x, int scale) throws SQLServe loggerExternal.exiting(getClassNameLogging(), "updateObject"); } + /** + * Updates the designated column with an {@code Object} value. + * + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the {@code updateRow} or + * {@code insertRow} methods are called to update the database. + * + * @param columnName The name of a column. + * @param x the new column value + * @param precision the precision of the column + * @param scale the scale of the column + * @throws SQLServerException If any errors occur. + */ public void updateObject(String columnName, Object x, int precision, int scale) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) @@ -5235,6 +6174,22 @@ public void updateObject(String columnName, Object x, int precision, int scale) loggerExternal.exiting(getClassNameLogging(), "updateObject"); } + /** + * Updates the designated column with an {@code Object} value. + * + * The updater methods are used to update column values in the + * current row or the insert row. The updater methods do not + * update the underlying database; instead the {@code updateRow} or + * {@code insertRow} methods are called to update the database. + * + * @param columnName The name of a column. + * @param x the new column value + * @param precision the precision of the column + * @param scale the scale of the column + * @param forceEncrypt If the boolean forceEncrypt is set to true, the query parameter will only be set if the designation column is encrypted + * and Always Encrypted is enabled on the connection or on the statement. If the boolean forceEncrypt is set to false, the driver will not force encryption on parameters. + * @throws SQLServerException If any errors occur. + */ public void updateObject(String columnName, Object x, int precision, int scale, boolean forceEncrypt) throws SQLServerException { if(loggerExternal.isLoggable(java.util.logging.Level.FINER)) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet42.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet42.java index ef3884a8d..831aeeb47 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet42.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet42.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -31,6 +31,11 @@ */ public class SQLServerResultSet42 extends SQLServerResultSet implements ISQLServerResultSet42{ + /** + * Makes a new result set + * @param stmtIn the generating statement + * @throws SQLServerException when an error occurs + */ public SQLServerResultSet42(SQLServerStatement stmtIn) throws SQLServerException { super(stmtIn); } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSetMetaData.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSetMetaData.java index 86eb33c5d..65c14d2ba 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSetMetaData.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSetMetaData.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -347,7 +347,8 @@ public boolean isSigned(int column) throws SQLServerException /** * Returns true if the column is a SQLServer SparseColumnSet * @param column The column number - * @throws SQLServerException + * @return true if a column in a result set is a sparse column set, otherwise false. + * @throws SQLServerException when an error occurs */ public boolean isSparseColumnSet(int column) throws SQLServerException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSQLXML.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSQLXML.java index c52fe1d75..3e74106ea 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSQLXML.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSQLXML.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -212,7 +212,7 @@ void checkWriteXML() throws SQLException /** * Return an input stream to read data from this SQLXML - * @throws SQLServerException + * @throws SQLException when an error occurs * @return the input stream to that contains the SQLXML data */ public InputStream getBinaryStream() throws SQLException @@ -226,8 +226,7 @@ public InputStream getBinaryStream() throws SQLException /** * Retrieves a stream that can be used to write to the SQLXML value that this SQLXML object represents * The user has to write the BOM for binary streams. - * @param pos the position in the SQLXML value at which to start writing - * @throws SQLException + * @throws SQLException when an error occurs * @return OutputStream */ public java.io.OutputStream setBinaryStream() throws SQLException diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSavepoint.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSavepoint.java index b3746cf06..84ae775d1 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSavepoint.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSavepoint.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -25,7 +25,7 @@ * SQLServerSavepoint implements JDBC 3.0 savepoints. A savepoint is checkpoint to * which a transaction can be rolled back. Savepoints are defined relative * to a connection. -*

  • +*

    * The API javadoc for JDBC API methods that this class implements are not repeated here. Please * see Sun's JDBC API interfaces javadoc for those details. */ @@ -72,6 +72,10 @@ public String getLabel() { return sName; } + /** + * Checks if the savepoint label is null + * @return true is the savepoint is named. Otherwise, false. + */ public boolean isNamed() { return sName!=null; } diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSecurityUtility.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSecurityUtility.java index 9aa1633a9..52c09ee03 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSecurityUtility.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSecurityUtility.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -29,7 +29,10 @@ import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; - +/** + * Various SQLServer security utilities. + * + */ class SQLServerSecurityUtility { /** diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSortOrder.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSortOrder.java index bb103a41d..d35a82e1f 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSortOrder.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSortOrder.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -19,6 +19,11 @@ package com.microsoft.sqlserver.jdbc; +/** + * + * Specifies the sorting order + * + */ public enum SQLServerSortOrder { Ascending (0), Descending (1), diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatement.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatement.java index 9426f3d6c..835995069 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatement.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatement.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -36,15 +36,13 @@ * Documentation for specific public methods that are undocumented can be found under Sun's * standard JDBC documentation for class java.sql.Statement. Those methods are part of Sun's * standard JDBC documentation and therefore their documentation is not duplicated here. -*

  • - *
  • Implementation Notes - *
  • Fetching Result sets -*
  • + *

    Implementation Notes + *

    Fetching Result sets + *

    * The queries first rowset is available immediately after the executeQuery. The first rs.next() * does not make a server round trip. For non server side resultsets the entire result set is in * the rowset. For server side result sets the number of rows in the rowset is set with nFetchSize - *

  • - *
  • + *

    * The API javadoc for JDBC API methods that this class implements are not repeated here. Please * see Sun's JDBC API interfaces javadoc for those details. */ @@ -2023,11 +2021,11 @@ public long[] executeLargeBatch() throws SQLServerException, BatchUpdateExceptio } } // executeLargeBatch -/** - * Return the statement's connection - * @throws SQLServerException - * @return the connection - */ + /** + * Return the statement's connection + * @throws SQLServerException when an error occurs + * @return the connection + */ /*L0*/ public final java.sql.Connection getConnection() throws SQLServerException { loggerExternal.entering(getClassNameLogging(), "getConnection"); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatementColumnEncryptionSetting.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatementColumnEncryptionSetting.java index f9ce5943f..4f317a45a 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatementColumnEncryptionSetting.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerStatementColumnEncryptionSetting.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -19,9 +19,14 @@ package com.microsoft.sqlserver.jdbc; +/** + * Specifies how data will be sent and received when reading and writing encrypted columns. Depending on your specific query, performance impact + * may be reduced by bypassing the Always Encrypted driver processing when non-encrypted columns are being used. Note that these settings cannot + * be used to bypass encryption and gain access to plaintext data. + */ public enum SQLServerStatementColumnEncryptionSetting { /* - * if “Column Encryption Setting=Enabled” in the connection string, use Enabled. Otherwise, maps to Disabled. + * if "Column Encryption Setting=Enabled" in the connection string, use Enabled. Otherwise, maps to Disabled. */ UseConnectionSetting, diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKey.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKey.java index e4aba9f99..ddf81d399 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKey.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKey.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKeyCache.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKeyCache.java index cadce87b9..bbac014af 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKeyCache.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerSymmetricKeyCache.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAConnection.java index 6372d3a43..0f9d44327 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAConnection.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXADataSource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXADataSource.java index 671dbd557..de1d0ea06 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXADataSource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXADataSource.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -35,12 +35,12 @@ * an XAResource object that can be used by a transaction manager to coordinate the work * done on this connection with the other participants in the distributed transaction. * - *

  • Because they extend the PooledConnection interface, XAConnection objects support all + *

    Because they extend the PooledConnection interface, XAConnection objects support all * the methods of PooledConnection objects. They are reusable physical connections to * an underlying data source and produce logical connection handles that can be passed * back to a JDBC application. * - *

  • XAConnection objects are produced by an XADataSource object. There is some similarity + *

    XAConnection objects are produced by an XADataSource object. There is some similarity * between ConnectionPoolDataSource objects and XADataSource objects in that they are * both implemented below a DataSource layer that is visible to the JDBC application. * This architecture allows sqlserver to support distributed transactions in a way diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAResource.java index 141e9c494..9d1671e9a 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerXAResource.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -75,6 +75,11 @@ final class XidImpl implements Xid { /*L0*/ public int getFormatId() { return formatId; } + + /** + * Used for tracing + * @return traceID string + */ public String toString() { return traceID; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SSPIAuthentication.java b/src/main/java/com/microsoft/sqlserver/jdbc/SSPIAuthentication.java index d128d5cf6..60eb80433 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SSPIAuthentication.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SSPIAuthentication.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/ScrollWindow.java b/src/main/java/com/microsoft/sqlserver/jdbc/ScrollWindow.java index 330e3ca55..c524c4a57 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/ScrollWindow.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/ScrollWindow.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SimpleInputStream.java b/src/main/java/com/microsoft/sqlserver/jdbc/SimpleInputStream.java index 406bdb54e..e9798ba16 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SimpleInputStream.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SimpleInputStream.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -161,6 +161,7 @@ final class SimpleInputStream extends BaseInputStream /** * Closes the stream releasing all resources held. + * @exception IOException if an I/O error occurs. */ public void close() throws IOException { @@ -181,6 +182,7 @@ public void close() throws IOException /** * Checks if we have EOS state. + * @exception IOException if an I/O error occurs. */ private final boolean isEOS() throws IOException { diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamColInfo.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamColInfo.java index a233545e7..c24c26c21 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamColInfo.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamColInfo.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamColumns.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamColumns.java index e4b66d239..ac4b52ac4 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamColumns.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamColumns.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamDone.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamDone.java index d57c2a6ad..d4d06881e 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamDone.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamDone.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamError.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamError.java index 1d7b34f18..fca4b22e4 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamError.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamError.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamInfo.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamInfo.java index 19a5f8741..1dd527712 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamInfo.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamInfo.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamLoginAck.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamLoginAck.java index 800b4e99a..ef91c47f0 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamLoginAck.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamLoginAck.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamPacket.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamPacket.java index ca74c7da6..ac7997895 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamPacket.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamPacket.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetStatus.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetStatus.java index 432ccf294..dba94ce74 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetStatus.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetStatus.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetValue.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetValue.java index 23cda8a81..86d442660 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetValue.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamRetValue.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamSSPI.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamSSPI.java index a6e6e7b1a..89f0c3721 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamSSPI.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamSSPI.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/StreamTabName.java b/src/main/java/com/microsoft/sqlserver/jdbc/StreamTabName.java index 6831ccc06..d04d629d6 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/StreamTabName.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/StreamTabName.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/TVP.java b/src/main/java/com/microsoft/sqlserver/jdbc/TVP.java index 0264d49fb..1869b2050 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/TVP.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/TVP.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -34,6 +34,19 @@ enum TVPType Null } +/** + * + * Implementation of Table-valued parameters which provide an easy way to marshal multiple rows of data from a client application to SQL Server + * without requiring multiple round trips or special server-side logic for processing the data. + *

    + * You can use table-valued parameters to encapsulate rows of data in a client application and send the data to the server in a single + * parameterized command. The incoming data rows are stored in a table variable that can then be operated on by using Transact-SQL. + *

    + * Column values in table-valued parameters can be accessed using standard Transact-SQL SELECT statements. Table-valued parameters are + * strongly typed and their structure is automatically validated. The size of table-valued parameters is limited only by server memory. + *

    + * You cannot return data in a table-valued parameter. Table-valued parameters are input-only; the OUTPUT keyword is not supported. + */ class TVP { String TVPName; diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/UDTTDSHeader.java b/src/main/java/com/microsoft/sqlserver/jdbc/UDTTDSHeader.java index 09a77f8b0..9a1c89a8a 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/UDTTDSHeader.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/UDTTDSHeader.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/Util.java b/src/main/java/com/microsoft/sqlserver/jdbc/Util.java index 57e1d0c3d..8e090ea30 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/Util.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/Util.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -30,7 +30,7 @@ import java.io.*; /** - * Various driver utilites. + * Various driver utilities. * */ diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/XMLTDSHeader.java b/src/main/java/com/microsoft/sqlserver/jdbc/XMLTDSHeader.java index 023d2c95f..43c510b55 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/XMLTDSHeader.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/XMLTDSHeader.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/dtv.java b/src/main/java/com/microsoft/sqlserver/jdbc/dtv.java index f113a970c..b69aa4971 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/dtv.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/dtv.java @@ -8,7 +8,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -2871,6 +2871,12 @@ enum Builder BITN (TDSType.BITN, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { if (1 != tdsReader.readUnsignedByte()) @@ -2883,6 +2889,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept INTN (TDSType.INTN, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { switch (tdsReader.readUnsignedByte()) @@ -2910,6 +2922,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept DATE (TDSType.DATEN, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssType = SSType.DATE; @@ -2921,6 +2939,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept BIGBINARY (TDSType.BIGBINARY, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssLenType = SSLenType.USHORTLENTYPE; @@ -2936,6 +2960,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept BIGVARBINARY (TDSType.BIGVARBINARY, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.maxLength = tdsReader.readUnsignedShort(); @@ -2961,6 +2991,12 @@ else if (typeInfo.maxLength <= DataTypes.SHORT_VARTYPE_MAX_BYTES)//for non-PLP t IMAGE (TDSType.IMAGE, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssLenType = SSLenType.LONGLENTYPE; @@ -2974,6 +3010,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept BIGCHAR (TDSType.BIGCHAR, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssLenType = SSLenType.USHORTLENTYPE; @@ -2989,6 +3031,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept BIGVARCHAR (TDSType.BIGVARCHAR, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.maxLength = tdsReader.readUnsignedShort(); @@ -3016,6 +3064,12 @@ else if (typeInfo.maxLength <= DataTypes.SHORT_VARTYPE_MAX_BYTES)//for non-PLP t TEXT (TDSType.TEXT, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssLenType = SSLenType.LONGLENTYPE; @@ -3031,6 +3085,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept NCHAR (TDSType.NCHAR, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssLenType = SSLenType.USHORTLENTYPE; @@ -3046,6 +3106,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept NVARCHAR (TDSType.NVARCHAR, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.maxLength = tdsReader.readUnsignedShort(); @@ -3072,6 +3138,12 @@ else if (typeInfo.maxLength <= DataTypes.SHORT_VARTYPE_MAX_BYTES && 0 == typeInf NTEXT (TDSType.NTEXT, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.ssLenType = SSLenType.LONGLENTYPE; @@ -3087,6 +3159,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept GUID (TDSType.GUID, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { int maxLength = tdsReader.readUnsignedByte(); @@ -3103,6 +3181,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept UDT (TDSType.UDT, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { UDTTDSHeader udtTDSHeader = new UDTTDSHeader(tdsReader); @@ -3134,6 +3218,12 @@ else if (typeInfo.maxLength <= DataTypes.SHORT_VARTYPE_MAX_BYTES) XML (TDSType.XML, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { XMLTDSHeader xmlTDSHeader = new XMLTDSHeader(tdsReader); @@ -3146,6 +3236,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept SQL_VARIANT(TDSType.SQL_VARIANT, new Strategy() { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { // Throw an exception and terminate the connection. Since we don't know @@ -3165,6 +3261,12 @@ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerExcept private interface Strategy { + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException; } @@ -3190,6 +3292,11 @@ private static final class FixedLenStrategy implements Strategy this.scale = scale; } + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) { typeInfo.ssLenType = SSLenType.FIXEDLENTYPE; @@ -3210,6 +3317,12 @@ private static final class DecimalNumericStrategy implements Strategy this.ssType = ssType; } + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { int maxLength = tdsReader.readUnsignedByte(); @@ -3239,6 +3352,12 @@ private static final class BigOrSmallByteLenStrategy implements Strategy this.smallBuilder = smallBuilder; } + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { switch (tdsReader.readUnsignedByte()) // maxLength @@ -3268,6 +3387,12 @@ private int getPrecision(String baseFormat, int scale) return baseFormat.length() + ((scale > 0) ? (1 + scale) : 0); } + /** + * Sets the fields of typeInfo to the correct values + * @param typeInfo the TypeInfo whos values are being corrected + * @param tdsReader the TDSReader used to set the fields of typeInfo to the correct values + * @throws SQLServerException when an error occurs + */ public void apply(TypeInfo typeInfo, TDSReader tdsReader) throws SQLServerException { typeInfo.scale = tdsReader.readUnsignedByte(); diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/tdsparser.java b/src/main/java/com/microsoft/sqlserver/jdbc/tdsparser.java index 37ba8149b..3c8091ec2 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/tdsparser.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/tdsparser.java @@ -14,7 +14,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. diff --git a/src/main/java/microsoft/sql/DateTimeOffset.java b/src/main/java/microsoft/sql/DateTimeOffset.java index 1b4619029..7eef9bbf8 100644 --- a/src/main/java/microsoft/sql/DateTimeOffset.java +++ b/src/main/java/microsoft/sql/DateTimeOffset.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -81,11 +81,23 @@ private DateTimeOffset(java.sql.Timestamp timestamp, int minutesOffset) assert 0 == this.utcMillis % 1000L : "utcMillis: " + this.utcMillis; } + /** + * Converts a java.sql.Timestamp value with an integer offset to the equivalent DateTimeOffset value + * @param timestamp A java.sql.Timestamp value + * @param minutesOffset An integer offset in minutes + * @return The DateTimeOffset value of the input timestamp and minutesOffset + */ public static DateTimeOffset valueOf(java.sql.Timestamp timestamp, int minutesOffset) { return new DateTimeOffset(timestamp, minutesOffset); } + /** + * Converts a java.sql.Timestamp value with a Calendar value to the equivalent DateTimeOffset value + * @param timestamp A java.sql.Timestamp value + * @param calendar A java.util.Calendar value + * @return The DateTimeOffset value of the input timestamp and calendar + */ public static DateTimeOffset valueOf(java.sql.Timestamp timestamp, Calendar calendar) { // (Re)Set the calendar's time to the value in the timestamp so that get(ZONE_OFFSET) and get(DST_OFFSET) report diff --git a/src/main/java/microsoft/sql/Types.java b/src/main/java/microsoft/sql/Types.java index a0db761e3..1553bce12 100644 --- a/src/main/java/microsoft/sql/Types.java +++ b/src/main/java/microsoft/sql/Types.java @@ -6,7 +6,7 @@ // Copyright(c) Microsoft Corporation // All rights reserved. // MIT License -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""), +// 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. @@ -37,13 +37,40 @@ private Types() * that identifies the Microsoft SQL type DATETIMEOFFSET. */ public static final int DATETIMEOFFSET = -155; + + /* + * The constant in the Java programming language, sometimes referred to as a type code, + * that identifies the Microsoft SQL type STRUCTURED. + */ public static final int STRUCTURED = -153; + /* + * The constant in the Java programming language, sometimes referred to as a type code, + * that identifies the Microsoft SQL type DATETIME. + */ public static final int DATETIME = -151; + + /* + * The constant in the Java programming language, sometimes referred to as a type code, + * that identifies the Microsoft SQL type SMALLDATETIME. + */ public static final int SMALLDATETIME = -150; + /* + * The constant in the Java programming language, sometimes referred to as a type code, + * that identifies the Microsoft SQL type MONEY. + */ public static final int MONEY = -148; + + /* + * The constant in the Java programming language, sometimes referred to as a type code, + * that identifies the Microsoft SQL type SMALLMONEY. + */ public static final int SMALLMONEY = -146; + /* + * The constant in the Java programming language, sometimes referred to as a type code, + * that identifies the Microsoft SQL type GUID. + */ public static final int GUID = -145; }