Commit Graph
33 Commits
Author SHA1 Message Date
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Veerapuram Varadhan 0eed179e75 [bugfix][ado.net odbc]Fixes #676368 - make it thread safe to release
underlying statement handles and check for the validity of the same
before attempting to release them.  Fixes random crashes.
2011-03-22 00:58:08 +05:30
Gert Driesen b53afee2b9 * OdbcCommandTest.cs: Added test for bug #341743.
* OdbcColumn.cs: Treat OdbcType.Numeric as decimal.
* OdbcConnection.cs: Keep (weak) list of commands to allow us to
dispose them (and free their corresponding statement handles) when
the connection is closed. Fixed bug #341743.
* OdbcCommand.cs: Add internal Unlink method that is invoked when the
OdbcConnection is disposed, and which frees the statement handle.
Modified ExecuteNonQuery helper to take CommandBehavior and rename
freeHandle argument to createReader. Added CommandBehavior argument
to ExecSQL. Added FreeStatement overload that takes an option to not
perform an unlink. Fixes bug #3417434.

svn path=/trunk/mcs/; revision=122226
2008-12-30 04:33:40 +00:00
Marek Safar 02e9af391d Warnings cleanup
svn path=/trunk/mcs/; revision=111855
2008-08-28 19:08:55 +00:00
Gert Driesen 5ce6ac40a9 * OdbcTransaction.cs: Use internal CreateOdbcException method on
OdbcConnection to create OdbcException.
* OdbcException.cs: Added support for multiple OdbcError instances
and fixed Message property on 2.0 profile.
* OdbcCommand.cs: Use internal CreateOdbcException method on
OdbcConnection to create OdbcException. Code formatting.
* OdbcError.cs: Moved code to obtain ODBC error info to newly
introduced CreateOdbcException on OdbcConnection. Code formatting.
* OdbcDataReader.cs: Use internal CreateOdbcException method on
OdbcTransaction to create OdbcException.
* OdbcParameterCollection.cs: Removed obsolete Bind method.
* OdbcConnection.cs: Added SafeDriver property that returns
name of driver if available and a zero-length string otherwise.
Use CreateOdbcException method to create OdbcException from ODBC
error info. Added CreateOdbcException method to construct
OdbcException from all available ODBC error info.
* OdbcParameter.cs: Use internal CreateOdbcException method on
OdbcConnection to create OdbcException.

svn path=/trunk/mcs/; revision=98891
2008-03-24 18:56:49 +00:00
Gert Driesen 4adf826c22 * OdbcErrorCollection.cs: Corcompare fixes and code formatting.
* OdbcCommandBuilder.cs: Corcompare fixes and code formatting.
* OdbcPermission.cs: Corcompare fixes and code formatting.
* OdbcDataReader.cs: Corcompare fixes and code formatting.
* OdbcParameterCollection.cs: Corcompare fixes and code formatting.
* OdbcConnection.cs: Corcompare fixes and code formatting. Use
unicode encoding in ChangeDatabase and GetInfo.
* OdbcDataAdapter.cs: Corcompare fixes and code formatting.
* OdbcParameter.cs: Corcompare fixes and code formatting.

