-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Yazad,
we needed a cheap, fast solution and there was no time to deal with the
source code so I used commons-net
and telnet, as far as I know we did not even care about the response.
Greetings,
Sascha
Yazad Khambata schrieb:
| Hey thanks Sascha, You made me feel so much better... :)
|
| But the main concern is a 2 phase commit! where some of my data will be
| stored through telnet and the rest (other user details) via jdbc in my own
| RDBMS... BTW what technique did you use to get the status of the command
| executed?
|
| Regards,
| Yazad Khambata
|
|
| On Sun, Apr 6, 2008 at 7:14 PM, Sascha Fröhlich
<[EMAIL PROTECTED]>
| wrote:
|
| Hi,
|
| same thing I did a few months ago :-) Nothing to be ashamed of, I think...
|
| Greetings,
| Sascha
|
|
| Yazad Khambata schrieb:
|
| | Thank you,
| |
| | I wrote a code using commons-net to send data to the server to create
| users,
| | It is a shabby way to do things, with will suffice my current needs,
| thank
| | you all for your support
| |
| | _______________________________________________________________
| | The below code use apache commons net...
| |
| | TelnetClient telnetClient = null;
| | try {
| | telnetClient = new TelnetClient();
| |
| | final InetAddress inetAddress =
| | InetAddress.getByName("localhost");
| | telnetClient.connect(inetAddress, 4555);
| |
| | System.out.println("Connection established...");
| |
| | //Writer
| | final OutputStream outputStream =
| | telnetClient.getOutputStream();
| | final OutputStreamWriter outputStreamWriter = new
| | OutputStreamWriter(outputStream);
| | final BufferedWriter bufferedWriter = new
| | BufferedWriter(outputStreamWriter);
| | PrintWriter printWriter = new PrintWriter(bufferedWriter);
| |
| |
| | //Reader
| | final InputStream inputStream =
| telnetClient.getInputStream();
| | final InputStreamReader inputStreamReader = new
| | InputStreamReader(inputStream);
| | final BufferedReader bufferedReader = new
| | BufferedReader(inputStreamReader);
| |
| | //printMessagesFromServer(bufferedReader);
| |
| | //login as root
| | printWriter.println("root");
| | printWriter.println("root");
| |
| | //add user
| | printWriter.println("adduser success success");
| | printWriter.flush();
| |
| | printWriter.println("verify success4");
| | //close streams...
| | outputStream.close();
| | bufferedReader.close();
| | } finally {
| | if(telnetClient != null) {
| | telnetClient.disconnect();
| | System.out.println("Disconnected...");
| | }
| | }
| |
| | _______________________________________________________________
| |
| | On Sun, Apr 6, 2008 at 12:30 PM, Robert Burrell Donkin <
| | [EMAIL PROTECTED]> wrote:
| |
| |> On Sat, Apr 5, 2008 at 11:13 PM, Yazad Khambata <[EMAIL PROTECTED]>
| wrote:
| |>> Hi Robert,
| |>> Thanks for the link... I think it's best if I download the source
| |> zip
| |>> now... Is there any javadoc available? I couldn't find any on the
| site,
| |> nor
| |>> in the downloaded binary... Thanks.
| |> the best plan is to download the source (if you're targeting stable)
| |> or checkout the project from subversion (if you're targeting trunk)
| |> and take a look at it in an IDE
| |>
| |> - robert
| |>
| |> ---------------------------------------------------------------------
| |> To unsubscribe, e-mail: [EMAIL PROTECTED]
| |> For additional commands, e-mail: [EMAIL PROTECTED]
| |>
| |>
| |
|
|>
|>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
iEYEARECAAYFAkf48fwACgkQN1kDpsIDAWHLTACeO52ZGKf8xN+b/n3m5p3YcBLQ
R+YAn3KxAWn+roKdhe+g54G1nIAaSTlO
=7R2B
-----END PGP SIGNATURE-----