Creating and setting DataSource without loading 'DomainNode.driver.xml' file.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Creating and setting DataSource without loading 'DomainNode.driver.xml' file.

noban

 Hi!

   I`m writing desktop DataBase client. So I can`t install on end user   PC`s my application with "DomainNode.driver.xml" file inside. Because it contains login & password. Therefore, as I inderstand, I need to create dataSource on the fly, when user has provided Login & Password, and then load this DataSource into Cayenne and retrieve DataContext.

   How can I do that? As I understand for setting DataSource first of all I need to get configuration --->
   
    Configuration config = Configuration.getSharedConfiguration();

but this doesn`t work because `getSharedConfiguration()` is loading all necassary files and "DomainNode.driver.xml" as well.

   Does somebody have some hints on this?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Creating and setting DataSource without loading 'DomainNode.driver.xml' file.

Gentry, Michael (Contractor)
Why not include the DataNode XML (your DomainNode.driver.xml) file also?
You don't have to supply a valid username/password in it (you could even
leave it blank).  (Of course, you should probably have the
adapter/driver/url/etc specified.)  After they enter the
username/password, you can fill it in at runtime.

To the best of my knowledge, Cayenne reads in the configuration
information and, if you have logging turned on, it *looks* like it is
connecting to the DB specified in the DataNode, but it isn't actually
doing it then (I believe it is just creating the connection pool).  It
waits until it actually needs to do some SQL before it really connects.
So that gives you time to grab the DataNode and fill in the details.

/dev/mrg


-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Friday, July 29, 2005 7:07 AM
To: [hidden email]
Subject: Creating and setting DataSource without loading
'DomainNode.driver.xml' file.



 Hi!

   I`m writing desktop DataBase client. So I can`t install on end user
PC`s my application with "DomainNode.driver.xml" file inside. Because it
contains login & password. Therefore, as I inderstand, I need to create
dataSource on the fly, when user has provided Login & Password, and then
load this DataSource into Cayenne and retrieve DataContext.

   How can I do that? As I understand for setting DataSource first of
all I need to get configuration --->
   
    Configuration config = Configuration.getSharedConfiguration();

but this doesn`t work because `getSharedConfiguration()` is loading all
necassary files and "DomainNode.driver.xml" as well.

   Does somebody have some hints on this?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Creating and setting DataSource without loading 'DomainNode.driver.xml' file.

Andrus Adamchik
BTW, here is a Wiki FAQ article on that:

http://objectstyle.org/confluence/display/CAY/Setting+Database+Connection

Lately I personally prefer a custom DataSourceFactory (briefly mentioned
in the article above) that creates a "lazy" DataSource instance that pops
a Swing login panel whenever the first connection is requested by the app.
This is the cleanest solution IMO.

Andrus


> Why not include the DataNode XML (your DomainNode.driver.xml) file also?
> You don't have to supply a valid username/password in it (you could even
> leave it blank).  (Of course, you should probably have the
> adapter/driver/url/etc specified.)  After they enter the
> username/password, you can fill it in at runtime.
>
> To the best of my knowledge, Cayenne reads in the configuration
> information and, if you have logging turned on, it *looks* like it is
> connecting to the DB specified in the DataNode, but it isn't actually
> doing it then (I believe it is just creating the connection pool).  It
> waits until it actually needs to do some SQL before it really connects.
> So that gives you time to grab the DataNode and fill in the details.
>
> /dev/mrg
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Friday, July 29, 2005 7:07 AM
> To: [hidden email]
> Subject: Creating and setting DataSource without loading
> 'DomainNode.driver.xml' file.
>
>
>
>  Hi!
>
>    I`m writing desktop DataBase client. So I can`t install on end user
> PC`s my application with "DomainNode.driver.xml" file inside. Because it
> contains login & password. Therefore, as I inderstand, I need to create
> dataSource on the fly, when user has provided Login & Password, and then
> load this DataSource into Cayenne and retrieve DataContext.
>
>    How can I do that? As I understand for setting DataSource first of
> all I need to get configuration --->
>
>     Configuration config = Configuration.getSharedConfiguration();
>
> but this doesn`t work because `getSharedConfiguration()` is loading all
> necassary files and "DomainNode.driver.xml" as well.
>
>    Does somebody have some hints on this?
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Creating and setting DataSource without loading 'DomainNode.driver.xml' file.

