• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to execute a TCP/IP command from Java

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm not sure if I've included this in the correct topic area or not.
What I am trying to do is to call update a database using FileMaker.
What I need to do is to call the following http request.
http://www.mytest.com/mwhandler/FMPro?-db=mytest&-lay=cgi&-forma
t=mwregsucc.txt&-error=mwregerr.txt&username=Max1&password=fsdkjf879dfz
isu7748765&-new
However If I did this in a servlet then i would be overwriting my HttpServletResponse object which i don't think I can do. Also I don't actually want to redirect to this link from my jsp pages, I just want to call it somehow from my servlet. Do you know if there is a way of doing this, or of carrying out my task. Of somewhow calling the command above without actually redirecting to this link?
Any ideas on this would be greatly appreciated.
[ December 18, 2002: Message edited by: Fergus Red ]
 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the class java.net.URLConnection
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HttpURLConnection uconn=(HttpURLConnection)dest.openConnection();
but, it seems setRequestProperty(..) is not working.
it remains the same.
is there anything I have do before I use the HttpURLConnection?
thank you in advance.
 
Fergus Red
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got it working using the following
java.net.URLConnection conn = new java.net.URL(urlInsert).openConnection();
InputStreamReader inp = new InputStreamReader(conn.getInputStream());

Thanks for the help again.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic