Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setDoInput() & setDoOutput()

 
Friend
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me why should we use setDoInput() & setDoOutput() in making jdbs connection with applets(using Serializable) &servlets?
Thank You.
Jyotsna.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you know. . . that there are over 2500 classes released with Java 2 and each of those have MANY methods.
Would you do a favor for us poor under-enlightened folks and give us a clue as to what class these methods are in. Then we might stand a chance of figuring out what you might want to use them for.
 
Friend
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code is used to include the methods which I asked earlier to you "setDoInput() & setDoOutput()".
private URL url;
URLConnection ucon;
Uconnection(String Serv)
{
try{url=new URL("http://localhost:8080/servlet/"+Serv);
ucon=url.openConnection();
ucon.setUseCaches(false);
ucon.setDoOutput(true);
ucon.setDoInput(true);
Now can you identify? or eable to understand my doubt?
Then please give the solution.
Thank you
Jyotsna.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setDoInput

public void setDoInput(boolean doinput)
Sets the value of the doInput field for this URLConnection to the specified value.
A URL connection can be used for input and/or output. Set the DoInput flag to true if you intend to use the URL connection for input, false if not. The default is true unless DoOutput is explicitly set to true, in which case DoInput defaults to false.
Parameters:
doinput - the new value.

From: http://java.sun.com/j2se/1.3/docs/api/java/net/URLConnection.html#setDoInput(boolean)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic