Adding Data Sources


This section describes how to add data sources to Lasso 9.

Adding Filemaker, MySQL and SQLite datasources

Adding data sources to Lasso 9 is quicker and simpler than Lasso 8.x as there is only one place you need to go in the Lasso Server Admin to give your code access to your databases. The following example shows you how to create a MySQL data source.

  1. Login to the Lasso 9 Server Admin for your web site (ex. https://www.example.com/lasso9/admin/). If you have not yet configured an administrator user, it should prompt you to do so (see the Installation Guide for more details).
  2. Once logged in, click on the silver tab to the left and select the "Datasources" menu option.
    Admin Data Source Menu
  3. The resulting page lists the various options for connecting to various databases.  You'll note that "SQLiteConnector" already has one host — this is where Lasso 9 stores various preferences, sessions, and other Server Admin functions.
  4. For this example, click MySQLDS to reveal the MySQL hosts and the option to add more hosts. Click the "Add host" button to reveal the options for setting up a host.
    Data Source Add MySQL Host
  5. Fill in the information and click "Add Host." The following information belongs in each of the fields:
    • Name: The domain name or IP address of your database server.
    • Port: The port your server is listening on. MySQL defaults to port 3306, so if you do not know which port, try 3306 for MySQL.
    • Username: This is the database user you wish to use for authenticating to the database.
    • Password: This is the password for the database user that you are using for authentication to the database.
    • Enabled: This is whether or not you want to enable this host to be used by Lasso. You want to leave this as "yes."
  6. Once you click "Add Host," the page will refresh its contents. Click once again on MySQLDS and you will see the host you just created. Click on the host and it will reveal a list of available databases. If you click on a database, it will reveal the tables in that database ("moose" and "hair" in the example below) as well as give you the option disable access to that particular database and change the alias for that database. (The alias is the database name you use in the -database= option in an inline statement. See the Language Guide for more information on the inline tag.)
    MySQL Database Option
Please note that the databases and tables you see will correspond to the privileges setup for the database user you used in step 5 to connect to the database. Please see the documentation for your database to learn how to manage users and privileges for that database.

You have now setup databases in Lasso 9 Server Admin that can be accessed in your code through the use of the inline(-database='database_name' ...) tag. (See the Language Guide for more information on the inline tag.)

Adding JDBC datasources

Adding JDBC data sources follows the same procedure as other data sources, but first one must add the necessary JDBC connector to the JDBCDrivers folder in Lasso9.



    Post a comment

    Your Name or E-mail ID (mandatory)

     

    Note: Your comment will be published after approval of the owner.




     RSS of this page