Article View: borland.public.cppbuilder.internet.web
Article #674Re: how to send a string to a url
From: dave
Date: Tue, 22 Aug 2006 18:30
Date: Tue, 22 Aug 2006 18:30
38 lines
1950 bytes
1950 bytes
Well the URL I an sending the string info to is Tomcat (similar to a appache).
Here is some java code which I am trying to do with Builder.
try{
java.net.URL url = new java.net.URL("http://localhost:8084/SiteTracking/SiteTrackerVersionUpdater");
java.net.URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
java.io.OutputStream out = connection.getOutputStream();
//connection.connect();
//HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
out.write(new String("CREATE TABLE test (`Key_ID` INT(11) NOT NULL)\r\n").getBytes());
//END HERE !!!!!!!!
out.flush();
java.io.BufferedReader in = new java.io.BufferedReader(
new java.io.InputStreamReader(
connection.getInputStream()));
in.close();
out.close();
}catch(Exception ex)
{
System.out.println(e.toString());
}
Obviously I will be sending this to a different IP addresss than my local machine when I get it to work.
Technical Details
Message-ID:
<44eb4d5d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44eb39e3$2@newsgroups.borland.com> <44eb4100$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,bfc9e9e4f471e4ee X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "dave" <dave@here.com> Sender: "dave" <dave@here.com> Reply-To: "dave" <dave@here.com> Subject: Re: how to send a string to a url Newsgroups: borland.public.cppbuilder.internet.web X-User-Info: 209.113.245.98 References: <44eb39e3$2@newsgroups.borland.com> <44eb4100$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <44eb4d5d$1@newsgroups.borland.com> Date: 22 Aug 2006 11:30:53 -0700 X-Trace: newsgroups.borland.com 1156271453 207.105.83.66 (22 Aug 2006 11:30:53 -0700) Lines: 40 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail