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

Add SQLServerMetadata constructor to set precision for string types #876

Merged
merged 5 commits into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ public SQLServerMetaData(String columnName, int sqlType, int precision, int scal
this.scale = scale;
}

/**
* Constructs a SQLServerMetaData with the column name, SQL type, and length (for String data).
* The length is used to differentiate large strings from strings with length less than 4000 characters.
*
* @param columnName
* the name of the column
* @param sqlType
* the SQL type of the column
* @param length
* the length of the string type
*/
public SQLServerMetaData(String columnName, int sqlType, int length) {
this.columnName = columnName;
this.javaSqlType = sqlType;
this.precision = length;
}

/**
* Constructs a SQLServerMetaData.
*
Expand Down