on 2011 Jun 08 4:14 PM
The Sybase IQ release docs list Ruby native and DBI driver support. Details on how to connect are not listed but the page does link to the Sybase SQLAnywhere for Ruby page. So I downloaded the SQLAnywhere for Ruby driver and built the gem (installing from rubygems gave seg faults).
What I can't figure out is what the connection string should be.
The MySQL connection in DBI looks like DBI.connect("DBI:Mysql:mydbname;host=myhostname;port=myport", "myuser", "mypassword")
Using the same format for IQ only gives me 'Not connected to a database (DBI::DatabaseError)'
Any help would be appreciated.
Request clarification before answering.
I saw both those docs and the ones listed with the gem. It was just a matter of getting the params right by combining the port with the host name. Here is what worked for me using IQ.
DBI.connect("DBI:SQLAnywhere:DBN=mydbn;HOST=myhostname:myport", "myuser", "mypassword")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The connect() call parameters are documented in the SQL Anywhere Ruby-DBI driver documentation page. There are also some examples on this same page.
Basically the first parameter is of the form "DBI:SQLAnywhere:<server-name>" or "DBI:SQLAnywhere:<connection-parameter-list>" where <server-name> is the name of the server to which you want to connect and <connection-parameter-list> is an semicolon separated key=value pairs (e.g. "server=myserver;dbn=mydatabase;host=myhost").
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.