If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > ESQL-C Database connectivity

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-17-03, 11:54
aditya aditya is offline
Registered User
 
Join Date: Dec 2003
Posts: 5
ESQL-C Database connectivity

we have an esql-C code which establishes Database connectivity using a structure

EXEC SQL connect to : <database ID>

database ID is in the format Database_Name@Host_name

i wish to know how it is able to establish without us providing username and password. We are currently running this code on a HP-Unix system. Is there some sort of mapping in some system file on our UNIX box, which helps us do this. can some1 elaborate on this?

thnx

./aditya
Reply With Quote
  #2 (permalink)  
Old 12-18-03, 02:29
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi,

You are running an esqlc generated object from the backend itself, while doing so you have already "logged in" as one of the system's authentic user providing a valid password. Right?

So, while you have logged in, you must have derived certain environment variable too. They point you to certain locations and values. CONNECT statement makes use of all these components.

Hence, CONNECT TO 'testdb' ;
does not require user authentication,However:

CONNECT TO 'testdb' USER 'informix' ;
will validate the user authenticity dynamically at runtime.

CONNECT TO 'testdb' USER 'informix' USING USING auth_variable ;
feeds the required information to the connect statement. However, USING clause is unsupported in DB-Access object.

Regards,
Shriyan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On