svn path=/trunk/mcs/; revision=98817
2008-03-23 09:30:19 +00:00
Veerapuram Varadhan dfc8c26972 ** Fixes #340451.
svn path=/trunk/mcs/; revision=97218
2008-03-03 19:34:36 +00:00
Gert Driesen 3930b4b9cf * System.Data_test.dll.sources: Added DbDataAdapterTest.cs,
OdbcCommandTest.cs, OdbcConnectionTest.cs, OdbcDataAdapterTest.cs, 
OleDbCommandTest.cs, OleDbConnectionTest.cs, OleDbDataAdapterTest.cs, 
SqlDataAdapterTest.cs.
* DbDataAdapter.cs: Implemented UpdateBatchSize setter.
* DataAdapter.cs: In FillLoadOption setter, ensure value is valid.
Modified MissingMappingAction and MissingSchemaAction setters to use
ExceptionHelper.CheckEnumValue to validate value. Spaces to tabs and
code formatting.
* ExceptionHelper.cs: Added CheckEnumValue method and modified
InvalidEnumValueException method to return AORE on 2.0 profile. Added
ConnectionClosed method that returns an InvalidOperationException.
* OleDbDataAdapter.cs: In default ctor, set SelectCommand to null.
Only initialize SelectCommand in ctors. Use direct assignment in
IDbDataAdapter implementation.
* OleDbCommand.cs: Added constant for default CommandTimeout, instead
of using a magic number. Avoid unnecessary initialization. Fixed
default value for DesignTimeVisible. Return zero-length string if
CommandText is null. Added implementation for UpdatedRowSource.
* OleDbConnection.cs: Moved initialization of gda to Open ().
Avoid unnecessary initialization. Return zero-length string if
ConnectionString is null. If getters to Database, DataSource and
Provider return zero-length string if the connection is closed.
In ServerVersion, BeginTransaction and GetSchema, throw an
InvalidOperationException if connection is closed.
* OdbcCommand.cs: Added constant for default CommandTimeout, instead
of using a magic number. Avoid unnecessary initialization. Fixed
default value for DesignTimeVisible. Return zero-length string if
CommandText is null. Spaces to tabs and code formatting.
* OdbcError.cs: Fixed typo in exception message.
* OdbcConnection.cs: Return zero-length string if ConnectionString is
null. In getters for Database, DataSource and Driver return a
zero-length string if connection is closed. In BeginTransaction and
GetSchema throw InvalidOperationException if connection is closed.
Added override for GetSchema (string, string []). Use string.Empty
instead of "".
* OdbcDataAdapter.cs: Avoid unnecessary initializations. Use direct
assignment in IDbDataAdapter implementation. In default ctor, set
SelectCommand to null.
* SqlCommand.cs: Added constant for default CommandTimeout, instead
of using a magic number. Avoid unnecessary initialization. Fixed
default value for DesignTimeVisible. Return zero-length string if
CommandText is null. Use ExceptionHelper.InvalidEnumValueException
to avoid code duplication. Spaces to tabs and code formatting.
* SqlConnection.cs: Use different default package size on 2.0 profile.
Added constants for default values, instead of using magic numbers.
Avoid unnecessary initialization. In PacketSize, return default or
configured packet size when connection is not open. Use 
ExceptionHelper.ConnectionClosed instead of local method. Removed   
use of some hardcoded values in SetDefaultConnectionParameters, and
use Environment.MachineName as default WorkstationId instead of 
DNS host name. Code formatting.
* SqlDataAdapter.cs: In default ctor, set SelectCommand to null.
Avoid unnecessary initializations. Use direct assignment in   
IDbDataAdapter implementation. Fixed exception message for negative
UpdateBatchSize. In Dispose override, make sure to invoke base
method.
* DbDataAdapterTest.cs: Added test for UpdateBatchSize.
* DataAdapterTest.cs: Added tests for AcceptChangesDuringFile,   
AcceptChangesDuringUpdate, ContinueUpdateOnError, FillLoadOption,
MissingMappingAction, MissingSchemaAction and                      
ReturnProviderSpecificTypes.
* OdbcDataAdapterTest.cs: Added tests for ctors, DeleteCommand,
InsertCommand, SelectCommand, UpdateCommand and Dispose.
* OdbcDataReaderTest.cs: fixed line endings.
* OdbcCommandTest.cs: Added tests for ctors and CommantText.
* OdbcConnectionTest.cs: Removed original test that relied on MySQL.
Added ctor tests. Added tests for BeginTransaction, GetSchema and 
ServerVersion with connection that is closed.
* OleDbDataAdapterTest.cs: Added tests for ctors, DeleteCommand, 
InsertCommand, SelectCommand, UpdateCommand and Dispose.
* OleDbCommandTest.cs: Added tests for ctors and CommandText.
* OleDbConnectionTest.cs: Added tests for ctors and ConnectionString. 
Added tests for BeginTransaction, GetSchema and ServerVersion with connection that is closed.
* SqlCommandTest.cs: Added tests for ctors and CommantText. 
* SqlConnectionTest.cs: Added tests for ctors, ConnectionString and 
ServerVersion.
* SqlDataAdapterTest.cs: Added tests for ctors, DeleteCommand,
InsertCommand, SelectCommand, UpdateCommand, UpdateBatchSize and 
Dispose.

