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 8947737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:50:36+00:00 2026-06-15T12:50:36+00:00

Using Play! Framework 2.0.4 and EBean as the persistence layer I am attempting to

  • 0

Using Play! Framework 2.0.4 and EBean as the persistence layer I am attempting to wrap a databases “meta” information to Java classes.

I map the classes in application.conf:

db.myData.url="jdbc:sqlserver://localhost:2301;databaseName=myData;"
ebean.myData="models.database.JavaTable"

I then created a class as follows:

package models.database;
import javax.persistence.Column;
import javax.persistence.Entity;

import javax.persistence.Table;

import play.db.ebean.Model;
@Entity
@Table(name="tables",schema="INFORMATION_SCHEMA",catalog="myData")
public class JavaTable extends Model{

@Column(name="TABLE_NAME")
public String table_name;

public static Finder<String, JavaTable> find = new Finder<String, JavaTable>(
    String.class, JavaTable.class
);
}

When I fire up Play!, it tells me that I need to run an evolution on the database to create the table “myData.INFORMATION_SCHEMA.tables”. I then tried to test the connection via a unit test…

@Test
public void testGetTables(){
     running(fakeApplication(), new Runnable() {
            @Override
            public void run() {
                EbeanServer server = Ebean.getServer("myData");

                List<SqlRow> rows = server.createSqlQuery("select * from myData.Information_Schema.Tables").findList();
               for(SqlRow row: rows)
                System.out.println("====>Row: " + row.toString());

            }
        });
}

The unit test executes correctly and the table names are printed out successfully.

Edit: per @nico_ekito I removed the evolution plugin in the configuration file and started getting:

RuntimeException DataSource user is null 

So, researching a bit I decided to disable other datasources in the config file and moved the database I’m attempting to communicate with to “db.default” and “ebean.default” and the models started working. Is there a way to tell a model which datasource it should use if Play has multiple databases defined? Setting the classes via “ebean.default=”myData.JavaTable” did not seem to work.

  • 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-06-15T12:50:38+00:00Added an answer on June 15, 2026 at 12:50 pm

    You should try to disable the evolutions by adding the following in your application.conf file:

    evolutionplugin=disabled
    

    The tests are ok because since you’re not starting a real application, but using a fakeApplication() which does not use the evolutions plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ebean in Play Framework 2 for storing some basic information. This application
Writing a Java application using the Play framework and need some HTTP-Live streaming. I
I'm working on a web application using Java Play Framework 2.0 that heavily relies
I am using Play Framework 2.0.1. I have created a Java application using the
I am writing small app, using Play Framework 2.0 which uses Ebean as ORM.
Ok, I have been thinking of developing a web application using the play framework
I have the following Play Framework entity (using Morphia for persistence) as part of
I am using FlexJson within my play framework application but at the point I
I am using Ebean with Play Framework 2 and sometimes it falls with OptimisticLockException
am using play 2 framework with java I have added a project dependency as

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.