Re: OpenEdge database and ActiveRecord-jdbc-adapter
- From: "Ryan L. Bell" <ryan.l.bell@gmail.com>
- To: dev@activerecord-jdbc.kenai.com
- Subject: Re: OpenEdge database and ActiveRecord-jdbc-adapter
- Date: Wed, 19 Aug 2009 10:02:58 -0400
I'm not sure how much it will help you, but here's my starter on
writing custom jdbc adapters for rails. It should give an idea how to
get started at least.
http://kofno.wordpress.com/2008/04/23/writing-an-activerecord-jdbc-adapter/
/Ryan
On Wed, Aug 19, 2009 at 11:30:16AM +0200, Yannick Francois wrote:
> Hello all,
>
> For many reasons I will explain later, I use JRuby with OpenEdge database.
> OpenEdge database have a jdbc driver (type 4) in version 10.1x and
> start to have a SQLEngine working fine in last version 10.2a (LIMIT
> and OFFSET was implemented in this version...).
>
> I still have a problem on INSERT and UPDATE and I don't know how to solve
> it.
>
> Here is a simple piece of code:
> "
> c = CostAccountPlan.new(:id => 234, :code => "fake code")
> c.save!
> "
> This is in UnitTest file.
>
> When I run test, here is the result:
> "
> ActiveRecord::StatementInvalid: ActiveRecord::ActiveRecordError:
> [DataDirect][OpenEdge JDBC Driver]Unsupported method:
> Statement.executeUpdate: INSERT INTO pub.cost_account_plans (code,
> description) VALUES('fake code', '')
>
> C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:563:in
> `execute'
>
> C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.1/lib/active_record/connection_adapters/jdbc_adapter.rb:587:in
> `jdbc_insert'
> test/unit/cost_account_plan_test.rb:15:in
> `test_cap_doit_exister_avec_un_code_et_une_description'
> "
>
> I don't understand if error is in OpenEdge JDBC Driver or in
> activerecord-jdbc-adapter...
> I made some test of this driver with a pur java class, and it's work."
>
> "
> Class.forName("com.ddtek.jdbc.openedge.OpenEdgeDriver");
> Connection connection = DriverManager.getConnection(
> "jdbc:datadirect:openedge://localhost:22402;databaseName=hermes_102A",
> "Yaf", "");
> Statement stmt = connection.createStatement();
> stmt.executeUpdate("INSERT INTO pub.cost_account_plans (id,code)
> VALUES(234,'fake code')");
> stmt.close();
> connection.close();
> "
>
> I continue to search, but please, if someone have an idea... I think I
> need to make a specific adapter for openedge, but I don't know which
> piece of code I need to change and how I can...
>
> ps: Sorry about sending this mail on three mailing list, but I don't
> know where to send this...
>
> Thanks
>
> --
> Yannick Francois
> +33 683 785 716
> <http://kantena.com>
--
Ryan L. Bell
http://kofno.wordpress.com
http://twitter.com/kofno
http://github.com/kofno
| Yannick Francois | 08/19/2009 | |
|
Re: OpenEdge database and ActiveRecord-jdbc-adapter |
Ryan L. Bell | 08/19/2009 |