svn path=/trunk/mcs/; revision=87859
2007-10-20 23:16:52 +00:00
Gert Driesen d9395404ce * libodbc.cs: Spaces to tabs. Code formatting.
* OdbcConnection.cs: Spaces to tabs. Code formatting.
* OdbcTransaction.cs: Code formatting.

svn path=/trunk/mcs/; revision=87815
2007-10-19 09:06:25 +00:00
Nagappan Alagappan cc7d5ea7c9 2007-09-25 Nagappan A <[email protected]>
* OdbcParameter.cs (ResetOdbcType, ResetDbType): Implemented
	missing methods. 2.0 attribute fixes.

	* OdbcInfoMessageEventArgs.cs (Message, Errors, ToString):
	Implemented missing properties and methods. 2.0 attribute fixes.

	* OdbcConnection.cs (InfoMessage): Added public event and relevant
	private APIs. 2.0 attribute fixes.

	* OdbcConnectionStringBuilder.cs: 2.0 attribute fixes.

	* OdbcParameterCollection.cs (GetParameter, SetParameter):
	Implemented missing 2.0 APIs and 2.0 attribute fixes.

	* OdbcDataReader.cs (finalize): 2.0 compatibility fixes.

	* OdbcPermission.cs (Add): 2.0 compatibility fixes.

	* OdbcCommandBuilder.cs: 2.0 attribute fixes.

	* OdbcRowUpdatingEventArgs.cs (BaseCommand): Added 2.0 property.

	* OdbcCommand.cs: 2.0 attribute fixes.

	* OdbcException.cs: 2.0 attribute fixes.


svn path=/trunk/mcs/; revision=86300
2007-09-25 07:15:03 +00:00
Nagappan Alagappan 384f7840ee 2007-08-13 Nagappan A <[email protected]>
* OdbcMetaDataColumnNames.cs: Added new class.

	* OdbcMetaDataCollectionNames.cs: Added new class.

	* OdbcParameter.cs: 2.0 compatibility changes.

	* OdbcFactory.cs (CreateConnectionStringBuilder)
	(CreatePermission): Implemented new methods.

	* OdbcInfoMessageEventHandler.cs: 2.0 compatibility changes.

	* OdbcConnection.cs: 2.0 compatibility changes.
	(GetSchema): Added new overloaded methods.

	* OdbcConnectionStringBuilder.cs (Driver, Dsn): Added attributes
	as per 2.0 requirement.

	* OdbcDataReader.cs: 2.0 compatibility changes.

	* OdbcCommandBuilder.cs: 2.0 compatibility changes.

	* OdbcCommand.cs: 2.0 compatibility changes.

	* OdbcErrorCollection.cs (CopyTo): Implemented new overloaded
	method.

	* OdbcException.cs: In 2.0 DbException should be inherited instead
	of SystemException.


svn path=/trunk/mcs/; revision=83937
2007-08-13 09:26:24 +00:00
Nagappan Alagappan 46f26bdc82 2007-06-21 Nagappan A <[email protected]>
* OdbcDataReader.cs (GetValue): Patch for varchar longer than 255
	characters, by Mads Bondo Dydensborg <[email protected]>.

	* OdbcConnection.cs: Fixed compiler warning.


