title: Play Framework 2.1.0 - Using Ebean to query existing database tables
body: <p>I am having trouble with returning data from a existing database table (SQL Server 2008 R2).  I can successfully authenticate and connect to the database, I have a model created that I attempted to map to a particular table, then as a test tried to return a row count, the row count always returns 0.  I think perhaps I do not understand how Play/Ebean database connectivity works.  At present I have the below:</p>
  
  <p>Model - Data.java:</p>
  
  <pre><code>package models;
  
  import javax.persistence.*;
  
  import play.db.ebean.*;
  
  @Entity
  @Table(name="someTable")  
  public class Data extends Model {
  
      private static final long serialVersionUID = 1L;
  
      @Id
      public int someKey;
  
      public String someCol;
  
      public static Finder&lt;Integer,Data&gt; find = new Finder&lt;Integer,Data&gt;( Integer.class, Data.class );
  
  }
  </code></pre>
  
  <p>Controller - Index.java</p>
  
  <pre><code>package controllers;
  
  import java.util.*;
  import models.Data;
  import play.mvc.*;
  
  public class Index extends Controller {
  
      static int rowCount = Data.find.getMaxRows();
  
      public static Result index() {
          Result res = ok(rowCount);
          return res;
      }
  }
  </code></pre>
  
  <p>Application.conf (Relevant snippets):</p>
  
  <pre><code>db.default.driver=net.sourceforge.jtds.jdbc.Driver
  db.default.url="jdbc:jtds:sqlserver://server.domain.local/someDB;instance=SQL"
  db.default.user=someUser
  db.default.password="password"
  
  evolutionplugin=disabled
  
  ebean.default="models.*"
  </code></pre>
  
  <p>I don't profess to understand how Evolutions work, but I do database development work separately in SQL, i.e. DDL and schema creation/modifying.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thanks</p>