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

Lobs tests #168

Merged
merged 5 commits into from
Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
585 changes: 585 additions & 0 deletions src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/lobsTest.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/**
/*
* Microsoft JDBC Driver for SQL Server
*
* Copyright(c) 2016 Microsoft Corporation All rights reserved.
*
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
*/
package com.microsoft.sqlserver.testframework;

Expand All @@ -9,7 +13,7 @@
import java.sql.SQLException;

/**
* @author v-afrafi
* Wrapper class CallableStatement
*
*/
public class DBCallableStatement extends AbstractParentWrapper{
Expand Down Expand Up @@ -66,4 +70,4 @@ public void registerOutParameter(int index, int sqltype) throws SQLException

}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Microsoft JDBC Driver for SQL Server
*
* Copyright(c) 2016 Microsoft Corporation All rights reserved.
*
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
*/
package com.microsoft.sqlserver.testframework;

import java.util.BitSet;

public class DBCoercion {
Class type = null;
protected BitSet flags = new BitSet();
protected String name = null;
// Flags

public static final int GET = 1;
public static final int UPDATE = 2;
public static final int SET = 3;
public static final int SETOBJECT = 4;
public static final int REG = 5;
public static final int GETPARAM = 6;
public static final int UPDATEOBJECT = 7;
public static final int ALL = 8;

public static final int STREAM = 9;
public static final int CHAR = 10;
public static final int NCHAR = 11;
public static final int ASCII = 12;

/**
*
* @param type
*/
public DBCoercion(Class type) {
this(type, new int[] {GET});
}

/**
*
* @param type
* @param tempflags
*/
public DBCoercion(Class type,
int[] tempflags) {
name = type.toString();
type = type;
for (int i = 0; i < tempflags.length; i++)
flags.set(tempflags[i]);
}

/**
* @return type
*/
public Class type() {
return type;
}

/**
* @return
*/
public BitSet flags() {
return flags;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Microsoft JDBC Driver for SQL Server
*
* Copyright(c) 2016 Microsoft Corporation All rights reserved.
*
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
*/
package com.microsoft.sqlserver.testframework;

import java.util.ArrayList;

/**
* DBCoercions
*
*/
public class DBCoercions extends DBItems {

/**
* constructor
*/
public DBCoercions() {
coercionsList = new ArrayList<DBCoercion>();
}

public DBCoercions(DBCoercion coercion) {
this.add(coercion);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* This class holds data for Column. Think about encrypted columns. <B>createCMK code should not add here.</B>
*/
class DBColumn {
public class DBColumn {

/*
* TODO: add nullable, defaultValue, alwaysEncrypted
Expand All @@ -35,7 +35,7 @@ class DBColumn {
/**
* @return the columnName
*/
String getColumnName() {
public String getColumnName() {
return columnName;
}

Expand All @@ -51,7 +51,7 @@ void setColumnName(String columnName) {
*
* @return SqlType for the column
*/
SqlType getSqlType() {
public SqlType getSqlType() {
return sqlType;
}

Expand Down Expand Up @@ -93,4 +93,4 @@ Object getRowValue(int row) {
return columnValues.get(row);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.microsoft.sqlserver.jdbc.SQLServerConnection;
import com.microsoft.sqlserver.jdbc.SQLServerException;
Expand Down Expand Up @@ -116,6 +115,26 @@ public DBPreparedStatement prepareStatement(String query) throws SQLException {
return dbpstmt.prepareStatement(query);
}

/**
*
* @param query
* @param type
* @param concurrency
* @return
* @throws SQLException
*/
public DBPreparedStatement prepareStatement(String query,
int type,
int concurrency) throws SQLException {
// Static for fast-forward, limited settings
if ((type == ResultSet.TYPE_FORWARD_ONLY || type == ResultSet.TYPE_SCROLL_INSENSITIVE))
concurrency = ResultSet.CONCUR_READ_ONLY;

DBPreparedStatement dbpstmt = new DBPreparedStatement(this);

return dbpstmt.prepareStatement(query, type, concurrency);
}

/**
* close connection
*/
Expand Down Expand Up @@ -188,6 +207,7 @@ public DBCallableStatement prepareCall(String query) throws SQLException {

/**
* Retrieve server version
*
* @return server version
* @throws Exception
*/
Expand Down Expand Up @@ -225,4 +245,4 @@ public double getServerVersion() throws Exception {
return serverversion;
}

}
}
Loading