svn path=/trunk/mcs/; revision=80429
2007-06-21 10:04:59 +00:00
Senganal T dbcfcb27fe 2006-07-13 Senganal T <[email protected]>
* Test/System.Data.Common/DBDataPermissionTest.cs : Removed invalid tests

	* System.Data.Common/SchemaInfo.cs DbDataAdapter.cs DbConnectionOptions.cs DbParameter.cs 
	DbMetaDataColumnNames.cs DbTransaction.cs DataTableMapping.cs DataAdapter.cs 
	FieldNameLookup.cs DbDataRecord.cs DataColumnMappingCollection.cs DbCommand.cs 
	DbDataPermission.cs DbProviderFactory.cs DbCommandBuilder.cs DbConnectionString.cs 
	RowUpdatedEventArgs.cs DbDataReader.cs DbConnectionStringBuilder.cs DbConnection.cs 
	DataTableMappingCollection.cs :
		2.0 Api fixes

	* System.Data.SqlClient/SqlClientFactory.cs SqlCommand.cs SqlConnectionFactory.cs 
	SqlClientPermission.cs SqlParameterCollection.cs SqlDataReader.cs 
	SqlConnection.cs SqlParameter.cs SqlTransaction.cs :
		2.0 Api fixes

	* System.Data.Odbc/OdbcTransaction.cs OdbcCommand.cs OdbcConnectionFactory.cs 
	OdbcPermission.cs OdbcDataReader.cs OdbcParameterCollection.cs 
	OdbcConnection.cs OdbcFactory.cs OdbcParameter.cs :
		2.0 Api fixes

	* System.Data.OleDb/OleDbCommand : 2.0 Api fixes

	* System.Data.dll.sources: 
		- Added to build :
			System.Data.Common/DbMetaDataColumnNames.cs
		- Removed from build :
			System.Data.Common/DbCommandOptionalFeatures.cs
			System.Data.Common/DbCommandSet.cs
			System.Data.Common/DbProviderSupportedClasses.cs
			System.Data.Common/SchemaLocation.cs
			System.Data.Odbc/OdbcConnectionFactory.cs
			System.Data.SqlClient/SqlConnectionFactory.cs
			System.Data.ProviderBase/DbCommandBase.cs
			System.Data.ProviderBase/DbConnectionBase.cs
			System.Data.ProviderBase/DbConnectionFactory.cs
			System.Data.ProviderBase/DbConnectionInternal.cs
			System.Data.ProviderBase/DbConnectionPoolCounters.cs
			System.Data.ProviderBase/DbConnectionPoolOptions.cs
			System.Data.ProviderBase/DbDataReaderBase.cs
			System.Data.ProviderBase/DbMetaDataFactory.cs
			System.Data.ProviderBase/DbParameterBase.cs
			System.Data.ProviderBase/DbParameterCollectionBase.cs
			System.Data.ProviderBase/DbReferenceCollection.cs

	* Makefile : Add System.Transactions library reference to net_2_0 PROFILE


svn path=/trunk/mcs/; revision=62561
2006-07-13 14:19:17 +00:00
Senganal T 3afc3ef39e 2006-05-09 Senganal T <[email protected]>
* System.Data.Odbc/OdbcConnection.cs : Implemented ChangeDatabase Method
	* System.Data.Odbc/libodbc.cs : Added value for CurrentCatalog in OdbcConnectionAttribute 


svn path=/trunk/mcs/; revision=60432
2006-05-09 09:12:09 +00:00
Gert Driesen 5f2664c2c3 * OdbcConnection.cs: Marked Init helper method private.
* OdbcCommand.cs: Marked BindParameters helper method private.

svn path=/trunk/mcs/; revision=48141
2005-08-08 17:29:27 +00:00
Sureshkumar T 249ad86de4 * OdbcConnection.cs: Open (): set disposed to false so that close
will be called in Dispose.


