1
1
using System ;
2
- using System . Data ;
3
- using System . Reflection ;
4
-
5
- using NHibernate . Dialect ;
6
- using NHibernate . SqlCommand ;
7
2
8
3
namespace NHibernate . Driver
9
4
{
@@ -18,7 +13,8 @@ namespace NHibernate.Driver
18
13
/// the Assembly <c>MySql.Data.dll</c>.
19
14
/// </p>
20
15
/// <p>
21
- /// Please check the products website <a href="http://www.mysql.com/products/connector/net/">http://www.mysql.com/products/connector/net/</a>
16
+ /// Please check the products website
17
+ /// <a href="http://www.mysql.com/products/connector/net/">http://www.mysql.com/products/connector/net/</a>
22
18
/// for any updates and or documentation.
23
19
/// </p>
24
20
/// </remarks>
@@ -31,6 +27,16 @@ public MySqlDataDriver()
31
27
{
32
28
connectionType = System . Type . GetType ( "MySql.Data.MySqlClient.MySqlConnection, MySql.Data" ) ;
33
29
commandType = System . Type . GetType ( "MySql.Data.MySqlClient.MySqlCommand, MySql.Data" ) ;
30
+
31
+ if ( connectionType == null || commandType == null )
32
+ {
33
+ throw new HibernateException (
34
+ "The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found. " +
35
+ "Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll " +
36
+ "are in the Global Assembly Cache or in a location that NHibernate " +
37
+ "can use System.Type.GetType(string) to load the types from."
38
+ ) ;
39
+ }
34
40
}
35
41
36
42
public override System . Type CommandType
@@ -44,26 +50,33 @@ public override System.Type ConnectionType
44
50
}
45
51
46
52
/// <summary>
47
- /// MySqlData does not use named parameters in the sql.
53
+ /// MySql.Data uses named parameters in the sql.
48
54
/// </summary>
49
- /// <value><c>false </c> becuase MySql uses <c>?</c> in the sql.</value>
55
+ /// <value><c>true </c> - MySql uses <c>?</c> in the sql.</value>
50
56
public override bool UseNamedPrefixInSql
51
57
{
52
58
get { return true ; }
53
59
}
54
60
61
+ /// <summary>
62
+ ///
63
+ /// </summary>
55
64
public override bool UseNamedPrefixInParameter
56
65
{
57
66
get { return true ; }
58
67
}
59
68
69
+ /// <summary>
70
+ /// MySql.Data use the <c>?</c> to locate parameters in sql.
71
+ /// </summary>
72
+ /// <value><c>?</c> is used to locate parameters in sql.</value>
60
73
public override string NamedPrefix
61
74
{
62
75
get { return "?" ; }
63
76
}
64
77
65
78
/// <summary>
66
- /// The ByteFX driver does NOT support more than 1 open IDataReader
79
+ /// The MySql.Data driver does NOT support more than 1 open IDataReader
67
80
/// with only 1 IDbConnection.
68
81
/// </summary>
69
82
/// <value><c>false</c> - it is not supported.</value>
@@ -76,6 +89,7 @@ public override bool SupportsMultipleOpenReaders
76
89
/// With the Gamma MySql.Data provider it is throwing an exception with the
77
90
/// message "Expected End of data packet" when a select command is prepared.
78
91
/// </summary>
92
+ /// <value><c>false</c> - it is not supported.</value>
79
93
public override bool SupportsPreparingCommands
80
94
{
81
95
get { return false ; }
0 commit comments