简体   繁体   中英

Btrieve/Pervasive db and Ruby

Is there any solution to work with Btrieve/Pervasive db from Ruby level? Any gem? Maybe somebody have some experience with such a thing?

Or maybe use some Java libs through Jruby? I've never used Jruby

Never worked with that, but if there's a JDBC adapter for it, then it's a good idea to use JRuby. Using JRuby is dead simple, visit JRuby.org .

@kell I used jruby and JDBC Pervasive driver. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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