svn path=/trunk/mcs/; revision=48119
2005-08-08 11:48:14 +00:00
Sureshkumar T 12ea47e504 2005-03-15 Sureshkumar T <[email protected]>
* OdbcConnection.cs: re-throw error on exception in Open method.


svn path=/trunk/mcs/; revision=41836
2005-03-15 15:00:50 +00:00
Sureshkumar T ad03cf4661 In System.Data.ProviderBase:
2005-03-11  Sureshkumar T  <[email protected]>

	* DbConnectionBase.cs : Implemented OnStateChange.

In System.Data.Odbc:
	NET_2_0 uses base class's OnStateChange handler.

svn path=/trunk/mcs/; revision=41679
2005-03-11 07:36:58 +00:00
Sureshkumar T 9edfba2f90 2005-03-11 Sureshkumar T <[email protected]>
* OdbcConnection.cs : notify state change through event. clean up
	handles in case any exception while opening a connection.


svn path=/trunk/mcs/; revision=41678
2005-03-11 07:25:22 +00:00
Sureshkumar T b1ab44391f In .:
2005-03-10  Sureshkumar T  <[email protected]>

	* System.Data.dll.sources: Added
	System.Data.Odbc/OdbcConnectionFactory.cs. 
	System.Data.Odbc/OdbcFactory.cs.

In System.Data.Odbc:
2005-03-10  Sureshkumar T  <[email protected]>

	Migrated core classes to derive from ProviderBase instead of
	implementing IDb* interfaces. Most part of these files have been
	branched with #if NET_2_0/ONLY_1_1. Make sure any changes works
	with both the profiles.

	* OdbcFactory.cs: Concrete Factory for DbProviderFactory. Factory
	to generate Connection,Command,etc.

	* OdbcConnectionFactory.cs: Concrete factory for DbConnectionFactory.

	* OdbcTransaction.cs: migration and overrides.
	* OdbcCommandBuilder.cs: migration and overrides.
	* OdbcDataReader.cs: --do--. no command behavior member as it will
	be maintained in base provider class.
	* OdbcParameterCollection.cs: --do--. Now, local ArrayList is not
	maintained here, instead it is in base class. Most of the methods
	which operated on this list are not needed in NET_2_0.
	* OdbcConnection.cs: Migration. connectionString is maintained in
	DbConnectionBase class.
	* OdbcParameter.cs: Migration. Many of the local members like
	value,sourceColumn are maintained in DbParameterBase.
	* OdbcCommand.cs: Migration. commandText,timeout and
	commandTimeOut are maintained in DbCommandBase class.


svn path=/trunk/mcs/; revision=41643
2005-03-10 12:48:43 +00:00
Sureshkumar T c577c68901 2005-02-04 Sureshkumar T <[email protected]>
Appasamy <[email protected]>

	* OdbcConnection.cs: Implemented properties database, datasource,
	serverversion and driver.
	* libodbc.cs: Added type OdbcInfo and native call SQLGetInfo.


svn path=/trunk/mcs/; revision=40134
2005-02-04 14:23:19 +00:00
Sureshkumar T dc95f1eefb 2004-08-20 Sureshkumar T ([email protected])
* OdbcConnection.cs - correct handles are passed to OdbcError exception to trap the correct error

svn path=/trunk/mcs/; revision=32564
2004-08-20 10:57:52 +00:00
Umadevi S 500a09486f 2004-07-07 Umadevi S ([email protected])
* OdbcConnection.cs - Allowed Close to be called multiple times
                            - Implementation of Dispose method
        (patch submitted by Sebastien Robitaille), corrected a typo

svn path=/trunk/mcs/; revision=30826
2004-07-07 09:19:12 +00:00
Umadevi S 493228944f 2004-07-07 Umadevi S ([email protected])
* OdbcConnection.cs - Allowed Close to be called multiple times
                            - Implementation of Dispose method
	(patch submitted by Sebastien Robitaille)

