How does one connect to a remote database using dbi? 
Author Message
 How does one connect to a remote database using dbi?

I've looked at the examples and I can connect to a local data base.  What is
the syntax for connecting to a remote database using dbi and postgresql?

Thanks
Ernie



Sat, 06 Aug 2005 07:27:16 GMT  
 How does one connect to a remote database using dbi?
connection = DBI.connect('dbi:Pg:dbname=foo;host=foo.bar.com;port=5432',
           'someuser', 'somepassword)
Quote:

> I've looked at the examples and I can connect to a local data base.  What
> is the syntax for connecting to a remote database using dbi and
> postgresql?

> Thanks
> Ernie



Sat, 06 Aug 2005 07:58:56 GMT  
 How does one connect to a remote database using dbi?
Thanks for your help.  I have dbi and postgresql up and running and have
accessed both remote and local data bases, successfully done queries,
inserts, updates, and transactions.
Thanks for all the help.
By the way dbi rocks.

Ernie

Quote:
> connection = DBI.connect('dbi:Pg:dbname=foo;host=foo.bar.com;port=5432',
>            'someuser', 'somepassword)


> > I've looked at the examples and I can connect to a local data base.
What
> > is the syntax for connecting to a remote database using dbi and
> > postgresql?

> > Thanks
> > Ernie



Mon, 08 Aug 2005 00:48:46 GMT  
 How does one connect to a remote database using dbi?

Quote:

> Thanks for your help.  I have dbi and postgresql up and running and have
> accessed both remote and local data bases, successfully done queries,
> inserts, updates, and transactions.
> Thanks for all the help.
> By the way dbi rocks.

> Ernie


> > connection = DBI.connect('dbi:Pg:dbname=foo;host=foo.bar.com;port=5432',
> >            'someuser', 'somepassword)


> > > I've looked at the examples and I can connect to a local data base.
> What
> > > is the syntax for connecting to a remote database using dbi and
> > > postgresql?

> > > Thanks
> > > Ernie

can someone illuminate me as to the advantages of using DBI?  it seems that
for most applications one will make use of vendor specific SQL and thus lose
portability of database code.  am i mistaken to think this way?  personally i
find the postgres module _so_ easy to use it's hard to imagine something
easier...

perplexed.

-a

--
 ====================================
 | Ara Howard
 | NOAA Forecast Systems Laboratory
 | Information and Technology Services
 | Data Systems Group
 | R/FST 325 Broadway
 | Boulder, CO 80305-3328

 | Phone:  303-497-7238
 | Fax:    303-497-7259
 ====================================



Mon, 08 Aug 2005 01:27:28 GMT  
 How does one connect to a remote database using dbi?

Quote:
> can someone illuminate me as to the advantages of using DBI?  it seems that
> for most applications one will make use of vendor specific SQL and thus lose
> portability of database code.  am i mistaken to think this way?  personally i
> find the postgres module _so_ easy to use it's hard to imagine something
> easier...

> perplexed.

> -a

For a consistent API mainly.  It's not uncommon to have multiple DBMS within the
same company.  We mainly use Oracle here at work, but there are also DB2
databases, plus a few folks have created home-grown MS Access (ick) and MySQL
databases.  We currently are using Oracle for our own development team but are
considering a switch to postgres or mysql.

I have no idea if the API between the oracle, postgres and mysql driver are the
same (I doubt it), but by using DBI, I don't need to worry about it.

Regards,

Dan

--
a = [74, 117, 115, 116, 32, 65, 110, 111, 116, 104, 101, 114, 32, 82]
a.push(117,98, 121, 32, 72, 97, 99, 107, 101, 114)
puts a.pack("C*")



Mon, 08 Aug 2005 01:40:23 GMT  
 How does one connect to a remote database using dbi?

Quote:

> > can someone illuminate me as to the advantages of using DBI?  it seems that
> > for most applications one will make use of vendor specific SQL and thus lose
> > portability of database code.  am i mistaken to think this way?  personally i
> > find the postgres module _so_ easy to use it's hard to imagine something
> > easier...

> > perplexed.

> > -a

> For a consistent API mainly.  It's not uncommon to have multiple DBMS within the
> same company.  We mainly use Oracle here at work, but there are also DB2
> databases, plus a few folks have created home-grown MS Access (ick) and MySQL
> databases.  We currently are using Oracle for our own development team but are
> considering a switch to postgres or mysql.

> I have no idea if the API between the oracle, postgres and mysql driver are the
> same (I doubt it), but by using DBI, I don't need to worry about it.

a nice answer which is also convincing.

thanks.

-a

--
 ====================================
 | Ara Howard
 | NOAA Forecast Systems Laboratory
 | Information and Technology Services
 | Data Systems Group
 | R/FST 325 Broadway
 | Boulder, CO 80305-3328

 | Phone:  303-497-7238
 | Fax:    303-497-7259
 ====================================



Mon, 08 Aug 2005 01:44:47 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to connect to sql host using dbi

2. How to connect multiple databases using oratcl

3. ruby dbi obdc driver to remote postgresl (broken)?

4. DBI remote access question

5. Connecting VA to remote DB2

6. Regina Rexx for Windows NT cannot query after connecting to remote Registry

7. Renamed DBI to Ruby/DBI

8. win32net - How to connect to a remote network share from a service

9. Tk remote controller ("connect")

10. Using a remote database and a local one: solution or stupidy?

11. OT: using DBI, SQL driving me crazy

12. Article: Using the Ruby DBI Module

 

 
Powered by phpBB® Forum Software