It's time to complete our RESTful server with database access and web client interface. Let's start:
- We have to modify our TDG to access database data. Open BooksModuleU.pas and drop on the data module and link the components, as follows (this is an extract of the .dfm file):
object BookModule: TBookModule object Conn: TFDConnection Params.Strings = ( 'Server=192.168.1.112' 'Database=delphicookbook' 'User_Name=cookuser' 'Password=cookpass' 'DriverID=MySQL') LoginPrompt = False ConnectedStoredUsage = [auDesignTime] Connected = True end object updBooks: TFDUpdateSQL Connection = Conn end object qryBooks: TFDQuery Connection = Conn UpdateObject = updBooks endendChange the FDConnection params accordingly with your machine. ...