This ought to be simple, but I haven't (yet) worked out how to do it, and I'm sure someone else must have solved it.
I'm writing a little tool which does analysis of history databases written by our systems in the field; the databases are (typically, not always) held in Microsoft SQL Server instances on different machines. In future there may also be Postgres instances. Currently I'm declaring the database as follows:
(db/defdb fpphistory {:subprotocol "jtds:sqlserver"
:user "sgs-historian"
:password "xxxxxxxxx"})
which works fine in development, but in production the tool will rarely or never run on the machine the DBMS sits on, and although the name of the database is currently always 'history', this also won't necessarily always be true in future.
I've got a -main function in which I already parse command line arguments. I'd like to pass in the sub-protocol, the host address, the database name, the username and the password as command line arguments. Any suggestions as to how I do this?
Any help gratefully received!