You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by sim085 <si...@hotmail.com> on 2010/12/16 21:21:16 UTC
Geronimo + Derby + Datasource
Hello, I am trying to create a datasource for an embeded derby database. I
have followed several examples on the web but so far I did not manage to get
this working. What I did is the following;
1. Goto DB Manager.
2. Create the new Database name "MyDatabase".
3. Create a table in "MyDatabase".
4. Insert some records in the new table.
5. Goto Database Pools.
6. Click on link "Using the Geronimo database pool wizard".
7. Set Database Pool Name to "MyDatasource" and Database Type to "Derby
embedded" (click next)
8. Set Database Name to "MyDatabase" (left all other fields blank and
clicked deploy)
Now MyDatasource is displayed in the list of datasources and next to it I
can see that it is deployed as Server-wide and its status is set to running.
I then go to the Run SQL window. Select MyDatasource from the dropdown list
and write a simple SELECT statement. However when I click the run button I
get the following error.
----
An error encountered while executing SQL command(s).
An error encountered while executing SQL command(s).
Connection authentication failure occurred. Reason: Invalid
authentication..
----
I tried to look on the Internet but did not manage to find a solution. Can
someone please help me and tell me if I am creating the datasource correctly
and if not where I am doing a mistake.
--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Geronimo-Derby-Datasource-tp2100676p2100676.html
Sent from the Users mailing list archive at Nabble.com.
Re: Geronimo + Derby + Datasource
Posted by viola lu <vi...@gmail.com>.
In geronimo 2.1.7 and 2.2, derby authentication is enabled by default. So
you have to input username and password: dbadmin/manager when create
datasource.Otherwise there will be errors.
On Fri, Dec 17, 2010 at 1:15 PM, David Jencks <da...@yahoo.com>wrote:
> What you started out trying to do with derby ought to work. Unfortunately
> I'm not likely to have time to investigate why it didn't.
>
> david jencks
>
> On Dec 16, 2010, at 4:40 PM, sim085 wrote:
>
> >
> > Hello again. I continued to play a little more with datasources and
> finally
> > managed to create a datasource for PostgreSQL without a lot of problems.
> I
> > then decided to try to use Derby but not embeded. I downloaded Derby and
> > started the database. I then created the datasource using steps 1 to 4 of
> my
> > first post. All worked fine :)
> >
> > Thanks again for the help. I think this is a problem with embeded derby
> > although I read somewhere this is not meant to be used so maybe I should
> not
> > have been creating a datasource for this.
> > --
> > View this message in context:
> http://apache-geronimo.328035.n3.nabble.com/Geronimo-Derby-Datasource-tp2100676p2101947.html
> > Sent from the Users mailing list archive at Nabble.com.
>
>
--
viola
Re: Geronimo + Derby + Datasource
Posted by David Jencks <da...@yahoo.com>.
What you started out trying to do with derby ought to work. Unfortunately I'm not likely to have time to investigate why it didn't.
david jencks
On Dec 16, 2010, at 4:40 PM, sim085 wrote:
>
> Hello again. I continued to play a little more with datasources and finally
> managed to create a datasource for PostgreSQL without a lot of problems. I
> then decided to try to use Derby but not embeded. I downloaded Derby and
> started the database. I then created the datasource using steps 1 to 4 of my
> first post. All worked fine :)
>
> Thanks again for the help. I think this is a problem with embeded derby
> although I read somewhere this is not meant to be used so maybe I should not
> have been creating a datasource for this.
> --
> View this message in context: http://apache-geronimo.328035.n3.nabble.com/Geronimo-Derby-Datasource-tp2100676p2101947.html
> Sent from the Users mailing list archive at Nabble.com.
Re: Geronimo + Derby + Datasource
Posted by sim085 <si...@hotmail.com>.
Hello again. I continued to play a little more with datasources and finally
managed to create a datasource for PostgreSQL without a lot of problems. I
then decided to try to use Derby but not embeded. I downloaded Derby and
started the database. I then created the datasource using steps 1 to 4 of my
first post. All worked fine :)
Thanks again for the help. I think this is a problem with embeded derby
although I read somewhere this is not meant to be used so maybe I should not
have been creating a datasource for this.
--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Geronimo-Derby-Datasource-tp2100676p2101947.html
Sent from the Users mailing list archive at Nabble.com.
Re: Geronimo + Derby + Datasource
Posted by sim085 <si...@hotmail.com>.
Thanks for your reply.
> what happens if you start at step 5 and let the connection pool create the
> db for
> you when you request the first connection, and do steps 4 and 5 from the
> run sql window?
If I start from step 5 it seems that the database does not get created (I
can not see it from the DB manager) and when I try to run the sql to create
the table I get the same error as before. Here are the steps I followed;
1. Goto Database Pools.
2. Click on link "Using the Geronimo database pool wizard".
3. Set Database Pool Name to "MyDatasource2" and Database Type to "Derby
embedded" (click next)
4. Set Database Name to "MyDatabase2" (left all other fields blank and
clicked deploy)
NOTE: made sure that create database is set to true.
5. Run sql script to create table (I get the same error as before).
6. Goto DB Manager (MyDatabase2 does not show up).
> If this doesn't work or is unacceptable for some reason can you let us
> know
> which geronimo version you are using?
I am using geronimo-tomcat6-javaee5-2.2.1
--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Geronimo-Derby-Datasource-tp2100676p2101372.html
Sent from the Users mailing list archive at Nabble.com.
Re: Geronimo + Derby + Datasource
Posted by David Jencks <da...@yahoo.com>.
I'm not a derby expert and I've run into similar issues in the past....
what happens if you start at step 5 and let the connection pool create the db for you when you request the first connection, and do steps 4 and 5 from the run sql window?
If this doesn't work or is unacceptable for some reason can you let us know which geronimo version you are using?
david jencks
On Dec 16, 2010, at 12:21 PM, sim085 wrote:
>
> Hello, I am trying to create a datasource for an embeded derby database. I
> have followed several examples on the web but so far I did not manage to get
> this working. What I did is the following;
>
> 1. Goto DB Manager.
> 2. Create the new Database name "MyDatabase".
> 3. Create a table in "MyDatabase".
> 4. Insert some records in the new table.
> 5. Goto Database Pools.
> 6. Click on link "Using the Geronimo database pool wizard".
> 7. Set Database Pool Name to "MyDatasource" and Database Type to "Derby
> embedded" (click next)
> 8. Set Database Name to "MyDatabase" (left all other fields blank and
> clicked deploy)
>
> Now MyDatasource is displayed in the list of datasources and next to it I
> can see that it is deployed as Server-wide and its status is set to running.
> I then go to the Run SQL window. Select MyDatasource from the dropdown list
> and write a simple SELECT statement. However when I click the run button I
> get the following error.
>
> ----
> An error encountered while executing SQL command(s).
>
> An error encountered while executing SQL command(s).
> Connection authentication failure occurred. Reason: Invalid
> authentication..
> ----
>
> I tried to look on the Internet but did not manage to find a solution. Can
> someone please help me and tell me if I am creating the datasource correctly
> and if not where I am doing a mistake.
>
>
>
>
>
>
> --
> View this message in context: http://apache-geronimo.328035.n3.nabble.com/Geronimo-Derby-Datasource-tp2100676p2100676.html
> Sent from the Users mailing list archive at Nabble.com.