Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

moving driver specific functions #10

Merged
merged 7 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@
*
*/
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 <code>CallableStatement</code>
*/
public void setDateTimeOffset(String parameterName,
microsoft.sql.DateTimeOffset x) throws SQLException;

/**
* Gets the DateTimeOffset value of parameter with index parameterIndex
*
Expand All @@ -54,79 +40,6 @@ public void setDateTimeOffset(String parameterName,
* <code>CallableStatement</code>
*/
public microsoft.sql.DateTimeOffset getDateTimeOffset(String parameterName) throws SQLException;

public void registerOutParameter(int index,
SQLType sqlType) throws SQLServerException;

public void registerOutParameter(int index,
SQLType sqlType,
String typeName) throws SQLServerException;

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.
* <p>
* 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
Expand All @@ -150,7 +63,6 @@ public void registerOutParameter(String parameterName,
SQLType sqlType,
int precision,
int scale) throws SQLServerException;

public void registerOutParameter(String parameterName,
SQLType sqlType) throws SQLServerException;


}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package com.microsoft.sqlserver.jdbc;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLType;

Expand All @@ -26,15 +28,6 @@ public interface ISQLServerPreparedStatement extends java.sql.PreparedStatement,
public void setDateTimeOffset(int parameterIndex,
microsoft.sql.DateTimeOffset x) throws SQLException;

public void setObject(int index,
Object obj,
SQLType jdbcType) throws SQLServerException;

public void setObject(int parameterIndex,
Object x,
SQLType targetSqlType,
int scaleOrLength) throws SQLServerException;

/**
* Sets the value of the designated parameter with the given object.
*
Expand Down Expand Up @@ -95,4 +88,152 @@ public void setObject(int parameterIndex,
Integer precision,
Integer scale,
boolean forceEncrypt) throws SQLServerException;

public int getPreparedStatementHandle() throws SQLServerException;

public void setBigDecimal(int n,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add JavaDocs wherever applicable.

BigDecimal x,
int precision,
int scale) throws SQLException;

public void setBigDecimal(int n,
BigDecimal x,
int precision,
int scale,
boolean forceEncrypt) throws SQLException;

public void setMoney(int n,
BigDecimal x) throws SQLException;

public void setMoney(int n,
BigDecimal x,
boolean forceEncrypt) throws SQLException;

public void setSmallMoney(int n,
BigDecimal x) throws SQLException;

public void setSmallMoney(int n,
BigDecimal x,
boolean forceEncrypt) throws SQLException;

public void setBoolean(int n,
boolean x,
boolean forceEncrypt) throws SQLException;

public void setByte(int n,
byte x,
boolean forceEncrypt) throws SQLException;

public void setBytes(int n,
byte x[],
boolean forceEncrypt) throws SQLException;

public void setUniqueIdentifier(int index,
String guid) throws SQLException;

public void setUniqueIdentifier(int index,
String guid,
boolean forceEncrypt) throws SQLException;

public void setDouble(int n,
double x,
boolean forceEncrypt) throws SQLException;

public void setFloat(int n,
float x,
boolean forceEncrypt) throws SQLException;

public void setGeometry(int n,
Geometry x) throws SQLException;

public void setGeography(int n,
Geography x) throws SQLException;

public void setInt(int n,
int value,
boolean forceEncrypt) throws SQLException;

public void setLong(int n,
long x,
boolean forceEncrypt) throws SQLException;

public void setShort(int index,
short x,
boolean forceEncrypt) throws SQLException;

public void setString(int index,
String str,
boolean forceEncrypt) throws SQLException;

public void setNString(int parameterIndex,
String value,
boolean forceEncrypt) throws SQLException;

public void setTime(int n,
java.sql.Time x,
int scale) throws SQLException;

public void setTime(int n,
java.sql.Time x,
int scale,
boolean forceEncrypt) throws SQLException;

public void setTimestamp(int n,
java.sql.Timestamp x,
int scale) throws SQLException;

public void setTimestamp(int n,
java.sql.Timestamp x,
int scale,
boolean forceEncrypt) throws SQLException;

public void setDateTimeOffset(int n,
microsoft.sql.DateTimeOffset x,
int scale) throws SQLException;

public void setDateTimeOffset(int n,
microsoft.sql.DateTimeOffset x,
int scale,
boolean forceEncrypt) throws SQLException;

public void setDateTime(int n,
java.sql.Timestamp x) throws SQLException;

public void setDateTime(int n,
java.sql.Timestamp x,
boolean forceEncrypt) throws SQLException;

public void setSmallDateTime(int n,
java.sql.Timestamp x) throws SQLException;

public void setSmallDateTime(int n,
java.sql.Timestamp x,
boolean forceEncrypt) throws SQLException;

public void setStructured(int n,
String tvpName,
SQLServerDataTable tvpDataTable) throws SQLException;

public void setStructured(int n,
String tvpName,
ResultSet tvpResultSet) throws SQLException;

public void setStructured(int n,
String tvpName,
ISQLServerDataRecord tvpBulkRecord) throws SQLException;

public void setDate(int n,
java.sql.Date x,
java.util.Calendar cal,
boolean forceEncrypt) throws SQLException;

public void setTime(int n,
java.sql.Time x,
java.util.Calendar cal,
boolean forceEncrypt) throws SQLException;

public void setTimestamp(int n,
java.sql.Timestamp x,
java.util.Calendar cal,
boolean forceEncrypt) throws SQLException;
}