Adsense

Friday, September 26, 2014

Db2 Terminate Vs Connect Reset , Disconnect

db2 Terminate and db2 connect Reset both break the connection to a database.              Connect Reset breaks a connection to a database, but does not terminate the back-end process. The Terminate command does both ie. break the connection to a database and terminate the back-end process. Suppose an application is connected to a database, or a process may be in the middle of a of work. We can use TERMINATE to make the database connection to be lost. When Terminate is issued, an internal commit is also...

Example SQL injection in db2. How to Solve SQL injection in db2?

SQL injection is a technique to attack web applications by inserting malicious code (user supplied data) into strings which are passed to an instance of Database Server for parsing and execution. SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application. It is one of the dangerous application vulnerability. One way for avoiding SQL Injection, the user supplied data should be validated in both client side and server side  before parsing & executing the SQL statement so that it should not...

Thursday, September 18, 2014

Db2 export command example to export data to external file format (del , ixf )

Suppose you want to transfer data from a db2 database table to another db2 database or within the same database, one of the solution is to use db2 export / import command . Using db2 export / import you can move your data to excel also. DB2 export command exports data selected by SQL statement from a table or view to an external files in the format of del, asc (ascii format), wsf, ixf etc.. del - delimited , wsf - worksheet format , ixf - Integration Exchange Format. The DEL format uses delimiter and column separator and decimal point....

DB2 Basic Commands with Example

DB2 Basic Commands 1. db2cmd -  Opens db2 command window 2. db2start   - to start the database manager instance 3. db2stop  -  to stop the database manager instance 4. db2stop force - to stop the database manager instance forcefully 5. db2cc - starts the db2 control center 6. db2 list db directory - lists all the databases created in the db server           -To list databases that start with "SAL"                 Linux : db2 list db...

resultSetHoldability in DB2 , Solution for Invalid operation: result set is closed in Java & Websphere

          Do you get the exception Invalid operation: result set is closed in Db2  when you run a java application that uses DB2 connection. Solution is very simple. This error is generated when closed resultset objects are accessed by the application. All the resultset objects which are created for the transaction are closed, whenever the transaction is committed. After that when we access the result set, the...

Wednesday, September 3, 2014

db2 automatic backup configure using crontab in linux.

In this tutorial, let us see the steps how to configure automatic backup in db2 using crontab in linux.  UNIX or Linux cron jobs can be scheduled with the crontab command. In our example, let us configure to take automatic db2 backup on every saturday 10 PM. 1. Create a shell script in a folder (/db2/scripts) that takes online full backup.  For online backup, please ensure that you have enabled online backup. $  vi backup.ksh        echo "Online Backup Starts at `date` ... "         /home/db2inst1/sqllib/bin/db2...