Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6586227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:45:52+00:00 2026-05-25T16:45:52+00:00

I currently work in a project where each user has his own schema in

  • 0

I currently work in a project where each user has his own schema in Oracle 11g DB. This design was done because all the security roles and privileges to access the Oracle tables are stored in the DB. Our team is trying to figure how to do this in the cool Play! framework. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:45:53+00:00Added an answer on May 25, 2026 at 4:45 pm

    As far as I understand, you can try wrap a value of DB.datasource with something like this (where currentUser() and currentPassword() should return the credentials of the current user who makes a request):

    public class DataSourceWrapper {
        private DataSource original;
        public DataSourceWrapper(DataSource original) {
            this.original = original;
        }
    
        public Connection getConnection() {
            return original.getConnection(currentUser(), currentPassword());
        }
    
        ...
    
        public DataSource getOriginal() {
            return original;
        }
    }
    

    Replacement of DB.datasource should happen between execution of onApplicationStart() methods of DB and JPA plugins, so that you need to create a custom plugin:

    public class DataSourceReplacementPlugin extends PlayPlugin {
        public void onApplicationStart() {
            DB.datasource = new DataSourceWrapper(DB.datasource);
        }
    
        public void onApplicationStop() {
            if (DB.datasource instanceof DataSourceWrapper) {
                DB.datasource = ((DataSourceWrapper) DB.datasource).getOriginal();
            }
        }
    }
    

    and register in with the appropriate priority level in conf/play.plugins:

    350: DataSourceReplacementPlugin
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently on a short research project. The company I work at has
I'm current on POS project. User require this application can work both online and
I work on a project with 4 other devs. We currently use Visual Studio
I'm currently working on some evaluation work for a project that I'm planning. I
I'm currently experimenting with EJB3 as a prestudy for a major project at work.
I'm currently researching a project for the place that I work in. We are
I currently work with an Oracle database and we use stored procedures for all
I currently work at a company that has a lot of custom applications that
I am currently working on a struts2 project. In my project the user is
I am doing some work on a legacy project, one that has been upgraded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.