Question: I have written one stored procedure in mysql database as follows :

```
CREATE PROCEDURE sp_Test(
    IN Mode     VARCHAR(50),
    IN UserID   INT,
    ....
    ....  
)
BEGIN
    SET @sqlQuery = "";
    IF (Mode = 'Select') THEN
       //Select query
    ELSEIF (Mode = 'Update') THEN
       //update query
    ELSEIF (Mode = 'Delete') THEN
       //Delete query
    END
END

```

and as per my need I can call it like this

```
CALL sp_Test("Select", 1, ...)
OR
CALL sp_Test("Update", 1, ...)
OR
CALL sp_Test("Delete", 1, ...)

```

It is ok for performance? Or I should write individual stored procedures for each mode like

for SELECT 

```
CREATE PROCEDURE sp_Test_Select(
    IN UserID   INT,
    ....
    ....  
)
BEGIN
    //Select query
END

```

for UPDATE 

```
CREATE PROCEDURE sp_Test_Update(
    IN UserID   INT,
    ....
    ....  
)
BEGIN
    //Select query
END

```

Answer: 
The correct solution is really to not use aliases at all; they are intended as a convenience for interactive use. If you have a complex alias which you would like to use noninteractively, convert it to a regular shell script, save the file in your `$PATH`, and mark it as executable. Or convert it to a function. Even for interactive use, functions are actually superior to aliases, and work in noninteractive shells, too.

Having said that, you can always wing it. The command you execute could be, for example,

```
 private static String[] commands = {"bash -O expand_aliases -c 'll /'", "df -h"};

```

You may need to smuggle a newline into that command line if you need to explicitly `source` the alias definition before you can use it; there is a caveat in the [manual](http://www.gnu.org/software/bash/manual/html_node/Aliases.html) about this. (Do read all of it, and especially the last sentence.)

Of course, for something this simple, the proper solution is to just run the standard command `ls -l` and forget about the alias. It's better for portability, too; while many sites have this alias, it's by no means guaranteed to exist. (Personally, the first thing I do when I set up an account is remove these "de facto standard" aliases.)
`ll` alias usually be defined in `~/.bashrc` file. when you login using a shell this `.bashrc` run and set the alias.

one way is to run it after login by JSch:

```
. ~/.bashrc

```

if you can not find the `ll` definition in `~/.bashrc` (either in `etc/profile, ~/.bash_profile, ~/.bash_login and ~/.profile`), use the `alias` command in PUTTY and write result to a script-file. then after JSch login run that script.

```
$ alias 
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'

$alias > my-script
$chmod +x my-script

```