Thanks, this works great. I will also check out the .cfc's.

Is there any AdminAPI docs in the works?


On Sep 9, 10:16 pm, Matthew Woodward <[email protected]> wrote:
> Skellington wrote:
> > Yes, for right now I would like to add a datasource programmatically,
> > also when is the next version expected for release?
>
> No set date on the next version yet, but relatively soon.
>
> Adding a datasource programmatically at this point would be done as follows:
>
> <cfapplication name="OpenBDAdminConsole" sessionmanagement="true" />
> <cfscript>
>     session.auth.password = "admin";
>     session.auth.loggedIn = true;
>     ds = CreateObject("component", "bluedragon.adminapi.Datasource");
>
>     dsinfo = StructNew();
>     dsinfo.name = "myDatasourceName";
>     dsinfo.databasename = "databasename";
>     dsinfo.server = "localhost"; // can also use IP of course
>     dsinfo.port = 3306;
>     dsinfo.username = "user";
>     dsinfo.password = "password;
>     dsinfo.drivername = "com.mysql.jdbc.Driver";
>
>     ds.setDatasource(argumentcollection = dsinfo);
> </cfscript>
>
> There's a ton of additional settings for datasources--check out
> bluedragon/adminapi/Datasource.cfc and look at all the arguments in the
> addDatasource method.
>
> Let me know if that doesn't work. Note that you have to have the
> database created in MySQL first since part of the add is to verify the
> datasource. If the database doesn't exist it'll still add it, but it'll
> try 3 times and throw a big nasty error.
--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to