10 More Discussions You Might Find Interesting
1. HP-UX
I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it.
I want sftp can read a password define in script or from file, so it can... (1 Reply)
Discussion started by: ketanraut
1 Replies
2. UNIX for Dummies Questions & Answers
I am new to Putty, Unix and DB2 and this is what I am working on right now.
I installed Putty
I got access to username / pwd
I got Unix usrname/Pwd.also got the home directory
once I login into putty I get the screen and it shows $ sign
From here how do I connect to DB2 database?
I have... (2 Replies)
Discussion started by: JayDoshi
2 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
I want to launch "ex: http://gmail.com" from the cmd window and validate the credentials with username and password, is it possible?
I have found something like this
"wget --http-user=USER' --http-password=PASSWORD http://gmail.com" am new to this and unable to find a solution, i... (0 Replies)
Discussion started by: harsha85
0 Replies
4. AIX
We have a production server at a client site running AIX. And recently when users are trying to connect to it via telnet, it prompts "No more multiple IP addresses to connect".
Can I know what does this error mean? and how to rectify this?
Thanks. (2 Replies)
Discussion started by: a_sim
2 Replies
5. Shell Programming and Scripting
Hi
i m trying to connect DB2 via unix. it is successfully connect. but the connect is getting disconnect .
below is the query ,
countvalue=$(db2 "connect to <Database> user <username> using <Password>" | db2 -x 'select count(*) from <tablename>' ); echo $countvalue
while... (2 Replies)
Discussion started by: baskivs
2 Replies
6. Shell Programming and Scripting
Hi All,
If someone can help me with password encryption. We have shell scripts that connect to a database using db2 connect and we have the password hardcoded in the script.
Can someone let me know if there's a way to encrypt this password?
I've seen alot of users suggest we create an... (3 Replies)
Discussion started by: rethymno19
3 Replies
7. Shell Programming and Scripting
I want to connect to DB2 database which is mainframes using a unix script and run query and get the result set into the unix box.
Is this acheivable using db2 connect? pls help me with a sample script which can perform the same. (1 Reply)
Discussion started by: midhun19
1 Replies
8. Shell Programming and Scripting
I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password.
If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
Discussion started by: Totengraber
3 Replies
9. Shell Programming and Scripting
Hi ,
I am new to shell script.
I have to write a shell script which will login to remote server then check for the space there. There 50 remote ervers all are having different password.
Could you please suggest me some way. I am working on solaris box.
Thanks in advance (2 Replies)
Discussion started by: vikash_k
2 Replies
10. UNIX for Dummies Questions & Answers
I tried the following script to copy one file automatically:
#!/bin/csh -f
su - root -c "rcp 150.10.128.1:/export/home/sn408Xl/sn408Sol/$fn $fn
This works fine but is there a better way to copy remotely without entering the username and password? Moreover, after the file is copied a... (1 Reply)
Discussion started by: ilak1008
1 Replies
DB2_GET_OPTION(3) 1 DB2_GET_OPTION(3)
db2_get_option - Retrieves an option value for a statement resource or a connection resource
SYNOPSIS
string db2_get_option (resource $resource, string $option)
DESCRIPTION
Retrieves the value of a specified option value for a statement resource or a connection resource.
PARAMETERS
o $resource
- A valid statement resource as returned from db2_prepare(3) or a valid connection resource as returned from db2_connect(3) or
db2_pconnect(3).
o $option
- A valid statement or connection options. The following new options are available as of ibm_db2 version 1.6.0. They provide use-
ful tracking information that can be set during execution with db2_get_option(3).
Note
Prior versions of ibm_db2 do not support these new options.
When the value in each option is being set, some servers might not handle the entire length provided and might truncate the
value.
To ensure that the data specified in each option is converted correctly when transmitted to a host system, use only the
characters A through Z, 0 through 9, and the underscore (_) or period (.).
o $userid
- SQL_ATTR_INFO_USERID - A pointer to a null-terminated character string used to identify the client user ID sent to the
host database server when using DB2 Connect.
Note
DB2 for z/OS and OS/390 servers support up to a length of 16 characters. This user-id is not to be confused with the
authentication user-id, it is for identification purposes only and is not used for any authorization.
o $acctstr
- SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated character string used to identify the client accounting string
sent to the host database server when using DB2 Connect.
Note
DB2 for z/OS and OS/390 servers support up to a length of 200 characters.
o $applname
- SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated character string used to identify the client application name
sent to the host database server when using DB2 Connect.
Note
DB2 for z/OS and OS/390 servers support up to a length of 32 characters.
o $wrkstnname
- SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated character string used to identify the client workstation name
sent to the host database server when using DB2 Connect.
Note
DB2 for z/OS and OS/390 servers support up to a length of 18 characters.
The following table specifies which options are compatible with the available resource types:
Resource-Parameter Matrix
+-----------+--------------------------+---+---+---+
| Key | | | | |
| | | | | |
| | Value | | | |
| | | | | |
| | Resource Type | | | |
| | | | | |
+-----------+--------------------------+---+---+---+
|Connection | | | | |
| | | | | |
| | Statement | | | |
| | | | | |
| | Result Set | | | |
| | | | | |
| userid | | | | |
| | | | | |
| | | | | |
| | SQL_ATTR_INFO_USERID | | | |
| | | | | |
| | X | | | |
| | | | | |
| | X | | | |
| | | | | |
| | - | | | |
| | | | | |
| acctstr | | | | |
| | | | | |
| | | | | |
| | SQL_ATTR_INFO_ACCTSTR | | | |
| | | | | |
| | X | | | |
| | | | | |
| | X | | | |
| | | | | |
| | - | | | |
| | | | | |
| applname | | | | |
| | | | | |
| | | | | |
| | SQL_ATTR_INFO_APPLNAME | | | |
| | | | | |
| | X | | | |
| | | | | |
| | X | | | |
| | | | | |
| | - | | | |
| | | | | |
|wrkstnname | | | | |
| | | | | |
| | | | | |
| | SQL_ATTR_INFO_WRKSTNNAME | | | |
| | | | | |
| | X | | | |
| | | | | |
| | X | | | |
| | | | | |
| | - | | | |
| | | | | |
+-----------+--------------------------+---+---+---+
RETURN VALUES
Returns the current setting of the connection attribute provided on success or FALSE on failure.
EXAMPLES
Example #1
Setting and retrieving parameters through a connection resource
<?php
/* Database Connection Parameters */
$database = 'SAMPLE';
$user = 'db2inst1';
$password = 'ibmdb2';
/* Obtain Connection Resource */
$conn = db2_connect($database, $user, $password);
echo "Client attributes passed through connection string:
";
/* Create the associative options array with valid key-value pairs */
/* Assign the attributes through connection string */
/* Access the options specified */
$options1 = array('userid' => 'db2inst1');
$conn1 = db2_connect($database, $user, $password, $options1);
$val = db2_get_option($conn1, 'userid');
echo $val . "
";
$options2 = array('acctstr' => 'account');
$conn2 = db2_connect($database, $user, $password, $options2);
$val = db2_get_option($conn2, 'acctstr');
echo $val . "
";
$options3 = array('applname' => 'myapp');
$conn3 = db2_connect($database, $user, $password, $options3);
$val = db2_get_option($conn3, 'applname');
echo $val . "
";
$options4 = array('wrkstnname' => 'workstation');
$conn4 = db2_connect($database, $user, $password, $options4);
$val = db2_get_option($conn4, 'wrkstnname');
echo $val . "
";
echo "Client attributes passed post-connection:
";
/* Create the associative options array with valid key-value pairs */
/* Assign the attributes after a connection is made */
/* Access the options specified */
$options5 = array('userid' => 'db2inst1');
$conn5 = db2_connect($database, $user, $password);
$rc = db2_set_option($conn5, $options5, 1);
$val = db2_get_option($conn5, 'userid');
echo $val . "
";
$options6 = array('acctstr' => 'account');
$conn6 = db2_connect($database, $user, $password);
$rc = db2_set_option($conn6, $options6, 1);
$val = db2_get_option($conn6, 'acctstr');
echo $val . "
";
$options7 = array('applname' => 'myapp');
$conn7 = db2_connect($database, $user, $password);
$rc = db2_set_option($conn7, $options7, 1);
$val = db2_get_option($conn7, 'applname');
echo $val . "
";
$options8 = array('wrkstnname' => 'workstation');
$conn8 = db2_connect($database, $user, $password);
$rc = db2_set_option($conn8, $options8, 1);
$val = db2_get_option($conn8, 'wrkstnname');
echo $val . "
";
?>
The above example will output:
Client attributes passed through connection string:
db2inst1
account
myapp
workstation
Client attributes passed post-connection:
db2inst1
account
myapp
workstation
SEE ALSO
db2_connect(3), db2_cursor_type(3), db2_exec(3), db2_set_option(3), db2_pconnect(3), db2_prepare(3).
PHP Documentation Group DB2_GET_OPTION(3)