Intro To Data
The whole focus of this class is leading up to integrating databases with a web site. We've looked at how the front end languages display the layout, colors and receives the content. We've looked at how the database stores data which can be accessed by the controller level. No matter what the language, there needs to be a connection between the server side script server and the database server. Each language creates this connection in its own way. ColdFusion does it by having the server manage "datasources". Each datasource stores the location, username, password and database name in the CF server so that when we are writing code, we can simply reference that datasource without having to put the username and password embedded in the source code. There are plusses and minuses with that approach but it does make thing easier for us as programmers.

Note: Before continuing, please follow these directions:

Open your IDE and navigate to your personal folder.
Open the file called Application.cfc
Near the top of the page will be the line this.dsource = '';. Change that to be your username for this class. (i.e. this.dsource = 'DanCard';)
Also in the Application.cfc, In the function onApplicationStart() you will see the line application.dsource = dsource. Chnage this to be application.dsource = 'yourUserName' ( but type in your actual username )
Open the file .env. Made the line PPWD= the password you got from me at the beginning of the semester.
Use CommandBox to navigate to the root of your local site and restart the server ( server restart).
Everyone in the class has a unique datasource which points to their database. For example, CF has a tag called <cfdbinfo> which allows us to connect to the database and see some of the its contents. In this case, it is set up to use your personal datasource. It matches your login name.

Here are the tables in your database dumped out. (Many of them are system tables and views. We'll get into views later)

Here are the fields in your books table dumped out:

Sorry! I couldn't find your datasource. Please check with Dan about that.
Next week we are going to look at how to insert data into your tables programmatically and extract the data you want on demand. For the mean time, however, we're going to leave it at that.