Skip to Content.
Sympa Menu

freetds - AW: Re: JDBC + SQL Server --> improper URL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Frey <michael.frey AT oops-gmbh.de>
  • To: 'TDS Development Group' <freetds AT franklin.oit.unc.edu>
  • Subject: AW: Re: JDBC + SQL Server --> improper URL
  • Date: Thu, 2 Mar 2000 09:10:03 -0000


Hi there



due to an upgrade of my MS-SQL Server to Version 7.0 i must use freetds
because its the only way to connect.



I have used the sybase ct-lib before, but my perl programms are running
much slower and they take lot lot lot of memory ofy my linux system..

thsi is the script ...



do you have any ideas ??



i have tried the --with-tds-ver=7.0 and 4.2 config options but ...



this is one of the scripts





$ENV{SYBASE}="/usr/local/freetds";

$ENV{DSQUERY}="regloplas";

$ENV{LANG}="default";



use DBI;

$db = dbConnect();

open(InputFile, "/var/accounting.log") || die "Kann das Input-Routerlog
nicht lesen\n";

$uhrzeit=0;

$rc=0;

$rc_begin=183000;

$start=time();

while(<InputFile>)

{

chop;

($uhrzeit,

$gatewayid,

$src_ip,

$dst_ip,

$bytes,

$_)= split;



if ($rc >= $rc_begin)

{



# SQL schon mal vorbereiten

$where = "uhrzeit=$uhrzeit AND gatewayid=$gatewayid AND
sourceIP=$src_ip AND destinationIP=$dst_ip";



# Nachsehen on schon ein Record vorhanden ist

$sql = "SELECT uhrzeit FROM accounting_new WHERE $where";

$result = $db->prepare($sql);

$result->execute || die "DBI::errstr\n";

@row = $result->fetchrow_array;

if (@row)

{

# Jepp Vorhanden ein UPDATE bitte

$sql = "UPDATE accounting_new SET bytes=bytes+$bytes WHERE
$where";

}

else

{

# Nö nicht vorhanden ein INSERT

$sql = "INSERT INTO accounting_new (uhrzeit, gatewayid,
sourceip, destinationip, bytes) VALUES($uhrzeit, $gatewayid, $src_ip,
$dst_ip, $bytes)";

}

$result = $db->do($sql);

}

#print "$uhrzeit\t$gatewayid\t$src_ip\t$dst_ip\t$bytes\n";

$rc++;

if ($rc % 1000 == 0)

{

$time = time()-$start;

print "Datensätze: $rc $time\n";

$start = time();

}

}



close(InputFile);

$result = $db->disconnect;



sub dbConnect

{

return DBI->connect("dbi:Sybase:database=xxx", "xxx", "xxx") || die
"geht ned: DBI::errstr";

}



  • AW: Re: JDBC + SQL Server --> improper URL, Michael Frey, 03/02/2000

Archive powered by MHonArc 2.6.24.

Top of Page