Update:

connected.  I had it correct.  The DB was really old and was not using
jconn3.  It was a Sybase 9 DB and not a Sybase 11 DB.  I really did
not expect that since most everyone of our DBs are Sybase 11 and a few
are Sybase 10.  This particular DB is about 5 years old and has not
been upgraded yet.

Sorry, about that.

As far as a native Sybase adapter, is there any docs out there to help
in creating one?  Could I look at one of the existing adapters like
DB2 or Oracle?  I'm a little cautious on using jruby vs MRI ruby
because of gem support.

Thanks Jeremy.


GregD


On May 20, 11:58 am, Jeremy Evans <[email protected]> wrote:
> On May 20, 8:37 am, GregD <[email protected]> wrote:
>
>
>
>
>
> > Jeremy,
>
> > Well, I guess I have the connection string wrong then because the
> > jconn3.jar is correct.
>
> > When I do:
>
> > DB = Sequel.connect("jdbc:sybase:Tds:host:port?blah..blah)
>
> > and then do
>
> > DB.tables
>
> > I get:
>
> > Sequel::DatabaseConnectionError: NoMethodError: undefined method `new'
> > for nil:NilClass
> >         from c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/adapters/jdbc.rb:170:in `connect'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/database.rb:91:in `initialize'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool.rb:91:in `call'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool.rb:91:in `make_new'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:126:in `make_new
> > '
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:112:in `availabl
> > e'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:102:in `acquire'
>
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:146:in `sync'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:146:in `sync'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:101:in `acquire'
>
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/connection_pool/threaded.rb:74:in `hold'
> >         from C:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/database.rb:553:in `synchronize'
> >         from c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/adapters/jdbc.rb:366:in `metadata'
> >         from c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/
> > sequel/adapters/jdbc.rb:254:in `tables'
> >         from (irb):31
>
> > Any clues?  How do I know it is using the jconn3.jar to try the
> > connection?
>
> > Thank,
>
> > GregD
>
> > On May 20, 11:21 am, Jeremy Evans <[email protected]> wrote:
>
> > > On May 20, 8:10 am, GregD <[email protected]> wrote:
>
> > > > I finally got around to trying this with jruby and I'm having no
> > > > success.  Can anyone help me please?
>
> > > > In jirb,  I do the following:
> > > > require 'java'
> > > > require 'rubygems'
> > > > require 'sequel'
>
> > > > Now comes the interesting part:  which Sybase jar file to require?
> > > > jconn3.jar or jodbc.jar
>
> > > > require '<path-to-Sybase-Java-lib>/jconn3.jar'
>
> > > > Now what?
>
> > > > I tried all kinds of connections strings based on Jconnect format
> > > > similar to:
>
> > > > jdbc:sybase:Tds:host:port?
> > > > ServiceName=database&user=user&password=password
>
> > > > Does anybody have any experience doing this?  Could someone please
> > > > help?
>
> > > > Is jtds driver possible?
>
> > > > I'd like to use all the ruby goodies to test existing java code like
> > > > rspec, machinist/factory girl, maybe cucumber with swinger.  However,
> > > > I don't have a Sybase JDBC adapter for sequel.  Active Record is too
> > > > hard/too painful to extract from rails.  It looks like Datamapper may
> > > > not have support either.
>
> > > > If I have to write an adapter myself, where do I begin?  But, I really
> > > > don't feel comfortable doing that at this moment.
>
> > > Sequel passes JDBC connection strings directly to JDBC.  So as long as
> > > you have a valid JDBC connection string and have loaded the necessary
> > > jars, it should work with Sequel.  This means that if it is not
> > > working, you probably don't have a valid JDBC connection string or
> > > have not loaded the necessary jars.
>
> > > If you use JTDS, Sequel will attempt to load the jdbc-jtds gem
> > > automatically, so you may want to try that. When you use JTDS, it
> > > assumes you are connecting to SQL Server, so it uses SQL Server
> > > syntax.  Sequel doesn't currently have any special syntax settings for
> > > Sybase, but you don't need to worry about that until after you can
> > > connect.
>
> That's what you get if there is an error when connecting.  You used to
> get a more descriptive error message, I'll see if I can modify the
> JDBC adapter to fix that.
>
> I'd give JTDS a shot and see if you have more luck.  I test with the
> JTDS driver on MSSQL, so I know that it works.
>
> Jeremy
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sequel-talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/sequel-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to