10-10-2013
Connect to Remote DB2 ,using URL ,username,Password
Hi All,
I am new to Shell scripting,
I want to connect to DB2 database through URL,username and password
Please help me out.
I read so many posts in that there is no where it is mentioned about how to connect to a remote database.
Thanks in advance
10 More Discussions You Might Find Interesting
1. 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
2. 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
3. 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
4. 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
5. 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
6. 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
7. 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
8. 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
9. 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
10. 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
LEARN ABOUT PHP
dbx_connect
DBX_CONNECT(3) 1 DBX_CONNECT(3)
dbx_connect - Open a connection/database
SYNOPSIS
object dbx_connect (mixed $module, string $host, string $database, string $username, string $password, [int $persistent])
DESCRIPTION
Opens a connection to a database.
PARAMETERS
o $module
- The $module parameter can be either a string or a constant, though the latter form is preferred. The possible values are given
below, but keep in mind that they only work if the module is actually loaded.
o DBX_MYSQL or "mysql"
o DBX_ODBC or "odbc"
o DBX_PGSQL or "pgsql"
o DBX_MSSQL or "mssql"
o DBX_FBSQL or "fbsql"
o DBX_SYBASECT or "sybase_ct"
o DBX_OCI8 or "oci8"
o DBX_SQLITE or "sqlite"
o $host
- The SQL server host
o $database
- The database name
o $username
- The username
o $password
- The password
o $persistent
- The $persistent parameter can be set to DBX_PERSISTENT, if so, a persistent connection will be created.
The $host, $database, $username and $password parameters are expected, but not always used depending on the connect functions for the
abstracted module.
RETURN VALUES
Returns an object on success, FALSE on error. If a connection has been made but the database could not be selected, the connection is
closed and FALSE is returned.
The returned $object has three properties:
o database
- It is the name of the currently selected database.
o handle
- It is a valid handle for the connected database, and as such it can be used in module-specific functions (if required).
<?php
$link = dbx_connect(DBX_MYSQL, "localhost", "db", "username", "password");
mysql_close($link->handle); // dbx_close($link) would be better here
?>
o module
- It is used internally by dbx only, and is actually the module number mentioned above.
CHANGELOG
+--------+---------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------+
| 5.0.0 | |
| | |
| | Introduced DBX_SQLITE. |
| | |
| 4.3.0 | |
| | |
| | Introduced DBX_OCI8. |
| | |
| 4.2.0 | |
| | |
| | Introduced DBX_SYBASECT. |
| | |
| 4.1.0 | |
| | |
| | Introduced DBX_FBSQL. |
| | |
+--------+---------------------------+
EXAMPLES
Example #1
dbx_connect(3) example
<?php
$link = dbx_connect(DBX_ODBC, "", "db", "username", "password", DBX_PERSISTENT)
or die("Could not connect");
echo "Connected successfully";
dbx_close($link);
?>
NOTES
Note
Always refer to the module-specific documentation as well.
SEE ALSO
dbx_close(3).
PHP Documentation Group DBX_CONNECT(3)