Practicability accessing data source informaiton

WellsCarrie

Well-known member
Joined
Jul 12, 2005
Messages
95
Location
Arkansas
Programming Experience
5-10
Practicability accessing data source information

Ok my company has several types of data sources (excel worksheets, oracle databases, SQL databases, DB2, xml, access… the list goes on.) We have a .net class that will pass back a DB2, oracle, or SQL connection object. However we just did a security change and moved some data from one resource to another (some excel became XML, some XML became access, some oracle tables were converted and moved to our SQL servers, etcetera).

What I want to do is map via XML the location of the data to the connection information that any program would need to access it. I’m not talking about writing quieries here. Just something that automatically lets a program know that the Excel document it used to consume is now XML. Like so:

VB.NET:
[FONT=Courier New]<dbConnections xmlns="http://tempuri.org/dbConnections.xsd">[/FONT]
[FONT=Courier New]<dbConnection>[/FONT]
[FONT=Courier New]  <id>0</id>[/FONT]
[FONT=Courier New]  <dataname>OHIOGEN</dataname>[/FONT]
[FONT=Courier New]  <database>ohio.world</database>[/FONT]
[FONT=Courier New]  <connString>*the connection string here*</connString>[/FONT]
[FONT=Courier New]  <type>oracle</type>[/FONT]
[FONT=Courier New]</dbConnection>[/FONT]
[FONT=Courier New]<dbConnection>[/FONT]
[FONT=Courier New]  <id>1</id>[/FONT]
[FONT=Courier New]  <dataname>ODC_OUT</dataname>[/FONT]
[FONT=Courier New]  <database>ODC_OUT</database>[/FONT]
[FONT=Courier New]  <connString>*the connection string here*</connString>[/FONT]
[FONT=Courier New]  <type>siims</type>[/FONT]
[FONT=Courier New]</dbConnection>[/FONT]
[FONT=Courier New]<dbConnection>[/FONT]
[FONT=Courier New]  <id>2</id>[/FONT]
[FONT=Courier New]  <database>maingen</database>[/FONT]
[FONT=Courier New]  <database>main.world</database>[/FONT]
[FONT=Courier New]  <connString>*the connection string here*</connString>[/FONT]
[FONT=Courier New]  <type>oracle</type>[/FONT]
[FONT=Courier New]</dbConnection>[/FONT]
[FONT=Courier New]<dbConnection>[/FONT]
[FONT=Courier New]  <id>3</id>[/FONT]
[FONT=Courier New]  <database>loftwarePalletID</database>[/FONT]
[FONT=Courier New]  <database>loftwareMDB</database>[/FONT]
[FONT=Courier New]  <connString>*the connection string here*</connString>[/FONT]
[FONT=Courier New]  <type>access</type>[/FONT]
[FONT=Courier New]</dbConnection>[/FONT]
[FONT=Courier New]<dbConnection>[/FONT]
[FONT=Courier New]  <id>4</id>[/FONT]
[FONT=Courier New]  <database>comlogErrors</database>[/FONT]
[FONT=Courier New]  <database>comlog</database>[/FONT]
[FONT=Courier New]  <connString>*the connection string here*</connString>[/FONT]
[FONT=Courier New]  <type>XML</type>[/FONT]
[FONT=Courier New]</dbConnection>[/FONT]
[FONT=Courier New]</dbConnections>[/FONT]

Comlog used to be an flat file that is now being written out as XML. A change I made so more than one process could report off of it at a time.

My idea is to keep this XML file and schema in ONE central location. Have a class that reads the XML for the key value or the database value and return the information needed to consume and use the data in an app.

Then all the developers could check the type value and create only the objects required for data consumption. And if written assuming any of our types is possible then they would not have to rewrite application code to handle data source changes only when a new type (say web service) is added to our list.

All this being said, is this feasible or would the amount of coding needed to allow all my type possibilities too much?

Sorry for the long winded post I want to explain my thoughts as best as possible.

Thanks!
Carrie
 
Last edited:
Back
Top