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

Make Ms Jdbc driver more spring friendly - dev #9

Merged
merged 6 commits into from
Nov 25, 2016
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
16 changes: 14 additions & 2 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public final class SQLServerDataTable {
Map<Integer, SQLServerDataColumn> columnMetadata = null;
Map<Integer,Object[]> rows = null;

private String sqlType = null;

/**
* The constant in the Java programming language, sometimes referred to as a type code,
* that identifies the type TVP.
Expand Down Expand Up @@ -235,5 +237,15 @@ else if(val instanceof OffsetTime)
public synchronized Map<Integer, SQLServerDataColumn> getColumnMetadata()
{
return columnMetadata;
}
}
}

public String getSqlType()
{
return sqlType;
}

public void setSqlType(String sqlType)
{
this.sqlType = sqlType;
}
}
5 changes: 4 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/TVP.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ void initTVP(TVPType type, String tvpPartName) throws SQLServerException
// Name used in CREATE TYPE
TVP(String tvpPartName, SQLServerDataTable tvpDataTable) throws SQLServerException
{
initTVP(TVPType.SQLServerDataTable, tvpPartName);
if (tvpPartName == null) {
tvpPartName = tvpDataTable.getSqlType();
}
initTVP(TVPType.SQLServerDataTable, tvpPartName);
sourceDataTable = tvpDataTable;
sourceDataTableRowIterator = sourceDataTable.getIterator();
populateMetadataFromDataTable();
Expand Down