Where is this h2.jar file?  I do not see it when I extract the zip file.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of Matthew Woodward
Sent: Tuesday, November 25, 2008 12:40 PM
To: [email protected]
Subject: [OpenBD] Re: Installing and Running OpenBD


Augusta ENT wrote:
> I apologize for being so uneducated with the Java lingo but when you
mention
> things like classpath I am lost.  I understand bluedragon tags and how to
> create a great app that helps people access their data but I do not
program
> in Java.  classpath?
>

Sorry--got ahead of myself there. For the embedded database, go to
http://h2database.com and download the "All Platforms" zip file (NOT the
Windows installer, which is the server version). Unzip that, and you'll
find an h2.jar file contained in the zip.

If you're using the pre-built Jetty download, take the h2.jar file and
copy that to {path_to_jetty_install}/lib/openbd Then restart Jetty.

This will make H2 available to Jetty and OpenBD.

> If I can link H2 to OpenBD today I will re-create my apps tableset in H2
and
> test
> it "in production".  My app is ready I only need to know how to connect BD
> to the
> database.
>
> Thanks so much for your help!
>

Couple of different approaches. If you want to edit the OpenBD XML file
directly, open up {path_to_jetty_install}/etc/openbd/bluedragon.xml in a
text editor.

If you've already created some datasources you should have a <cfquery>
node under your <server> node somewhere. If you don't, you'll need to
create one.

So the minimum you'd need in your XML config file for an H2 datasource
would be something like this:
    <datasource name="myh2db">
      <displayname>myh2db</displayname>
      <connectionretries>0</connectionretries>
      <password>admin</password>
      <sqldelete>true</sqldelete>
      <sqlupdate>true</sqlupdate>
      <username>admin</username>
      <drivername>org.h2.Driver</drivername>
      <sqlstoredprocedures>true</sqlstoredprocedures>
      <perrequestconnections>false</perrequestconnections>
      <sqlinsert>true</sqlinsert>
      <sqlselect>true</sqlselect>
      <connectiontimeout>120</connectiontimeout>
      <port>0</port>
      <server></server>
      <databasename>myh2db</databasename>
      <description></description>
      <initstring></initstring>
      <logintimeout>120</logintimeout>
      <hoststring>jdbc:h2:C:\Documents and
Settings\Administrator\Desktop\jetty-6.1.12-OpenBD\jetty-6.1.12-OpenBD\webro
ot_cfmlapps\cfmlWebContext_1\WEB-INF\bluedragon\h2databases/myh2db;AUTO_SERV
ER=TRUE;IGNORECASE=true;USER=admin;PASSWORD=admin</hoststring>
      <maxconnections>24</maxconnections>
      <name>myh2db</name>
    </datasource>

This would be inside a cfquery node, which is inside your server node.
(Sounds like you already had an Access datasource set up, so my
apologies if some of this is a bit too basic for your situation; just
figured I'd outline it for others.)

Note in particular the <hoststring> node--that's where you'll want to
put the path where you want the database to be stored. In this example I
created this datasource using the admin console (hence the odd mix of \
and / -- I'm tweaking all the Windows-related stuff this week, but this
does work), but you can just type this in manually, save the file, and
then restart Jetty.

Make SURE you have AUTO_SERVER=TRUE in your hoststring, because
otherwise bad things happen when multiple threads hit the embedded
database (this was a tip from Nitai).

As far as emulating other database engines, you can add a MODE property
to your hoststring:
http://h2database.com/html/features.html#compatibility

For example for SQL Server, you would add MODE=MSSQLServer to your
hoststring.

If you create your datasource manually in the XML file I *believe* you
have to run one query in order for the files to be created and then
you're off to the races.

Let me know if any of this needs clarification.

Hope that helps!
Matt

--
Matt Woodward
[EMAIL PROTECTED]
http://www.mattwoodward.com/blog

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html




--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official blog @ http://blog.openbluedragon.org/
!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to