noban
  Got it. Thank`s a lot!

>BTW, here is a Wiki FAQ article on that:
>
>http://objectstyle.org/confluence/display/CAY/Setting+Database+Connection
>
>Lately I personally prefer a custom DataSourceFactory (briefly mentioned
>in the article above) that creates a "lazy" DataSource instance that pops
>a Swing login panel whenever the first connection is requested by the app.
>This is the cleanest solution IMO.
>
>Andrus
>
>
>> Why not include the DataNode XML (your DomainNode.driver.xml) file also?
>> You don't have to supply a valid username/password in it (you could even
>> leave it blank).  (Of course, you should probably have the
>> adapter/driver/url/etc specified.)  After they enter the
>> username/password, you can fill it in at runtime.
>>
>> To the best of my knowledge, Cayenne reads in the configuration
>> information and, if you have logging turned on, it *looks* like it is
>> connecting to the DB specified in the DataNode, but it isn't actually
>> doing it then (I believe it is just creating the connection pool).  It
>> waits until it actually needs to do some SQL before it really connects.
>> So that gives you time to grab the DataNode and fill in the details.
>>
>> /dev/mrg
>>
>>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]]
>> Sent: Friday, July 29, 2005 7:07 AM
>> To: [hidden email]
>> Subject: Creating and setting DataSource without loading
>> 'DomainNode.driver.xml' file.
>>
>>
>>
>>  Hi!
>>
>>    I`m writing desktop DataBase client. So I can`t install on end user
>> PC`s my application with "DomainNode.driver.xml" file inside. Because it
>> contains login & password. Therefore, as I inderstand, I need to create
>> dataSource on the fly, when user has provided Login & Password, and then
>> load this DataSource into Cayenne and retrieve DataContext.
>>
>>    How can I do that? As I understand for setting DataSource first of
>> all I need to get configuration --->
>>
>>     Configuration config = Configuration.getSharedConfiguration();
>>
>> but this doesn`t work because `getSharedConfiguration()` is loading all
>> necassary files and "DomainNode.driver.xml" as well.
>>
>>    Does somebody have some hints on this?
>>
>


--
??????? ??????? ????, ????? ??????? ????? ?? ??????? http://mail.yandex.ru
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cayenne dependencies

Eric Schneider
Hi,

We're having awful time upgrading to a the new version of Sun's JSAS  
8.1 app server.   Based on what we're seeing so far, it's class  
loader related issues.    The first error we're seeing is related to  
Log4j and commons logging, but I'm guessing that this is the first  
layer of an ugly onion we'll have to peel.

First thing I'm attempting to figure out is the versions of the 3rd  
party packages cayenne 1.1 (final) depends on.

org.apache.commons.beanutils
org.apache.commons.collections
org.apache.commons.lang
org.apache.commons.logging
org.apache.log
org.apache.log4j
org.apache.oro
org.apache.velocity

I believe that's all of them, right?  Is there somewhere on the  
objectstyle site that will give me this information?

Thanks in advance,
Eric
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cayenne dependencies

Robert Zeigler-2
http://www.objectstyle.org/cayenne/userguide/install/postinstall.html

Robert

Eric Schneider wrote:

> Hi,
>
> We're having awful time upgrading to a the new version of Sun's JSAS
> 8.1 app server.   Based on what we're seeing so far, it's class  loader
> related issues.    The first error we're seeing is related to  Log4j and
> commons logging, but I'm guessing that this is the first  layer of an
> ugly onion we'll have to peel.
>
> First thing I'm attempting to figure out is the versions of the 3rd
> party packages cayenne 1.1 (final) depends on.
>
> org.apache.commons.beanutils
> org.apache.commons.collections
> org.apache.commons.lang
> org.apache.commons.logging
> org.apache.log
> org.apache.log4j
> org.apache.oro
> org.apache.velocity
>
> I believe that's all of them, right?  Is there somewhere on the
> objectstyle site that will give me this information?
>
> Thanks in advance,
> Eric

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cayenne dependencies

Eric Schneider
Thanks Robert!

That was the tip I needed.  :-)

Cheers,
e.

On Aug 1, 2005, at 10:22 AM, Robert Zeigler wrote:

> http://www.objectstyle.org/cayenne/userguide/install/postinstall.html
>
> Robert
>
> Eric Schneider wrote:
>
>> Hi,
>>
>> We're having awful time upgrading to a the new version of Sun's JSAS
>> 8.1 app server.   Based on what we're seeing so far, it's class  
>> loader
>> related issues.    The first error we're seeing is related to  
>> Log4j and
>> commons logging, but I'm guessing that this is the first  layer of an
>> ugly onion we'll have to peel.
>>
>> First thing I'm attempting to figure out is the versions of the 3rd
>> party packages cayenne 1.1 (final) depends on.
>>
>> org.apache.commons.beanutils
>> org.apache.commons.collections
>> org.apache.commons.lang
>> org.apache.commons.logging
>> org.apache.log
>> org.apache.log4j
>> org.apache.oro
>> org.apache.velocity
>>
>> I believe that's all of them, right?  Is there somewhere on the
>> objectstyle site that will give me this information?
>>
>> Thanks in advance,
>> Eric
>

Loading...