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.