-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Driver for CoreLab MyDirect MySQL ADO .Net Driver
PostPosted: Thu Jul 31, 2008 10:48 am 
Newbie

Joined: Thu Jul 31, 2008 9:54 am
Posts: 4
My company is using nhibernate along with the CoreLab MyDirect MySQL ADO .net driver (we couldn't open source our app and the licensing fees on the Connector/Net ado driver are ridiculous) So i created a reflection based driver. Everything seems to work okay so i thought i'd post it in case anyone else was trying to do the same thing. (I know it isn't much code and i highly doubt anyone will want to add it to the source base but i figured some other poor schmuck will eventually end up doing this so i mine as well post it somewhere so they can easily find it =))

Any way here it is. Posted under the Public Domain (If i can? Not even sure considering that nhibernate is LGPL so ... essentially do whatever you'd like to with this without violating any of nhibernates license's.)

Code:
Imports NHibernate
Imports NHibernate.Cfg
Public Class myMySQL
    Inherits NHibernate.Driver.ReflectionBasedDriver
    Public Sub New()
        MyBase.New("CoreLab.MySql", "CoreLab.MySql.MySqlConnection", "CoreLab.MySql.MySqlCommand")
    End Sub
    Public Overrides ReadOnly Property NamedPrefix() As String
        Get
            Return "?"
        End Get
    End Property

    Public Overrides ReadOnly Property UseNamedPrefixInParameter() As Boolean
        Get
            Return True
        End Get
    End Property

    Public Overrides ReadOnly Property UseNamedPrefixInSql() As Boolean
        Get
            Return False
        End Get
    End Property

    Public Overrides ReadOnly Property SupportsMultipleOpenReaders() As Boolean
        Get
            Return False
        End Get
    End Property

    Protected Overrides ReadOnly Property SupportsPreparingCommands() As Boolean
        Get
            Return True
        End Get
    End Property

    Public Overrides ReadOnly Property SupportsMultipleQueries() As Boolean
        Get
            Return True
        End Get
    End Property
End Class


The only thing I'd recommend is coming up with a more sane name for it. myMysql is a crappy name i used in my testing code to make sure it was okay. Anyway good luck and I'll answer any questions!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.