dbsrgits / sql-translator

SQL::Translator (SQLFairy)
http://sqlfairy.sourceforge.net/
82 stars 90 forks source link

Is it possible to use SQLFairy via DBD::JDBC? #53

Open daveloyall opened 9 years ago

daveloyall commented 9 years ago

This command line:

hobbes@metalbaby:~$ sqlt -f DBI -t GraphViz --db-user username --db-password '...' \
--dsn 'dbi:JDBC:hostname=localhost:9001;url=jdbc:sqlserver://10.0.0.5'

returns:

Error: translate: Error with parser 'SQL::Translator::Parser::DBI': JDBC not supported
at /usr/share/perl5/SQL/Translator/Parser/DBI.pm line 154.

If you're not familiar with DBD::JDBC, here is my synopsis: the thing has at least two components: a standalone java application which speaks JDBC on one side and listens for incoming connections on the other. It acts as a proxy... The perl part of DBD::JDBC talks to the little server. So, a variety of RBDMS are made available to perl's DBI via this bridge. (I guess DBI is to perl as JDBC is to Java?)

So I looked around a little and determined that I should implement SQL::Translator::Parser::DBI::JDBC. I inspected SQL::Translator::Parser::DBI::SQLServer for guidance. I quit when I saw the following in the DBD::JDBC README file.

NOT YET IMPLEMENTED DBI-defined methods, including

 DBI->data_sources('JDBC'), $dbh->data_sources

 the metadata methods $dbh->table_info, $dbh->tables,
 $dbh->type_info_all, $dbh->type_info, $dbh->column_info,
 $dbh->primary_key_info, $dbh->primary_key,
 $dbh->foreign_key_info 

Meanwhile, I'll return to trying to use unixODBC to talk to MS SQL Server.

ribasushi commented 9 years ago

@daveloyall Short answer: no idea ;) Generally talking to MSSQL via unixODBC is the best way to do it currently (especially if you can get your hands on the Microsoft linux driver).

Nevertheless I would appreciate pointers to how to properly setup a JDBC connection on linux however, so maybe this can be tried in the future.