svn path=/trunk/mcs/; revision=30825
2004-07-07 09:15:52 +00:00
Sureshkumar T 19abd41ef6 2004-06-23 Sureshkumar T ([email protected])
* OdbcConnection.cs: Fix: Moved env allocation to Open method.
                             Disconnection & freeing handles are done in Close
                             method to avoid simultaneous connections.
        * libodbc.cs       : Added constants for odbc version.

svn path=/trunk/mcs/; revision=30161
2004-06-23 05:19:59 +00:00
Sachin Kumar ec81df777c Add license and copyright to all source files in System.Data
svn path=/trunk/mcs/; revision=29688
2004-06-16 13:52:11 +00:00
Umadevi S 01c1457a04 * OdbcParameter.cs: added missing attributes
* OdbcPermission.cs: added missing attributes
       * OdbcConnection.cs: fixes attribute, added missing attributes
       * OdbcInfoMessageEventArgs.cs: removed extra properties, fixed
       API compatibility with MS.NET
       * OdbcCommandBuilder.cs: use correct attributes

svn path=/trunk/mcs/; revision=28684
2004-06-02 05:02:58 +00:00
Umadevi S 02583168f9 2004-05-14 Umadevi S ([email protected])
* OdbcCommand.cs - Added Attributes

svn path=/trunk/mcs/; revision=27390
2004-05-14 11:51:09 +00:00
Gert Driesen 2005bd3e3d * OdbcCommand.cs: No longer use OdbcConnection.Datareader, in order
to fix signature of OdbcConnection
* OdbcDataReader.cs: No longer use ODbcConnection.Datareader, in
order to fix signature of OdbcConnection
* OdbcConnection.cs: Signature fixes: removed DataReader property,
added setter for ConnectionTimeout, made transaction internal
* OdbcParameter.cs: reduced accessibility of Bind method to
internal, added setter for IsNullable
* OdbcParameterCollection.cs: made default ctor and Bind method
internal

svn path=/trunk/mcs/; revision=26991
2004-05-09 16:15:17 +00:00
Brian Ritchie 71d38f2a35 - Transaction Isolation Level is supported
- Fixed TinyInt mapping (Thanks Daniel for finding the bug!)
- ExecuteScalar is supported
- Support CloseConnection CommandBehavior for ExecuteReader
- Implemented full error handling support: OdbcException, OdbcError, OdbcErrorCollection
- Parameter support for all data types (needs further optimization)

svn path=/trunk/mcs/; revision=8429
2002-10-20 19:19:50 +00:00
Brian Ritchie 145480dbde Modified SQLDescribeCol to work around bug in pinvoke...when doing a ref on a typed enum
svn path=/trunk/mcs/; revision=8304
2002-10-16 04:12:35 +00:00
Brian Ritchie f8721edf94 Brian Ritchie
- Added OdbcTransaction Object and moved transaction logic out of connection and into new object.
- Support for DSN-less connection strings
- Fixed OdbcType enum to have correct values
- General cleanup on all objects
- Implemented Cancel in OdbcCommand
- Added DBNull support
- Updated OdbcType enum with values from header files.
- Modified column description code to happen dynamically as a column is accessed
  instead of describing all columns when the query opens
- Works with SqlSharp

Known Issues:
- Transaction Isolation Level isn't handled
- A number of data types are returned as strings instead of native types
- Parameter support is weak -- only supports int types
- ExecuteReader: CommandBehavior isn't implemented
- ExecuteScalar not implemented
- Need better error handling

svn path=/trunk/mcs/; revision=8233
2002-10-14 04:57:06 +00:00
Rodrigo Moya 2ce1d9ef66 2002-10-09 Rodrigo Moya <[email protected]>
* list: added System.Data.Odbc files.

2002-10-09  Brian Ritchie <[email protected]>

	* System.Data.Odbc/*: added first version of ODBC managed provider.

svn path=/trunk/mcs/; revision=8103
2002-10-09 17:15:22 +00:00