This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes setDoInput() & setDoOutput() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "setDoInput() & setDoOutput()" Watch "setDoInput() & setDoOutput()" New topic
Author

setDoInput() & setDoOutput()

Friend
Ranch Hand

Joined: Nov 23, 2000
Posts: 67
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

Joined: Sep 29, 2000
Posts: 8521
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.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Friend
Ranch Hand

Joined: Nov 23, 2000
Posts: 67
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

Joined: Sep 29, 2000
Posts: 8521
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)
 
Don't get me started about those stupid light bulbs.
 
subject: setDoInput() & setDoOutput()
 
Similar Threads
URLConnection - - FileNotFoundException
URL connection(applet-jdbc)
Calling Servlet from Java application
How to use post-method with applet and servlet
URLConnection class : Very Urgent