Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag....

I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard.
So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() {
public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompts, ..............

But I can only provide the password and I expect after the password prompt there are two more prompts but it is not coming ,But I could able to connect, but unable to provide some values to the script called
in the profile ( . /apps/prod/ia/bin/.dsdprofile )

Kindly help whether Im following the right method to connect in this scenario.

Jsch api have any advanced method for connecting in this scenario? Or can you help me pointing any other api for this?

Im pasting the snippets I used to connect to the remeore unix server from my java program.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
boolean authenticated = conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { 

public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompts, 
boolean[] echo) throws Exception { 
System.out.println(name); 
System.out.println(instruction); 
System.out.println(numPrompts); 
System.out.println("Prompts are: "); 
for (String prompt : prompts) { 
System.out.println(prompt); 
} 
if (numPrompts == 0) 
return new String[0]; 

if ((numPrompts > 0) && (prompts[0].startsWith("Password"))) 
return new String[] { password }; 

if ((numPrompts > 0)) { 
for (String prompt1 : prompts) { 

if (prompt1.contains("Hit return after you have read the message of the day")) 
return new String[] { "\n" }; 

} 

for (String prompt1 : prompts) { 
if (prompt1.contains("ORACLE_SID")) 
return new String[] { "OracleSS" }; 

} 

}    
System.out.println(k);    
System.err.println( 
"Warning/FIX: don't know what to do with keyboard-interactive method with unknown prompts"); 
/*System.err.println("Prompts are: "); 
for (String p : prompts) 
System.err.println(p);*/ 
return new String[0]; 
} 

}); 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Thank you very much / Danke Schon ..

-Sanal

Passing object as parameter to method?
Passing object as parameter to Constructor?
In the above two cases it�s the same thing. You didn�t ask the difference between the parameter and constructor, so not gonna dig into that. Constructor is just a special kind of method that has the same name as that of the class.
Passing objects as parameters simply means you are giving some custom datatype value, any value to the method or constructor, for the code inside this method to use.
You make any custom object. You pass this object to your function, for it�s code to work upon. This, in summary, means Passing object as parameter.
and using object as argument inside invoking method or constructor?
Parameters and arguments are mostly used interchangeably. In most texts, and mostly all concepts, they mean the same thing. The fundamental difference is that parameters are the variables defined in the function definition, arguments are the values being passed to the function definition in function call statement.
The language of this part of your question is kinda confusing, but in essence, I think it means that using the object to invoke a function