connecting to a virtual private network using Java

Discussion in 'Java' started by cartercc@gmail.com, Jun 27, 2006.

  1. Guest

    This may be a very simple question, but I'm completely lost at this
    point.

    We have a large code base in Perl, around 12,000 lines of code. Mostly,
    this code runs queries on one remote database, manipulate the data, and
    writes the data to another remote database. We lost the programmer that
    wrote the code, and two of us inherited the code. Documenting the code
    has proved to be a nightmare, and we are in the process of starting
    from scratch and rewriting it. We are exploring alternatives to Perl,
    and the first one is Java.

    The first thing the Perl code does is open a VPN connection between our
    machine and the remote database. The Perl is very simple, and looks
    something like this:

    my $retval = system('vpnc.exe -u username -p password -D
    remotePIaddress');
    print "Connected to VPN\n" if $retval;

    For the life of me, I can't seem to figure out how you would do the
    same thing in Java. Is there a VPN class that you can use to make a VPN
    connection to a remote machine?

    TIA. CC.
    , Jun 27, 2006
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > This may be a very simple question, but I'm completely lost at this
    > point.
    >
    > We have a large code base in Perl, around 12,000 lines of code. Mostly,
    > this code runs queries on one remote database, manipulate the data, and
    > writes the data to another remote database. We lost the programmer that
    > wrote the code, and two of us inherited the code. Documenting the code
    > has proved to be a nightmare, and we are in the process of starting
    > from scratch and rewriting it. We are exploring alternatives to Perl,
    > and the first one is Java.
    >
    > The first thing the Perl code does is open a VPN connection between our
    > machine and the remote database. The Perl is very simple, and looks
    > something like this:
    >
    > my $retval = system('vpnc.exe -u username -p password -D
    > remotePIaddress');
    > print "Connected to VPN\n" if $retval;
    >
    > For the life of me, I can't seem to figure out how you would do the
    > same thing in Java. Is there a VPN class that you can use to make a VPN
    > connection to a remote machine?


    There's nothing in Perl that specifically knows how to connect to aVPN.
    Rather, this Perl code is invoking an external program (vpnc.exe) that
    establishes the VPN connection. You can do exactly the same thing in Java.
    Look for Runtime.exec () and its many variations.

    Cheers,
    Matt Humphrey http://www.iviz.com/
    Matt Humphrey, Jun 27, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page