简体   繁体   English

Btrieve /普及数据库和Ruby

[英]Btrieve/Pervasive db and Ruby

Is there any solution to work with Btrieve/Pervasive db from Ruby level? 有没有从Ruby级别使用Btrieve / Pervasive db的解决方案? Any gem? 有宝石吗? Maybe somebody have some experience with such a thing? 也许有人对这种事情有一些经验?

Or maybe use some Java libs through Jruby? 或者也许通过Jruby使用一些Java库? I've never used Jruby 我从没用过Jruby

Never worked with that, but if there's a JDBC adapter for it, then it's a good idea to use JRuby. 从来没有使用过,但是如果有一个JDBC适配器,那么使用JRuby是一个好主意。 Using JRuby is dead simple, visit JRuby.org . 使用JRuby非常简单,请访问JRuby.org

@kell I used jruby and JDBC Pervasive driver. @kell我使用了jruby和JDBC Pervasive驱动程序。 Simple example: 简单的例子:

require "java"
module JavaSql
  include_package "java.sql"
end
pervasive_driver = Java::JavaClass.for_name("pervasive.jdbc.PervasiveDriver")
conn = JavaSql::DriverManager.getConnection("jdbc:pervasive://host/database","master","")
stmt = conn.createStatement
rs = stmt.executeQuery("select count(*) as class_count from class")
while (rs.next) do
  puts rs.get_string("class_count")
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM