Multiple database support...

Posts   
 
    
castlejoe
User
Posts: 18
Joined: 07-Feb-2005
# Posted on: 10-Feb-2005 19:58:32   

Hello,

Our app runs on multiple dbs, and we have a factory class that based on provider type (like SqlServer, OracleODP, OracleMS, etc) and connection string and returns a correct db helper class. Now with llblgen using the adapter template, if I get it correctly, my factory class would return me the correct DataAccessAdapter based on the provider type. Is this correct? If yes, is there a ready made template that generates me the this factory class that returns me the correct DataAccessAdapter ?

In case I want to have the possibility to use both ODP and DataDirect provider for Oracle, do I have to generate two projects, like it would be 2 different db types?

Thanks, Joe

AlexF
User
Posts: 7
Joined: 05-Jan-2005
# Posted on: 14-Feb-2005 17:11:03   

Hi,

I second that question.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39752
Joined: 17-Aug-2003
# Posted on: 14-Feb-2005 18:12:38   

castlejoe wrote:

Hello,

Our app runs on multiple dbs, and we have a factory class that based on provider type (like SqlServer, OracleODP, OracleMS, etc) and connection string and returns a correct db helper class. Now with llblgen using the adapter template, if I get it correctly, my factory class would return me the correct DataAccessAdapter based on the provider type. Is this correct? If yes, is there a ready made template that generates me the this factory class that returns me the correct DataAccessAdapter ?

Yes Your code then has to use IDataAccessAdapter instead of DataAccessAdapter, so your code is database generic.

There is no template for this, however this is written within 1 minute, just a small class which based on input creates an instance of the correct DataAccessAdapter class.

In case I want to have the possibility to use both ODP and DataDirect provider for Oracle, do I have to generate two projects, like it would be 2 different db types?

Yes, and you keep the database specific project of one and the database specific and database generic project of the other.

After the upgrade currently in development is released I'll release a project converter utility, which converts a project from one db type to another.

Frans Bouma | Lead developer LLBLGen Pro
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 14-Feb-2005 21:46:17   

Otis wrote:

After the upgrade currently in development is released I'll release a project converter utility, which converts a project from one db type to another.

Woah, gotta see this... smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39752
Joined: 17-Aug-2003
# Posted on: 14-Feb-2005 22:07:45   

Devildog74 wrote:

Otis wrote:

After the upgrade currently in development is released I'll release a project converter utility, which converts a project from one db type to another.

Woah, gotta see this... smile

I have a prototype already, written some time ago, but it turned out to be very cumbersome with all the databases supported (all the combinations...)

Recently I discovered I made a design flaw: I should convert all types first to OleDb types, as all database types are mappable to OleDb types. I can then convert that back to native types (with some conversion tables). So that's pretty easy simple_smile (no proc conversion of course) Pack that with some .lpt templates which produce DDL sql and converting from one db to another hasn't been easier simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Alfredo avatar
Alfredo
User
Posts: 46
Joined: 12-Dec-2004
# Posted on: 15-Feb-2005 16:25:56   

I will love to have this Frans....One thing that has me kept away from implementing LLBLGEN in all our projects is the fact that we need to support multiple databases with our products and keeping an exact copy of the structure in each database can become cumbersome. It would be great if we could generate multiple DB support from a single project. Obviously, in order to do that it would be OUR responsability to use only "mappable" datatypes across all our databases (which we actually do....we don't use guids, bit fields, etc).

I was thinking on doing something like this with the templates....but days don't have more than 24 hrs...

Hope to see this soon....if you need any beta tester I'll sign up

Alfredo simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39752
Joined: 17-Aug-2003
# Posted on: 15-Feb-2005 16:59:53   

simple_smile

Well 'soon' as in: first the upgrade that's in development now, and I still hope to have this done (and thus beta start) at the end of february, then this tool has priority, together with another tool, the commandline refresher.

Frans Bouma | Lead developer LLBLGen Pro