Connecting to Databases
The process of connecting to a database involves two major steps:
Setup the appropriate database drivers on the server. Iguana supports three database APIs to connect to various databases: Open Database Connectivity (ODBC), MySQL API, and Oracle OCI.
Use a connection object to connect to the database. We strongly recommend using the
db.connect{}
function to create the connection object so that you can use the various methods (ie.conn:query{},
conn:execute{}
,conn:merge{}
, etc.) on the connection object.
Creating a persistent database connection by making the
db.connect{}
call outside ofmain()
is recommended to optimize performance. If not using a persistent database connection you must explicitlyclose()
the connection.Avoid hardcoding the database connection parameters. Use custom fields or environment variables for configurations.
Select the drop downs below for how to setup the required database drivers and connect IguanaX: