You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Taeho Kang <tk...@gmail.com> on 2009/04/14 09:31:01 UTC

Using different ddl for other DB's?

Hello, all.
I'm faced with a problem of setting up JackRabbit with a "not-so-common"
database system.
I know I have to write a new schema.ddl file, but I don't know how it can be
loaded.
In which directory/package should I place the new ddl file?

Thank you in advance,

Taeho

Re: Using different ddl for other DB's?

Posted by Stefan Guggisberg <st...@gmail.com>.
On Tue, Apr 14, 2009 at 12:01 PM, Taeho Kang <tk...@gmail.com> wrote:
> Wow, many thanks for your prompt reply.
> I'm going to
> use org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager, which
> lets me specify many options such as JDBC driver, schema name, and etc.
>
> Now, since I'm testing on a local environment, where should I place my
> schema.ddl file?
>
> I tried placing my schema.ddl file in java classpath, but It hasn't worked
> so far....
> - "javax.jcr.RepositoryException: Configuration error: unknown schema
> 'tkangdb'
>
> Please note that I set my java classpath with System.setProperty(..) method
> in my main() method.

you can't manipulate the 'current' classpath by setting the "java.class.path"
system property during runtime. this won't have any effect (unless you use
custom classloaders of course). try specifying the classpath when
you invoke the jvm.

cheers
stefan

>
> Do you have any tips?
>
>
> /Taeho
>
>
>
> On Tue, Apr 14, 2009 at 5:15 PM, Alexander Klimetschek <ak...@day.com>wrote:
>
>> On Tue, Apr 14, 2009 at 9:31 AM, Taeho Kang <tk...@gmail.com> wrote:
>> > I'm faced with a problem of setting up JackRabbit with a "not-so-common"
>> > database system.
>> > I know I have to write a new schema.ddl file, but I don't know how it can
>> be
>> > loaded.
>> > In which directory/package should I place the new ddl file?
>>
>> It's loaded from the classpath and is placed in the same java package
>> as the class using it (persistence manager or database filesystem).
>> The only thing mentioned in the repository xml is the basename of the
>> file. The classpath depends on the servlet container / jvm context,
>> but for a webapp you can put it into WEB-INF/classes. For a bundle
>> persistence manager this gives you:
>>
>>
>> WEB-INF/classes/org/apache/jackrabbit/core/persistence/bundle/<myschema>.ddl
>>
>> Please note that you might have to write your own
>> BundleDbPersistenceManager if the database behaves very different. You
>> would subclass it and overwrite some of the methods to align data
>> types and other things like that.
>>
>> You should also look at the code - here are the svn trunk links for
>> the mentioned implementations and their built-in schema files:
>>
>> Bundle DB PM:
>>
>> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/
>>
>> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/
>>
>> DB Filesystem:
>>
>> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/
>>
>> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/fs/db/
>>
>>
>> Regards,
>> Alex
>>
>> --
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>>
>

Re: Using different ddl for other DB's?

Posted by Taeho Kang <tk...@gmail.com>.
Wow, many thanks for your prompt reply.
I'm going to
use org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager, which
lets me specify many options such as JDBC driver, schema name, and etc.

Now, since I'm testing on a local environment, where should I place my
schema.ddl file?

I tried placing my schema.ddl file in java classpath, but It hasn't worked
so far....
- "javax.jcr.RepositoryException: Configuration error: unknown schema
'tkangdb'

Please note that I set my java classpath with System.setProperty(..) method
in my main() method.

Do you have any tips?


/Taeho



On Tue, Apr 14, 2009 at 5:15 PM, Alexander Klimetschek <ak...@day.com>wrote:

> On Tue, Apr 14, 2009 at 9:31 AM, Taeho Kang <tk...@gmail.com> wrote:
> > I'm faced with a problem of setting up JackRabbit with a "not-so-common"
> > database system.
> > I know I have to write a new schema.ddl file, but I don't know how it can
> be
> > loaded.
> > In which directory/package should I place the new ddl file?
>
> It's loaded from the classpath and is placed in the same java package
> as the class using it (persistence manager or database filesystem).
> The only thing mentioned in the repository xml is the basename of the
> file. The classpath depends on the servlet container / jvm context,
> but for a webapp you can put it into WEB-INF/classes. For a bundle
> persistence manager this gives you:
>
>
> WEB-INF/classes/org/apache/jackrabbit/core/persistence/bundle/<myschema>.ddl
>
> Please note that you might have to write your own
> BundleDbPersistenceManager if the database behaves very different. You
> would subclass it and overwrite some of the methods to align data
> types and other things like that.
>
> You should also look at the code - here are the svn trunk links for
> the mentioned implementations and their built-in schema files:
>
> Bundle DB PM:
>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/
>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/
>
> DB Filesystem:
>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/
>
> https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/fs/db/
>
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>

Re: Using different ddl for other DB's?

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Apr 14, 2009 at 9:31 AM, Taeho Kang <tk...@gmail.com> wrote:
> I'm faced with a problem of setting up JackRabbit with a "not-so-common"
> database system.
> I know I have to write a new schema.ddl file, but I don't know how it can be
> loaded.
> In which directory/package should I place the new ddl file?

It's loaded from the classpath and is placed in the same java package
as the class using it (persistence manager or database filesystem).
The only thing mentioned in the repository xml is the basename of the
file. The classpath depends on the servlet container / jvm context,
but for a webapp you can put it into WEB-INF/classes. For a bundle
persistence manager this gives you:

WEB-INF/classes/org/apache/jackrabbit/core/persistence/bundle/<myschema>.ddl

Please note that you might have to write your own
BundleDbPersistenceManager if the database behaves very different. You
would subclass it and overwrite some of the methods to align data
types and other things like that.

You should also look at the code - here are the svn trunk links for
the mentioned implementations and their built-in schema files:

Bundle DB PM:
https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/
https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/persistence/bundle/

DB Filesystem:
https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/
https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/fs/db/


Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com