Database Connection

Top  Previous  Next

 

What's a database connection, and how is it different from my database?

 

A database connection is a very important concept.  DWQueryBuilder and your pages must "connect" to your database in order to read and write records.  It's much like a telephone, your pages must "call" your database which will accept the call and then they can have a dialog using that connection.  So the connection is very much like a phone number.  A phone number is a definition of how to reach someone.  It contains information about country codes, area codes, exchanges, and parts that are unique to the number you are calling.  When you store a telephone number in your phone you are creating a connection definition.  So if you store your father's number in your phone you don't need to remember his number any more...  you just have to call "Dad".  If "Dad" changes his number, you simply update the phone number and you keep calling "Dad".

 

Computers use this same technique of storing connection information under a listing (Dad).  This way programs, in our case, web pages, can be written simply to call "Dad".  They don't need to know his number.  We store the number in a "connection" definition, just like storing in your phone's memory.  This way you never have to change the programming, you only have to change the connection number.