[dancer-users] DBD::Proxy with Dancer

David Precious davidp at preshweb.co.uk
Mon Nov 11 17:18:22 GMT 2013


On Fri, 08 Nov 2013 23:28:03 +0100
Hugues <hugues at max4mail.com> wrote:

> Hello
> I use my  DBD::Proxy to connect my program to ODBC Access Database.
> with:
> 
> my $dsn      = "DBI:Proxy:hostname=$IP;port=$PORT;dsn=DBI:ODBC:$ODBC";
> my $dbh = DBI->connect($dsn, "", "") || die "Erreur de connexion à la
> base"; $dbh->{AutoCommit} = 1;
>          $dbh->{RaiseError} = 1;
> 
> I would like to transpose this  same connection using Dancer,  in 
> config.yml, but I do not arrive to pass good settings.
> login and password are empty
> 
> plugins:
>      Database:
>          connections:
>                     accesssav:
>                            driver: 
> "Proxy:hostname=192.168.0.19;port=2000;dsn=DBI:ODBC:accesssav"
>                            database: 'accesssav'

You have a pre-crafted DSN, so you want to just use
Dancer::Plugin::Database's "dsn" config option, like so:

  plugins:
      Database:
          connections:
              accessav:
                  dsn: "DBI:Proxy:hostname=...."
                
That should get it working for you.




-- 
David Precious ("bigpresh") <davidp at preshweb.co.uk>
http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan        www.preshweb.co.uk/github




More information about the dancer-users mailing list