Is it possible to create a read-only connection pool in Glassfish, talking to MySql, so that no updates are allowed? I want to have people use a replicated MySql database and I want to make sure no one tries to do updates.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Just give select only privileges to the user your app server connects as, so mysql will enforce that you can only select from the database, not update or delete anything.

You'd want to run something like this sql statement for that user,

grant select on thedb.* to 'myuser'@'host' identified by'thepassword';
link|improve this answer
feedback

Your Answer

 
or
required, but never shown