How can I use Berkeley DB with Ruby?

S

Siratinee Sukachai

I'm a Thai student. My teacher ordered me to use Berkeley DB in the term
project. I saw in BDB website that BDB is worked with Ruby but I don't
have any idea to connect it.

Anyone knows how to connect it? I've used mysql in the last project. Now
I want to know is it work if I'll use BDB with Ruby?
 
M

Mateusz Tybura

Siratinee said:
I'm a Thai student. My teacher ordered me to use Berkeley DB in the term
project. I saw in BDB website that BDB is worked with Ruby but I don't
have any idea to connect it.

Anyone knows how to connect it? I've used mysql in the last project. Now
I want to know is it work if I'll use BDB with Ruby?

Try tu use dbm (This is a Ruby extension to DBM library (including
Berkley DB's DBM))
 
M

Mateusz Tybura

This is example code:

# ruby dbm acess
require "dbm"

d = DBM.open("test")
keys = d.keys
if keys.length > 0 then
for k in keys; print k, "\n"; end
for v in d.values; print v, "\n"; end
else
d['foobar'] = 'FB'
d['baz'] = 'BZ'
d['quux'] = 'QX'
end
 
S

Siratinee Sukachai

Siratinee said:
I'm a Thai student. My teacher ordered me to use Berkeley DB in the term
project. I saw in BDB website that BDB is worked with Ruby but I don't
have any idea to connect it.

Anyone knows how to connect it? I've used mysql in the last project. Now
I want to know is it work if I'll use BDB with Ruby?

Anyone can help me more?
I still have no idea for solve this problem.... :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top