You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Nicolas Dufour <ni...@neometsys.fr> on 2005/09/29 16:18:45 UTC

user authentication

Hi

I dont understand why I cant connect to my base.

I have put in derby.properties :
derby.authentication.provider=BUILTIN
derby.user.foo=foo

I'm connecting to the base thru a networkserver, and then when i try to 
do a select i have this error :
ERROR 42Y07: Schema 'FOO' does not exist

What is the problem ????

Thank you

Nicolas


Re: user authentication

Posted by wo...@yahoo.co.jp.
oops,

please add a "create=true" option in url like below.
"jdbc:derby://localhost:1527/MyDB;create=true;user=foo;password=foo".
Otherwise, you might be stuck again... :p

Regards,
Wolfgang


--------------------------------------
Know more about Breast Cancer
http://pr.mail.yahoo.co.jp/pinkribbon/


Re: user authentication

Posted by wo...@yahoo.co.jp.
Hi Nicolas

Don't worry many people are stuck there. :)

In this page (http://db.apache.org/derby/faq.html#schema_exist),
It says...
----------------------
4.3. Why do I get the error 'schema does not exist'? 
 
The current schema for any connection defaults to a schema corresponding to the user name. If no user name is supplied then the user name (and hence current schema) defaults to APP. 

However even though the current schema is set to the user name, that schema may not exist. A schema is only created by CREATE SCHEMA or creating an object (table etc.) in that schema (this is implicit schema creation). 

The one exception to this is the APP schema, which is always created, though applications should not depend on that. 

So you will see the schema not exists error if your application tries to access the current schema before any objects have been created in it. Possibilities are you try to perform a DROP TABLE before creating it, or try to SELECT from a table to see if it should be created or not, or when there is a problem with the sql for the very first object you try to create in a particular schema and no explicit CREATE SCHEMA was issued. 

----------------------

So what you have to do is
First, you should comment out or remove both
derby.authentication.provider and derby.user.foo lines in
derby.properties.
Second, restart Derby.
Third, connect to Derby and commit a "CREATE SCHEMA foo;" SQL.
Forth, put back both two lines you removed at the first to
derby.properties.
Fifth, restart Derby.
Sixth, Access to Derby programatically like below.
-----------------------
            String dbURL = "jdbc:derby://localhost:1527/MyDB"; // where
MyDB is the name of your database.
            Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
            Properties prop = new Properties();
            prop.put("user","foo");
            prop.put("password","foo");
            //prop.put("retreiveMessagesFromServerOnGetMessage","true");
            Connection conn = DriverManager.getConnection(dbURL, prop); 
-----------------------
or from ij.
-----------------------
if you access to the embedded Derby,
ij> connect 'jdbc:derby:MyDB;user=foo;password=foo';
or
if you access to Derby booted as server.
ij> connect 'jdbc:derby://localhost:1527/MyDB;user=foo;password=foo';
-----------------------


Regards,
Wolfgang



--------------------------------------
Know more about Breast Cancer
http://pr.mail.yahoo.co.jp/pinkribbon/


Re: user authentication

Posted by Deepa Remesh <dr...@gmail.com>.
Hi Nicolas,

Please see if this FAQ solves your problem:
http://db.apache.org/derby/faq.html#schema_exist

Also, are you setting derby.system.home property when starting network
server? If so, derby.properties file must be in directory specified by
this property. If it is not set, Derby uses derby.properties file in
the current user directory. This is just to make sure the properties
you set are getting used.

To enable Derby authentication, you must also set
derby.connection.requireAuthentication property to true. You can find
information about this property at
http://db.apache.org/derby/docs/10.1/tuning/

Hope this helps.

Deepa

On 9/29/05, Nicolas Dufour <ni...@neometsys.fr> wrote:
> Hi
>
> I dont understand why I cant connect to my base.
>
> I have put in derby.properties :
> derby.authentication.provider=BUILTIN
> derby.user.foo=foo
>
> I'm connecting to the base thru a networkserver, and then when i try to
> do a select i have this error :
> ERROR 42Y07: Schema 'FOO' does not exist
>
> What is the problem ????
>
> Thank you
>
> Nicolas
>
>