I actually figured out how to do so with Trino & Teradata. I felt like the documentation was very specialized. And unfortunately, I found that "one size doesn't fit all." So, I'm posting what I did - so others can learn from it.

I ran from Windows - so these are the windows steps for Teradata

From a windows command line - one would run the following:

c:\jars>java -Ddbd.port=12345 ^ + -Dlog4j.configurationFile="C:\Work\Programming\javaProgrammingLog\jdb +cAndPerl\DBD-JDBC-0.72.tar\DBD-JDBC-0.72\server\log4j2.properties" ^ + -cp "C:\jars\terajdbc4.jar;C:\jars\tdgssconfig.jar;C:\jars\dbd_jdbc.j +ar;C:\jars\log4j-api-2.17.1.jar;C:\jars\log4j-core-2.17.1.jar" ^ + com.vizdom.dbd.jdbc.Server

Important Notes, you'll need to make sure you place your jar files in your respective folder. In my case, I placed them in c:\jars. Also, TeradataJDBC for me, worked with 17.2 - due to SSL restrictions

Step two, running the perl script

use strict; use warnings; use DBI; # Credentials my $user = "!NEDVFCollections"; my $password = "XXXXXX"; # Use the password from your DSN config my $url = "jdbc:teradata://172.28.130.20/"; my $dsn = "dbi:JDBC:hostname=localhost;port=12345;url=$url"; # Adjus +t port to match your Java proxy # JDBC connection properties my $conn_attrs = { 'USER' => $user, 'PASSWORD' => $password, 'LOGMECH' => 'LDAP', 'DBS_PORT' => '1025', 'TMODE' => 'tera' }; # Connect my $dbh = DBI->connect( $dsn, undef, undef, { RaiseError => 1, jdbc_properties => $conn_attrs, } ) or die "Connection failed: $DBI::errstr"; print "Connected to Teradata!\n"; # Example query — update to your actual table/schema my $sql = "SELECT date,user;"; my $sth = $dbh->prepare($sql); $sth->execute(); # Print column names my @columns = @{$sth->{NAME_lc}}; print join(" | ", @columns), "\n"; # Print each row while (my @row = $sth->fetchrow_array) { my @safe_row = map { defined($_) ? $_ : '' } @row; print join(" | ", @safe_row), "\n"; } $sth->finish(); $dbh->disconnect();

That is how to run a Teradata perl script with Perl DBD JDBC over a Java server on windows

Cheers and happy coding


In reply to Re^6: Trying to connect to DBD::JDBC - com.vizdom.dbd.jdbc.Server by mallett76
in thread Trying to connect to DBD::JDBC - com.vizdom.dbd.jdbc.Server by mallett76

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.