@@ -723,8 +723,15 @@ SQLRETURN SQLSetConnectAttr(SQLHDBC conn, SQLINTEGER attr, SQLPOINTER value_ptr,
723723 ARROW_LOG (DEBUG) << " SQLSetConnectAttrW called with conn: " << conn
724724 << " , attr: " << attr << " , value_ptr: " << value_ptr
725725 << " , value_len: " << value_len;
726- // GH-47708 TODO: Implement SQLSetConnectAttr
727- return SQL_INVALID_HANDLE;
726+ // GH-47708 TODO: Add tests for SQLSetConnectAttr
727+ using ODBC::ODBCConnection;
728+
729+ return ODBCConnection::ExecuteWithDiagnostics (conn, SQL_ERROR, [=]() {
730+ const bool is_unicode = true ;
731+ ODBCConnection* connection = reinterpret_cast <ODBCConnection*>(conn);
732+ connection->SetConnectAttr (attr, value_ptr, value_len, is_unicode);
733+ return SQL_SUCCESS;
734+ });
728735}
729736
730737// Load properties from the given DSN. The properties loaded do _not_ overwrite existing
@@ -766,8 +773,6 @@ SQLRETURN SQLDriverConnect(SQLHDBC conn, SQLHWND window_handle,
766773 // GH-46560 TODO: Copy connection string properly in SQLDriverConnect according to the
767774 // spec
768775
769- using arrow::flight::sql::odbc::Connection;
770- using arrow::flight::sql::odbc::DriverException;
771776 using ODBC::ODBCConnection;
772777
773778 return ODBCConnection::ExecuteWithDiagnostics (conn, SQL_ERROR, [=]() {
@@ -840,8 +845,6 @@ SQLRETURN SQLConnect(SQLHDBC conn, SQLWCHAR* dsn_name, SQLSMALLINT dsn_name_len,
840845 << " , password: " << static_cast <const void *>(password)
841846 << " , password_len: " << password_len;
842847
843- using arrow::flight::sql::odbc::FlightSqlConnection;
844- using arrow::flight::sql::odbc::config::Configuration;
845848 using ODBC::ODBCConnection;
846849
847850 using ODBC::SqlWcharToString;
0 commit comments