c:\jars>java -Ddbd.port=12345 ^ -Dlog4j.configurationFile="C:\Work\Programming\javaProgrammingLog\jdbcAndPerl\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.jar;C:\jars\log4j-api-2.17.1.jar;C:\jars\log4j-core-2.17.1.jar" ^ com.vizdom.dbd.jdbc.Server #### 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"; # Adjust 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();