[BDB 11gR2 Beta] [#18298] First Questions about DBD 11gR2
Luis Paolini
git at gempi.com.br
Thu Feb 25 03:47:20 PST 2010
Hi Sandra,
Thanks for the detailed instructions.
I followed the steps below and got an error on step 8 (building the solution).
Here are some details for each step.
0) From the "Building the Java API" section of the Building Berkeley DB for Windows documentation:
I configured the directories according to my java jdk installation.
C:\Program Files\Java\jdk1.6.0_16\include, C:\Program Files\Java\jdk1.6.0_16\include\win32 and
C:\Program Files\Java\jdk1.6.0_16\bin
2) Apply the attached patch 18298_win_jdbc.diff
I installed the patch application and executed the command:
D:\Downloads\Oracle\Berkeley_Beta\db-5.0.11\db-5.0.11>"C:\Program Files\GnuWin32\bin\patch.exe" -p1 -i 18298_win_jdbc.diff
I’m not sure if I had to modify the file 18298_win_jdbc.diff before running the patch. (Something related to Windows end-of-line
Endings)
3) Copy the attached "Constants.java" file into the sql/jdbc/SQLite/ directory.
Just copied the file “Contants.java” into D:\Downloads\Oracle\Berkeley_Beta\db-5.0.11\db-5.0.11\sql\jdbc\SQLite
4) Open the build_windows/Berkeley_DB.sln file in Visual Studio
Opened build_windows/Berkeley_DB.sln file in Visual Studio
5) Select "File->Add->Existing Project", and add "build_windows/db_sql_jdbc.vcproj" into the solution.
Just added build_windows/db_sql_jdbc.vcproj" into the solution.
6) Right-click db_sql_jdbc in the solution explorer, and select "Properties".
Ok.
7) In Linker->General. Set the "Output File" to be "$(OutDir)/sqlite_jni.dll" (it is "$(OutDir)/.dll" before you change it).
Configured the “Output File” to be "$(OutDir)/sqlite_jni.dll"
8) Either build the solution, or the "db_sql" project.
After building the solution I got the following summary:
========== Build: 57 succeeded, 1 failed, 0 up-to-date, 10 skipped ==========
Looking for the fail, I got this:
5>Linking...
5>LINK : fatal error LNK1181: cannot open input file 'libdb_sql50d.lib'
5>Build log was saved at "file://d:\Downloads\Oracle\Berkeley_Beta\db-5.0.11\db-5.0.11\build_windows\Win32\Debug\db_sql_jdbc\BuildLog.htm"
5>db_sql_jdbc - 1 error(s), 1 warning(s)
The BuildLog.htm file is attached.
After that I tried to rebuild the “db_sql” project and I got the following summary:
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
9) Build the db_sql_jdbc project. The project assumes you have Java (1.6) installed in your path.
Finally, I Built the db_sql_jdbc project and got the following summary
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Testing:
I executed the command java -classpath jdbc.jar -Djava.library.path=. SQLite.Shell test.db
The SQLite console was opened.
The directory test.db-journal was created by it was empty.
Regards,
Luis
-----Original Message-----
From: Sandra Whitman [mailto:sandra.whitman at oracle.com]
Sent: segunda-feira, 22 de fevereiro de 2010 14:44
To: Luis Paolini
Cc: 'Dave Segleau'; 'Sleepycat Software Support'; 'Kent Rollins'; bdb-beta-feedback at oss.oracle.com
Subject: Re: [BDB 11gR2 Beta] [#18298] First Questions about DBD 11gR2
Hi Luis,
Here are the instructions to follow on top of the Beta 2 db-5.0.11 drop. You will need Version 1.6 of the Java JDK plus the two attached
files:
18298_win_jdbc.diff
Constants.java
0) From the "Building the Java API" section of the Building Berkeley DB for Windows documentation:
The following instructions assume that you have installed the Sun Java Development Kit in d:\java. If you installed elsewhere or have different Java software, you will need to adjust the pathnames accordingly.
# Set your include directories. Choose Tools -> Options -> Projects -> VC++ Directories. Under the "Show directories for" pull-down, select "Include files". Add the full pathnames for the d:\java\include and d:\java\include\win32 directories. Then click OK. These are the directories needed when including jni.h.
# Set the executable files directories. Choose Tools -> Options -> Projects -> VC++ Directories. Under the "Show directories for" pull-down, select "Executable files". Add the full pathname for the d:\java\bin directory, then click OK. This is the directory needed to find javac.
2) Apply the attached patch 18298_win_jdbc.diff
The directions for this are below under: APPLYING PATCHES ON WINDOWS
To summarize, apply the patch like this:
BerkeleyDB_root_dir>"<path to patch.exe>patch.exe" -p1 -i 18298_win_jdbc.diff
3) Copy the attached "Constants.java" file into the sql/jdbc/SQLite/ directory.
4) Open the build_windows/Berkeley_DB.sln file in Visual Studio
5) Select "File->Add->Existing Project", and add "build_windows/db_sql_jdbc.vcproj" into the solution.
6) Right-click db_sql_jdbc in the solution explorer, and select "Properties".
7) In Linker->General. Set the "Output File" to be "$(OutDir)/sqlite_jni.dll" (it is "$(OutDir)/.dll" before you change it).
8) Either build the solution, or the "db_sql" project.
9) Build the db_sql_jdbc project. The project assumes you have Java (1.6) installed in your path.
To test:
(Note that this process creates a "jdbc.jar" and a "sqlite_jni.dll".)
$ cd build_windows/Win32/Debug (if you built Debug)
$ java -classpath jdbc.jar -Djava.library.path=. SQLite.Shell test.db
The shell can be used in a similar way to the default SQLite shell. To verify that the resulting database is generated by Berkeley DB, verify that a test.db-journal directory is created and the content look like:
log.0000000001
__db.001
__db.002
__db.003
__db.004
__db.005
__db.006
__db.register
APPLYING PATCHES ON WINDOWS
------------------------------------------------------
1. Download the patch utility. For Windows, the patch utility can be
downloaded from:
http://gnuwin32.sourceforge.net/packages/patch.htm
2. Install the patch utility. On Windows, the default installation
location is:
C:\Program Files\GnuWin32\bin\patch.exe
3. Download the patch/patches into the appropriate Berkeley DB
root directory for the release being patched.
4. cd to the Berkeley DB root directory for the release.
5. You may find that the patch files do not have the Windows end-of-line
endings. In this case the patch must be converted to follow the Windows
end-of-line conventions. There are several ways to perform this
conversion. Some options for converting a patch to follow the Windows
end-of-line
conventions are: 1) running a program like 'unix2dos' 2) using Visual
Studio.
6. Run the patch utility as shown below (this step requires that
the patch has the Windows end-of-line format as discussed in step 5),
replacing your path to 'patch.exe' if it was changed from the default
installation:
BerkeleyDB_root_dir>"C:\Program Files\GnuWin32\bin\patch.exe" -p<num> -i
patch.<ver>
Where
- 'patch.<ver>' is the name of the patch
- '-p<num>' - indicates the number of leading slashes that are stripped
from each file name found in the patch file. - '-i' indicates read
from 'patch.<ver>'
Please let me know if you have any questions or problems. I will be out starting tomorrow, Tuesday 2/23-Friday 2/26 but someone on the team will be available to address any questions that arise.
Thank you,
Sandra
Luis Paolini wrote:
>
> Dave,
>
>
>
> I need a little help here.
>
> Based on the instructions below I installed Visual
> Studio C++ Express and successfully executed the step a).
>
> Then I downloaded SQLite JDBC from
> http://www.ch-werner.de/javasqlite/ but I’m not sure how to executed
> the step c).
>
> I read the instructions that come with SQLite JDBC
> (javasqlite-200100131.tar.gz
> <http://www.ch-werner.de/javasqlite/javasqlite-20100131.tar.gz>) but I
> don’t know how to use the makefile to create sqlite.jar and
> libsqlite_jni.dll
>
> based on libsqlite3.dll generated from step a).
>
> Could you give some instructions?
>
> I’m doing all these steps in a Windows machine
>
>
>
> Essentially, you would want to do the following:
> a) build the Berkeley DB 11gR2 library from source;
> b) download the SQLite JDBC driver package from
> http://www.ch-werner.de/javasqlite/;
> c) using the package and the instructions from step b), build a
> sqlite.jar and libsqlite_jni.dll based on the libsqlite3.dll that was
> built/generated from step a),
> d) you should then be able to build and run a Java application that
> calls the SQLite Java interface using the JDBC driver from step c),
>
> Thanks,
>
>
>
> Luis
>
>
>
>
>
> *From:* Dave Segleau [mailto:dave.segleau at oracle.com]
> *Sent:* quarta-feira, 17 de fevereiro de 2010 17:07
> *To:* Luis Paolini
> *Cc:* Sandra Whitman; Kent Rollins; bdb-beta-feedback at oss.oracle.com;
> Sleepycat Software Support; Claudio Ferreira
> *Subject:* Re: [BDB 11gR2 Beta] [#18298] First Questions about DBD 11gR2
>
>
>
> Luis,
>
> Thanks for the reply. I wanted to follow up on Sandra's email from
> this morning. We're looking into your questions in more depth, but I
> just want to make sure we understand what it is that you're trying to
> do so that we're answering the right questions. We understand that you
> have existing applications, built with various Oracle development
> tools. Some of these applications use the Oracle Database Server and
> some apparently use Berkeley DB Java Edition.
>
> * Specifically, which application development tool are you trying
> to use to build /this /application?
> * Is this a new application, specifically for the mobile platform?
> Or is it a single application with two modes: a) connected to an
> Oracle Server database and b) disconnected, running on a
> smartphone device with SQLite/Berkeley DB installed locally?
> * Does this new application plan to use Berkeley DB 11gR2 via the
> SQL API, which is based on SQLite?
> * Does this new application plan to access the SQLite/Berkeley DB
> database via JDBC?
> * Does this new application plan on using capabilities of the
> SQLite spatial functionality, just simple SQL or something else?
>
> With regards to your recent question:
>
> "I used to work with BDB as a single jar file (like je-3.3.87.jar)
> that was referenced in a JDeveloper Application. For deployment, this
> jar file was packed with my application libraries and files to be
> deploy to the client. Now it seems that this process must be changed.
> The way to install BDB in a windows machine will consider some Dlls
> installation. Is this correct?"
>
> Berkeley DB Java Edition is not the same library as the Berkeley DB
> 11gR2 Beta release. They are two separate products. Berkeley DB Java
> Edition does not have support for a SQL API -- it provides a Key/Value
> pair API, a Java collections API and a Data Persistence Layer API for
> POJO-style Java Object persistence. The Berkeley DB 11gR2 Beta release
> library is written in C, has the same API support and is the product
> that is introducing a new SQL API, based on integration of the SQLite
> library. How you build, link and deploy Berkeley DB Java Edition vs
> Berkeley DB is different.
>
> In the case of Berkeley DB Java Edition, being referenced in a
> JDeveloper Application, all you needed was the Berkeley DB Java
> Edition jar file.
>
> In the case of Berkeley DB 11gR2 Beta, the SQL API is based on SQLite.
> As such, your build, link and deployment process would be different
> than using Berkeley DB Java Edition. Essentially, you would want to do
> the following:
> a) build the Berkeley DB 11gR2 library from source;
> b) download the SQLite JDBC driver package from
> http://www.ch-werner.de/javasqlite/;
> c) using the package and the instructions from step b), build a
> sqlite.jar and libsqlite_jni.dll based on the libsqlite3.dll that was
> built/generated from step a),
> d) you should then be able to build and run a Java application that
> calls the SQLite Java interface using the JDBC driver from step c),
>
> Does this make sense and does it help you make forward progress?
>
> If we're still not in sync with regards to what you're trying to do,
> we can either continue to have this discussion via email or get on a
> conference call. Please let me know if you would like to schedule a
> call and what time works best for you. I just want to make sure that
> we properly understand what it is that you are trying to build.
>
> Regards,
>
> Dave
>
> On 2/17/2010 4:20 AM, Luis Paolini wrote:
>
> Hi Sandra,
>
> Thank you for the answers.
> I have an additional question based on the answer for question 2.
>
> Additional Question 2:
> I used to work with BDB as a single jar file (like je-3.3.87.jar)
> that was referenced in a JDeveloper Application.
> For deployment, this jar file was packed with my application
> libraries and files to be deploy to the client.
> Now it seems that this process must be changed. The way to install
> BDB in a windows machine will consider some
> Dlls installation. Is this correct?
>
> Regards,
>
> Luis Paolini
>
>
> -----Original Message-----
> From: Sandra Whitman [mailto:sandra.whitman at oracle.com]
> Sent: domingo, 14 de fevereiro de 2010 22:48
> To: Luis Paolini
> Cc: bdb-beta-feedback at oss.oracle.com <mailto:bdb-beta-feedback at oss.oracle.com>; support at sleepycat.com <mailto:support at sleepycat.com>; Whitman,Sandra
> Subject: Re: [BDB 11gR2 Beta] [#18298] First Questions about DBD 11gR2
>
> Hi Luis,
>
>
> Thank you again for your email. I have been investigating your
> questions and do have some answers which I will list below in the
> question/answer section. I am still doing some more research regarding
> ADF and JDBC access and will get back to you on those. In the mean time
> if you have any other questions, or if I did not completely answer
> something, please let me know.
>
>
> Question 1:
> Is necessary to build BDB from source files?
>
> Answer 1:
> At the current time you do need to build Berkeley DB from source. This
> requires Visual Studio C++. You can use the free Express version
> available from Microsoft.com. We will however consider a pre-built
> version for the future.
>
> Question 2:
> How is the BDB jar file obtained?
>
> Answer 2:
> What are the plans for the Berkeley DB jar file? Is that to be used
> with ADF? I am still checking, but a jar file may not be
> needed for this. If a Berkeley DB jar file is needed, it can be built
> with Version 1.5 or 1.6 of the Java JDK.
>
>
> Question 3:
> How is BDB configured to support SQL?
>
> Answer 3:
> SQL support is built automatically on Windows. The SQL library is built
> as libdb_sql50.dll in the Release mode or libdb_sql50d.dll in the Debug
> mode. An SQL command line interpreter called db_sql_shell.exe is also
> built.
>
> Please take a look in the documentation titled "Building the SQL API -
> Chapter 5. Building Berkeley DB for Windows"
>
> From there:
> Building the SQL API
>
> Binary Compatibility With SQLite
>
> SQL support is built automatically on Windows. The SQL library is built
> as libdb_sql50.dll in the Release mode or libdb_sql50d.dll in the Debug
> mode. An SQL command line interpreter called db_sql_shell.exe is also built.
> Binary Compatibility With SQLite
>
> Both libdb_sql50.dll and libdb_sql50d.dll are compatible with
> sqlite3.dll. You can rename libdb_sql50.dll to sqlite3.dll and
> db_sql_shell.exe to sqlite3.exe, and use these applications as a
> replacement for the standard SQLite binaries with same names.
>
>
> Question 4:
> Are the SQLite data types are supported by Oracle ADF?
>
> Answer 4:
> I am still investigating this point. However, the ADF components
> support SQLite so there should not be a problem here.
> I will get back to you on this though.
>
>
> Question 5:
> Is any documentation available regarding JDBC access to the database.
>
> Answer 5:
> The ODBC and JDBC drivers are not included in the initial Beta release
> package, but they are supported and they will be included in the
> production release. In order to build the drivers, please download the
> open source ODBC driver from http://www.ch-werner.de/sqliteodbc/ and the
> open source JDBC driver from http://www.ch-werner.de/javasqlite.
>
>
> Question 6:
> Are there any examples using BDB SQLite Interfaces?
>
> Answer:
> The BDB SQLite interface examples are under the distribution at
> sql\examples\c.
>
>
> Best Regards,
> Sandra
> Sandra Whitman
> Oracle Global Customer Support
>
>
> --
> Oracle <http://www.oracle.com>
> David Segleau | Director Product Management - Berkeley DB
> Phone: +1 425 945 8533 | Mobile: +1 408 420 7350
> Oracle Database Engineering
>
> Green Oracle <http://www.oracle.com/commitment>Oracle is committed to
> developing practices and products that help protect the environment
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4875 (20100217) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4878 (20100218) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
> ------------------------------------------------------------------------
>
> _______________________________________________
> BDB-BETA-FEEDBACK mailing list
> BDB-BETA-FEEDBACK at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/bdb-beta-feedback
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4885 (20100221) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/bdb-beta-feedback/attachments/20100225/b9df8a53/attachment-0001.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/bdb-beta-feedback/attachments/20100225/b9df8a53/attachment-0001.htm
More information about the BDB-BETA-FEEDBACK
mailing list