1 | <head><title>FAQ for JavaGDBM</title>
|
---|
2 | </head>
|
---|
3 |
|
---|
4 | <h1>FAQ for JavaGDBM</h1>
|
---|
5 | <p><pre>$Id: FAQ.html 10737 2005-10-19 03:06:40Z kjdon $</pre>
|
---|
6 | <p><a href="http://www.pharos.com.au/gdbm/"><b>Home page</b></a> |
|
---|
7 | <a href="mailto:[email protected]"><b>[email protected]</b></a>
|
---|
8 |
|
---|
9 | <p><b>This is not an official publication of Pharos. There is no
|
---|
10 | warranty of any kind on this software or document.</b>
|
---|
11 |
|
---|
12 | <h3>Is this a JDBC driver?</h3>
|
---|
13 |
|
---|
14 | <p>(Alain Magloire)
|
---|
15 |
|
---|
16 | <p>No. JDBC seems mainly intended for interfaces to relational
|
---|
17 | databases, and GDBM is not a relational database.
|
---|
18 |
|
---|
19 | <p>However, JDBC does permit use of a subset to interface to
|
---|
20 | non-relational databases. Implementing this might be interesting: let
|
---|
21 | me know if it's useful to you.
|
---|
22 |
|
---|
23 | <h3>Does JavaGDBM understand SQL?</h3>
|
---|
24 |
|
---|
25 | <p>(Alain Magloire)
|
---|
26 |
|
---|
27 | <p>No, JavaGDBM is intended to store on-disk hash tables. They solve
|
---|
28 | a different class of problem to that appropriate for SQL and
|
---|
29 | relational databases.
|
---|
30 |
|
---|
31 | <h3>What type of database should I use?</h3>
|
---|
32 |
|
---|
33 | <p>Broadly, options for data storage in Java include
|
---|
34 |
|
---|
35 | <ul>
|
---|
36 | <li>A hash file through JavaGDBM.
|
---|
37 | <li>A relational database through JDBC
|
---|
38 | <li>An object-oriented database
|
---|
39 | <li>Serialization to a file
|
---|
40 | </ul>
|
---|
41 |
|
---|
42 | <p>Make sure you choose the right tools: there is no single `best' answer.
|
---|
43 |
|
---|
44 | <h3>Are you maintaining GDBM?</h3>
|
---|
45 |
|
---|
46 | <p>No. I understand that GDBM is still maintained by the FSF.
|
---|
47 |
|
---|
48 | <h3>Does it work on NT?</h3>
|
---|
49 |
|
---|
50 | <p>It should, but I haven't tried it. You'll need a C compiler to
|
---|
51 | build the native library. Let me know if you try.
|
---|
52 |
|
---|
53 | <h3>Why does the test harness report exceptions</h3>
|
---|
54 |
|
---|
55 | <p>The test harness may report messages such as
|
---|
56 |
|
---|
57 | <pre>
|
---|
58 | caught: au.com.pharos.gdbm.GdbmException: File open error: No such file or
|
---|
59 | directory? (gdbmjava.c:101)
|
---|
60 | </pre>
|
---|
61 |
|
---|
62 | <p>These are expected exceptions: the test harness is making sure that
|
---|
63 | exceptions are thrown when they should be.
|
---|
64 |
|
---|
65 | <h3>I was trying to compile the Java GDBM distribution and it says gdbm.h not found</h3>
|
---|
66 |
|
---|
67 | <p>(Sandeep Kumar)
|
---|
68 |
|
---|
69 | <ol>
|
---|
70 | <li>Make sure you have the GDBM library installed on your system.
|
---|
71 | If the library is not installed, you should be able to find it at
|
---|
72 | <a href="http://www.gnu.org/">www.gnu.org</a>
|
---|
73 |
|
---|
74 | <li>Make sure your compiler is configured to find the libraries and
|
---|
75 | include files.
|
---|
76 |
|
---|
77 | </ol>
|
---|
78 |
|
---|
79 | <h3><tt>GdbmFile.h</tt> is missing</h3>
|
---|
80 |
|
---|
81 | <p>(Paul Matthews)
|
---|
82 |
|
---|
83 | <p><tt>GdbmFile.h</tt> is build by <tt>javah</tt> when the library is
|
---|
84 | built.
|
---|
85 |
|
---|
86 | <h3>What is the best source to learn Java?</h3>
|
---|
87 |
|
---|
88 | <p>(Celil Germeyan)
|
---|
89 |
|
---|
90 | <p>Personally, I recommend the excellent Java series of books from
|
---|
91 | <a href="http://www.ora.com/info/java/bibliography.html/">O'Reilly and
|
---|
92 | Associates</a> and the
|
---|
93 | <a href="http://java.sun.com/docs/books/index.html">Javasoft/Addison
|
---|
94 | Wesley</a> books.
|
---|
95 |
|
---|
96 | <h3>I get a `not ok 40' message running the test</h3>
|
---|
97 |
|
---|
98 | <p>(Steve Waldman)
|
---|
99 |
|
---|
100 | <p>If you find a bug, either have a look at the code yourself, or
|
---|
101 | send e-mail to
|
---|
102 | <a href="mailto:[email protected]"><tt>[email protected]</tt></a>.
|
---|
103 | There's no warranty on JavaGDBM, but I will try to respond to your
|
---|
104 | mail and problem.
|
---|
105 |
|
---|
106 | <h3>I get linker errors on Solaris</h3>
|
---|
107 |
|
---|
108 | <p>(Alex Soto)
|
---|
109 |
|
---|
110 | <pre>
|
---|
111 | Hi,
|
---|
112 |
|
---|
113 | I'm hoping to use your JavaGDBM api for my application, but I'm
|
---|
114 | having some problems compiling the libgdbmjava.so. Here is a partial
|
---|
115 | listing of the errors:
|
---|
116 |
|
---|
117 | gcc -o libgdbmjava.so -shared gdbmjava.o -lgdbm
|
---|
118 | Text relocation remains referenced
|
---|
119 | against symbol offset in file
|
---|
120 | free 0x258
|
---|
121 | /usr/local/lib/libgdbm.a(gdbmreorg.o)
|
---|
122 | free 0xd0
|
---|
123 | /usr/local/lib/libgdbm.a(gdbmclose.o)
|
---|
124 | free 0xb8
|
---|
125 | /usr/local/lib/libgdbm.a(gdbmclose.o)
|
---|
126 | free 0x218
|
---|
127 | [snipped]
|
---|
128 |
|
---|
129 | I have used the libgdbm.a lib before, and don't believe there is a
|
---|
130 | problem with it. I'm compiling to Solaris 2.6, using JDK 1.1.4.
|
---|
131 | </pre>
|
---|
132 |
|
---|
133 | <p>The solution turned out to be that the gdbm native library
|
---|
134 | must be compiled with the <tt>-fpic</tt> flag to cause the compiler to
|
---|
135 | generate position-independant code.
|
---|
136 |
|
---|
137 | <h3>What happens if a reader tries to open the database while a writer is doing something?</h3>
|
---|
138 |
|
---|
139 | <p>(Rich Neill)
|
---|
140 |
|
---|
141 | <p>Access will be denied until the writer releases its lock.
|
---|
142 |
|
---|
143 | <p>JavaGDBM uses a shared-read/exclusive-write protocol at the OS
|
---|
144 | level. However, multiple Java threads can access a file concurrently.
|
---|
145 |
|
---|
146 | <h3>What platforms does JavaGDBM run on?</H3>
|
---|
147 |
|
---|
148 | <p>It should run on any platform that supports JDK1.1 or higher, JNI
|
---|
149 | (Java Native Interface), and GDBM. JavaGDBM is known to run on
|
---|
150 |
|
---|
151 | <ul>
|
---|
152 | <li>Linux/i386
|
---|
153 | <li>Solaris/SPARC and Solaris/i86
|
---|
154 | <li>AIX 4
|
---|
155 | </ul>
|
---|
156 |
|
---|
157 | <p>If you have any information on other platforms, please let me know.
|
---|
158 |
|
---|
159 | <h3>You don't anticipate going Pure Java soon, do you?</h3>
|
---|
160 |
|
---|
161 | <p>(Brian Thorstad)
|
---|
162 |
|
---|
163 | <p>It's on the `long-term' TODO list. I'd like to do it, but don't have
|
---|
164 | any date in mind.
|
---|
165 |
|
---|
166 | <h3>Acknowledgements</h3>
|
---|
167 |
|
---|
168 | <p>Everybody who's sent in questions or comments.
|
---|
169 |
|
---|
170 | <p>Redhat and Javasoft, and the authors of GDBM, Linux, gcc, autoconf,
|
---|
171 | and other software used in building JavaGDBM.
|
---|
172 |
|
---|
173 | </html> |
---|