Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfscript>
- writeOutput('starting db source installation...<br/ >');
- function createDSN( name ) {
- // Login is always required. This example uses two lines of code.
- adminObj = createObject("component","cfide.adminapi.administrator");
- adminObj.login("pete", "admin");
- // Instantiate the data source object.
- myObj = createObject("component","cfide.adminapi.datasource");
- // Create a DSN.
- myObj.setMYSQL5(
- name="dsn#ARGUMENTS.name#",
- host="127.0.0.1",
- database=ARGUMENTS.name,
- username="pete",
- password="pete"
- );
- writeOutput('<br />created #ARGUMENTS.name# datasource');
- }
- arr_names = [
- 'books',
- 'authors'
- ];
- for( name in arr_names ) {
- createDSN( name );
- }
- writeOutput('<br />completed');
- </cfscript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement