Skip to content

Commit

Permalink
Add SQLServerMetadata constructor to set precision for string types (#…
Browse files Browse the repository at this point in the history
…876)

* added contructor for string length

* added comments

* updated javadoc

* updated javadoc
  • Loading branch information
lilgreenbird authored Nov 29, 2018
1 parent 87e69d4 commit bd89a10
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit bd89a10

Please sign in to comment.