Error connecting to JDBC using perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alluri1123
    New Member
    • Mar 2008
    • 1

    Error connecting to JDBC using perl

    I am using the following code and i get the below error
    [code=perl]
    use DBI;
    use DBD::JDBC;

    my $url="JDBC:gfsq l://cqserver=fiappl 03itf:30305";
    my $hostname="fiap pl03itf.fmrco.c om";
    my $port=30305;
    my $dsn ='jdbc:gfsql';
    my
    $dbh= DBI->connect("DBI:: $dsn;hostname=$ hostname;port=$ port;url=$url;j dbc_character_s et=ASCII") or

    die "Couldn't connect to database: " . DBI->errstr;

    $sth = $dbh->prepare("selec t cusip,source from TT_VIEW");
    $sth->execute();
    while ($row = $sth->fetch()) {
    print $row;
    }
    [/code]
    I am getting the below error.

    Can't connect to data source jdbc:gfsql;host name=fiappl03it f.fmrco.com;por t=30305;url=JDB C:gfsql://cqserver=fiappl 03itf:30305;jdb c_character_set =ASCII, no database driver specified and DBI_DSN env var not set at jdbc_conn.pl line 16
    Last edited by numberwhun; Mar 19 '08, 04:51 PM. Reason: add code tags
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    already replied to on other forum

    Comment

    Working...