Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ABA94D16E for ; Mon, 23 Jul 2012 13:48:10 +0000 (UTC) Received: (qmail 5569 invoked by uid 500); 23 Jul 2012 13:48:10 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 5542 invoked by uid 500); 23 Jul 2012 13:48:10 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 5526 invoked by uid 99); 23 Jul 2012 13:48:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 13:48:10 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_HI,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rick.hillegas@oracle.com designates 148.87.113.117 as permitted sender) Received: from [148.87.113.117] (HELO rcsinet15.oracle.com) (148.87.113.117) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 13:48:02 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q6NDlaV1003342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Jul 2012 13:47:40 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q6NDlW9S006200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 23 Jul 2012 13:47:32 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q6NDlWtA032165 for ; Mon, 23 Jul 2012 08:47:32 -0500 Received: from dhcp-rmdc-twvpn-1-vpnpool-10-159-66-172.vpn.oracle.com (/10.159.66.172) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Jul 2012 06:47:31 -0700 Message-ID: <500D55F5.1050902@oracle.com> Date: Mon, 23 Jul 2012 06:47:33 -0700 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: AW: schema-questions References: <944A1108FF717B43A3F9AA883583DDB202330E8A@EVS01.intern.interpay.nl> <1342541288.30268.4346.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330E92@EVS01.intern.interpay.nl> <1342557348.30268.4451.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330EC7@EVS01.intern.interpay.nl> <1342626465.30268.4587.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330F41@EVS01.intern.interpay.nl> <1342716252.30268.4680.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330F7E@EVS01.intern.interpay.nl> <944A1108FF717B43A3F9AA883583DDB202330FD6@EVS01.intern.interpay.nl> In-Reply-To: <944A1108FF717B43A3F9AA883583DDB202330FD6@EVS01.intern.interpay.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Source-IP: ucsinet22.oracle.com [156.151.31.94] On 7/23/12 6:34 AM, Malte.Kempff@de.equens.com wrote: > Hi to all, > I tried to find something on the internet belongig to my question: > what is to do for connecting with a user to a different schema than > the username or APP. > Actually I found 2 hints > > 1. > use SET CURRENT SCHEMA > 2. > Make your own custom authentication > > Source of above hints is this site: > http://www.oreillynet.com/onjava/blog/2006/07/on_derby.html > that is > from 2006 > Well choice 1. is not really usable when a datasource is to be > defined, is it? > Choice 2.seems to be a bit overheaded. Is it so exotic to connect with > a user using a different schema so nobody know how to or an custom > implementation needs to be produced on ones own? > Or is there a way in the newest release of Derby? Hi Malte, There is nothing new in this area in the latest 10.9.1 release of Derby. You might be able to workaround this problem by writing your own thin DataSource which wraps the DataSource you are currently using. Your wrapping DataSource would issue a SET SCHEMA command before returning from its getConnection() methods. Hope this helps, -Rick > Thanks for hints in advance > Malte > *Von:* Malte.Kempff@de.equens.com [mailto:Malte.Kempff@de.equens.com] > *Gesendet:* Freitag, 20. Juli 2012 18:56 > *An:* derby-user@db.apache.org > *Betreff:* schema-questions > > > Somehow I ask now myself, how I can connect to another schema than the > username. > Currently I have a user tech that is suppose to connect to the schema > user_stuff via DataSource > I tried now this but obviously ist not correct becides the password is > still ignored also the schema seems not to be declared like this > Context.xml for defining the DataSource: > > > > auth="Container" > type="javax.sql.DataSource" > username="tech" > password="schnaddel" > *schema="USER_STUFF" > * driverClassName="org.apache.derby.jdbc.ClientDriver" > url="jdbc:derby://localhost:1527/testdb" > maxActive="10" > maxIdle="4"/> > > > Does anybody know what is to be used to be on the right schema > 'USER_STUFF' ? > > > > -----Urspr�ngliche Nachricht----- > Von: Tim Watts [mailto:tim@cliftonfarm.org] > Gesendet: Donnerstag, 19. Juli 2012 18:44 > An: Derby Discussion > Betreff: Re: AW: AW: AW: schema-questions > > On Thu, 2012-07-19 at 17:23 +0200, Malte.Kempff@de.equens.com wrote: > > Do I get it right, that the threads defined in Network server of derby > > should correspond with amount of connections in defined data source > > for derby in the Application Server, where it is running in? Is there > > any best practice? > > > I suppose so but not necessarily. Unless you have an uncontrollable > need to complicate life I would leave it at the default of 0 ("elastic > mode"). This way Derby will spawn a thread to service each connection > as it's made. A non-zero value will make that the upper limit for > worker threads. Not that Derby will refuse further connections once > the max is reached; only that the new connections will have to wait > for CPU time until one of the other threads is done or it's timeSlice > has expired. (But, of course, adding more threads doesn't magically > create more CPU capacity. So I imagine a non-zero value would be > balanced against the number of available cores/CPUs?) I'm writing > from a theoretical perspective here as I haven't actually messed with > any of this. > > My impression is that your goal is to explore web app development > using Derby. In general, focusing on performance tuning in the > absence of an actual performance issue is not going to be very productive. > > > > Malte > > > > > > -----Urspr�ngliche Nachricht----- > > Von: Tim Watts [mailto:tim@cliftonfarm.org] > > Gesendet: Mittwoch, 18. Juli 2012 17:48 > > An: Derby Discussion > > Betreff: Re: AW: AW: schema-questions > > > > Hi Malte, > > > > On Wed, 2012-07-18 at 13:44 +0200, Malte.Kempff@de.equens.com wrote: > > > Hi Tim > > > My JAVA_OPS look like that, when I use set command: > > > JAVA_OPTS=-Dderby.system.home=c:\derby-dbs > > > > That looks reasonable. > > > > > > > > I suppose that the JAVA_OPTS are recognized by derby in my > > > particular case. Otherweise I would not understand why derby > > > produces and writes and reads from the given directory. > > > It is a bit of unexplainable to me, since today it works with > > > following ij call java %JAVA_OPTS% -Dij.protocol=jebc:derby: -jar > > > %DERBY_HOME %/lib/derbyrun.jar ij > > > ij> connect > > > 'jdbc:derby://localhost:1527/testdb;create=true;user=tralla;password > > > =d > > > uddeldi'; > > > Here I get the expected error now: > > > FEHLER 08004: Die Verbindung konnte nicht authentifiziert werden. > > > Ursache: Die Benutzer-ID oder das Kennwort ist ung�ltig. > > > > > > > > > Yesterday it did not work neither via ij nor within tomcat. Always > > > it did not matter whether the right password or user was set or not. > > > > It would be very difficult to figure out exactly what actually > happened between yesterday and today from a few sketchy details. It > probably doesn't matter much at this point. > > > > > > > > Using tomcat I still get that ignoring of derby.properties, > > > > Did you try invoking test.jsp from my last post? That would tell > you if the running instance of Tomcat had a JAVA_OPTS and > derby.system.home passed through to it. > > > > > at least the password I am using seems not to matter at all Here my > > > entry in context.xml for tomcat similar to the recommanded one I > > > found in http://www.zetcode.com/db/apachederbytutorial/tomcat/ > > > > > > > > auth="Container" > > > type="javax.sql.DataSource" > > > username="tech" > > > password="schnaddel" > > > driverClassName="org.apache.derby.jdbc.ClientDriver" > > > url="jdbc:derby://localhost:1527/testdb" > > > maxActive="10" > > > maxIdle="4"/> > > > > > > > > > > > > The right password is supposed to be something else , but it works > > > :-D > > > (?!) > > > > > > By the way (sorry for asking such a question of beginners :-)): > > > Using the web-app of derby (Derby Network Server) there is the > > > option to change max amount of threads and thread time slices. > > > What does that mean exactly? Could that interfere with the > > > definition of DataSource within context.xml, or is that something > > > totally different? > > > > See > > http://db.apache.org/derby/docs/10.8/adminguide/tadminconfiguringthene > > tworkserver.html > > > > > > > > > > Lastly, let me point out that there is absolutely NO requirement to > run the Derby war in order to use Derby from a web application. You > could just as easily run the Derby Network Server in a separate > process or use an embedded Derby engine. Just wanted to point that > out so you and others aware of the possibilities. > > > > > > > > > > > > > > -----Urspr�ngliche Nachricht----- > > > Von: Tim Watts [mailto:tim@cliftonfarm.org] > > > Gesendet: Dienstag, 17. Juli 2012 22:36 > > > An: Derby Discussion > > > Betreff: Re: AW: schema-questions > > > > > > On Tue, 2012-07-17 at 18:13 +0200, Malte.Kempff@de.equens.com wrote: > > > > I start tomcat (version 6) with ist startup batch file only > > > > > > > OK. What displays when you type echo %JAVA_OPTS% at the command > > > prompt? > > > > > > To verify whether it's being passed through to Tomcat try saving the > > > following to webapps/ROOT/test.jsp then pointing your browser to > > > http://localhost:8080/test.jsp . > > > > > > test.jsp: > > > --------- > > > > > > > > > derby.system.home=<%= System.getProperty("derby.system.home") %>
> > > JAVA_OPTS=<%= System.getenv("JAVA_OPTS") %>
> > > > > > I have verified on my system that derby.properties is recognized > > > when setting derby.system.home via JAVA_OPTS. (Derby 10.8.1.2) > > > > > > > > > > -----Urspr�ngliche Nachricht----- > > > > Von: Tim Watts [mailto:tim@cliftonfarm.org] > > > > Gesendet: Dienstag, 17. Juli 2012 18:08 > > > > An: Derby Discussion > > > > Betreff: Re: schema-questions > > > > > > > > On Tue, 2012-07-17 at 16:44 +0200, Malte.Kempff@de.equens.com wrote: > > > > > Another thing I am wondreing is, that it seems not to matter > > > > > using a user or not using following derby.properties, though: > > > > > derby.stream.error.logSeverityLevel=0 > > > > > derby.database.fullAccessUsers=tech > > > > > derby.database.defaultConnectionMode=readOnlyAccess > > > > > derby.connection.requireAuthentication=true > > > > > derby.user.tech=lala_dongs > > > > > derby.user.rou=gaga_bings > > > > > > > > > > derby.authentication.provider=builtin > > > > > > > > > > > > > > > derby seems not to use my derby.proerties. I have put them to > > > > > the directory, which is given in the derby.system.home > > > > > Java-system-property. > > > > > It is told to put this system-property into the environment > > > > > variable JAVA_OPTS, so tomcat would use it for starting up. > > > > > I am using Windows-XP so I defined ths environment-variable in > > > > > the dialog as user defined variable. > > > > > What am I missing, since derby.properties seem not to work may > > > > > be not even been read. > > > > > > > > > Are you running Tomcat as a service? If so then see this: > > > > > > > > > > > > http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html > > > > > > > > (adjust according to the tomcat version you're using). > > > > > > > > > Thanks for hints in advance > > > > > > > > > > Malte > > > > > > > > > > > > > > >