Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: user/pwd in pro*c pgm
I set my user/pass as environment variables and then call them in the program as such
in the script file:
CB_USER=scott_at_ADTD36 CB_PASSWD=tiger1 export CB_USER export CB_PASSWD labor.exe
in the program:
/* set environmental variable to obtain username and password */
char *userptr; char *passptr; userptr = getenv("CB_USER"); passptr = getenv("CB_PASSWD"); EXEC SQL CONNECT :userptr IDENTIFIED BY :passptr; if (sqlca.sqlcode != 0) { sql_error("Unable to connect to ORACLE"); exit(1); }
They are not as secure as being in .rc files, but that is not concern since the server is secure from unauthorized access already. I use this method for file names, and anyother variable, i never embedded things like that in the program itself, habit from mainframe/JCL where nothing is hardcoded into program.
In article <6m907d$dsl$1_at_usenet01.srv.cis.pitt.edu>, "Lisa Lewis"
<lewis_at_med.pitt.edu> wrote:
>I was wondering how others keep there userid/pwd from being embedded in
>pro*c pgms. I know about the $OPS option....how safe is this? Can you
>connect to a database on a different server than the pro*c executable using
>the $OPS method? I have not been able to get this to work. What are other
>options?
>
>Thanks!
>Lisa
>
>
Dan Ramriez
ramdan_at_mailexcite.com
Development Analyst
Information Systems
Commonwealth Edison
The contents of this message express only the sender's opinion. This message does not necessarily reflect the policy or views of my employer, Commonwealth Edison. All responsibility for the statements made in this Usenet posting resides solely and completely with the sender. Received on Thu Jun 18 1998 - 10:30:46 CDT