Simple Admin tool for Embedded DBs (Derby/JavaDB)

View: New views
3 Messages — Rating Filter:   Alert me  

Simple Admin tool for Embedded DBs (Derby/JavaDB)

by twilliams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I believe many of the embedded dbs, like derby only allow access from within the JVM that is using the db. So this presents a problem that you cannot run an external db admin tool to work with the db while the grails app is running. To get around this limitation I wrote a controller & 3 gsps (copy to grails-app/views/dbutil) that can be used to admin the db within the running grails app. There are three actions with the following urls described below...

/$appname$/dbutil/info - Shows info about the db (tables/columns/column type, etc)
/$appname$/dbutil/data - Outputs all the actual data alphabetically by table
/$appname$/dbutil/sql - Allows free-form select/update/delete commands

Note: You will need to download commons-dbutils-1.1 from apache.

IMPORTANT: You will definitely want to protect this controller's url from unauthorized access since the sql action can be used to do just about anything.

DbutilController.groovy
data.gsp
info.gsp
sql.gsp

Re: Simple Admin tool for Embedded DBs (Derby/JavaDB)

by Miguel Ping :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I will definetely try this out ;)

Thanks

On Tue, Jul 22, 2008 at 2:42 AM, twilliams <kaerfredoc@...> wrote:

I believe many of the embedded dbs, like derby only allow access from within
the JVM that is using the db. So this presents a problem that you cannot run
an external db admin tool to work with the db while the grails app is
running. To get around this limitation I wrote a controller & 3 gsps (copy
to grails-app/views/dbutil) that can be used to admin the db within the
running grails app. There are three actions with the following urls
described below...

/$appname$/dbutil/info - Shows info about the db (tables/columns/column
type, etc)
/$appname$/dbutil/data - Outputs all the actual data alphabetically by table
/$appname$/dbutil/sql - Allows free-form select/update/delete commands

Note: You will need to download commons-dbutils-1.1 from apache.

IMPORTANT: You will definitely want to protect this controller's url from
unauthorized access since the sql action can be used to do just about
anything.

http://www.nabble.com/file/p18580801/DbutilController.groovy
DbutilController.groovy
http://www.nabble.com/file/p18580801/data.gsp data.gsp
http://www.nabble.com/file/p18580801/info.gsp info.gsp
http://www.nabble.com/file/p18580801/sql.gsp sql.gsp
--
View this message in context: http://www.nabble.com/Simple-Admin-tool-for-Embedded-DBs-%28Derby-JavaDB%29-tp18580801p18580801.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: Simple Admin tool for Embedded DBs (Derby/JavaDB)

by Graeme Rocher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tyler

You should turn it into a Grails plugin

Cheers

On Tue, Jul 22, 2008 at 2:42 AM, twilliams <kaerfredoc@...> wrote:

>
> I believe many of the embedded dbs, like derby only allow access from within
> the JVM that is using the db. So this presents a problem that you cannot run
> an external db admin tool to work with the db while the grails app is
> running. To get around this limitation I wrote a controller & 3 gsps (copy
> to grails-app/views/dbutil) that can be used to admin the db within the
> running grails app. There are three actions with the following urls
> described below...
>
> /$appname$/dbutil/info - Shows info about the db (tables/columns/column
> type, etc)
> /$appname$/dbutil/data - Outputs all the actual data alphabetically by table
> /$appname$/dbutil/sql - Allows free-form select/update/delete commands
>
> Note: You will need to download commons-dbutils-1.1 from apache.
>
> IMPORTANT: You will definitely want to protect this controller's url from
> unauthorized access since the sql action can be used to do just about
> anything.
>
> http://www.nabble.com/file/p18580801/DbutilController.groovy
> DbutilController.groovy
> http://www.nabble.com/file/p18580801/data.gsp data.gsp
> http://www.nabble.com/file/p18580801/info.gsp info.gsp
> http://www.nabble.com/file/p18580801/sql.gsp sql.gsp
> --
> View this message in context: http://www.nabble.com/Simple-Admin-tool-for-Embedded-DBs-%28Derby-JavaDB%29-tp18580801p18580801.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Grails Project Lead
G2One, Inc. Chief Technology Officer
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email