tuarek wrote:
db2cmd is for Microsoft Windows systems. You have to use db2profile
for linux & unix systems..
Please refer to:
http://publib.boulder.ibm.com/infoce...ndex.jsp?topic
=/com.ibm.itpc_fabric.doc/btacpi23104.htm
Indeed, db2cmd is only used on Windows systems. However, you can't
"just" run db2profile on a Linux/UNIX system to the same effect:
db2profile is a shell script sets up certain environment variables for
the DB2 CLP in the calling shell (DB2DIR, INSTHOME, PATH, CLASSPATH,
VWSPATH, LD_LIBRARY_PATH, LIBPATH, and DB2INSTANCE).
Java can't run a shell script directly: you'd need to start a shell and
run the script within that. However, you'd then need to start the DB2
CLP within that *same* shell (otherwise you'll lose the changes to the
environment).
Alternatively, I assume Java provides some mechanism of tweaking the
environment of a child process when executed, in which case you could
avoid db2profile altogether by emulating its actions when executing the
CLP (launching the CLP with an appropriately tweaked environment).
However, in your OP you mention that this is all part of a stored
procedure. In other words, you're trying to execute an SQL script with
the DB2 CLP from *within* a Java stored procedure in a DB2 database?
That sounds a bit odd to me... What exactly are you trying to
accomplish here? It might be there's a simpler way of doing it with an
SQL stored procedure.
Dave.
--