[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Making ODBC connections without explicitly coding a password

Anne Burgess

10/25/2007 11:58:00 AM

We're developing Ruby programs which read and write from/to DB2 tables
on a mainframe. We're the first people in the company to use Ruby so
are rather feeling our way. So far we've been using our own IDs and
passwords, explicitly coded, to make ODBC connections to access
development tables, but I've learnt that due to our security rules I
won't be allowed to know the password for the ID which will access live
tables. Can anyone please suggest a way round explicitly coding the
password? Thank you.
--
Posted via http://www.ruby-....

3 Answers

Todd Benson

10/25/2007 1:50:00 PM

0

On 10/25/07, Anne Burgess <anne@cantsfield.com> wrote:
> We're developing Ruby programs which read and write from/to DB2 tables
> on a mainframe. We're the first people in the company to use Ruby so
> are rather feeling our way. So far we've been using our own IDs and
> passwords, explicitly coded, to make ODBC connections to access
> development tables, but I've learnt that due to our security rules I
> won't be allowed to know the password for the ID which will access live
> tables. Can anyone please suggest a way round explicitly coding the
> password? Thank you.

You can prompt for a password, but of course that doesn't work for
automated scripts.

If your DBAs know what they are doing, then security shouldn't be a
problem with live tables. I'm assuming that you will only be doing
queries and not inserts/updates?

Todd

Jim Clark

10/25/2007 5:25:00 PM

0

Anne Burgess wrote:
> We're developing Ruby programs which read and write from/to DB2 tables
> on a mainframe. We're the first people in the company to use Ruby so
> are rather feeling our way. So far we've been using our own IDs and
> passwords, explicitly coded, to make ODBC connections to access
> development tables, but I've learnt that due to our security rules I
> won't be allowed to know the password for the ID which will access live
> tables. Can anyone please suggest a way round explicitly coding the
> password? Thank you.
>
If you are on Windows, you can set up a system DSN with the username and
password encoded there. Using DBI, you can then just reference the DSN
to access the database such as:

dbh = DBI.connect("DBD:ODBC:myDSN")

HTH,
Jim

Anne Burgess

12/21/2007 2:19:00 PM

0

Jim Clark wrote:
> Anne Burgess wrote:
>> We're developing Ruby programs which read and write from/to DB2 tables
>> on a mainframe. We're the first people in the company to use Ruby so
>> are rather feeling our way. So far we've been using our own IDs and
>> passwords, explicitly coded, to make ODBC connections to access
>> development tables, but I've learnt that due to our security rules I
>> won't be allowed to know the password for the ID which will access live
>> tables. Can anyone please suggest a way round explicitly coding the
>> password? Thank you.
>>
> If you are on Windows, you can set up a system DSN with the username and
> password encoded there. Using DBI, you can then just reference the DSN
> to access the database such as:
>
> dbh = DBI.connect("DBD:ODBC:myDSN")
>
> HTH,
> Jim


Hi Jim

Belated but grateful thanks, this worked very nicely.

Anne
--
Posted via http://www.ruby-....