Today I read a post here that directed me to this page about connecting to a database. It said to make sure this line is NOT commented in conf/application.conf:
ebean.default="models.*"
I didn't see it in there so I added it to the end. Then I got a ClassNotFoundException complaining about models.Company.
So I added "C:\Documents and Settings\Dan\My Documents\myapps\computer-database-jpa\app\models" to my classpath. Then that error went away and I got the old error message about 2.sql again
I don't know if I have a good database driver. I googled "MySQL database drivers" and got a
page with a bunch of choices.
This one seemed like it might be right.
I downloaded mysql-connector-java-5.1.22.zip.
I didn't know what to do with it. So I extracted it to my desktop and opened the README file. It has 999 lines so I gave up and got some ice cream.
Then I discovered
another file that might help. It's called connector-j.html. I opened it and found a part about installation.
The instructions did not tell me where to put the file, just to put it in my classpath.
I thought it would make sense to put it in the directory where MySQL was installed. So I located C:\Program Files\MySQL. I looked around for something that might be a driver and only found .java files.
The I read in the MySQL docs that
To use MySQL Connector/J with an application server such as GlassFish, Tomcat or JBoss, read your vendor's documentation for more information on how to configure third-party class libraries
I figure that they are telling me the instructions should be provided by Play in this situation.
In another paragraph it said
you can put the driver's .jar file in the WEB-INF/lib subdirectory of your webapp
but I didn't see a WEB-INF directory in any of the play stuff. So I still don't know where I should put the driver file.
I give up and just put it here: C:\Program Files\MySQL\MySQL Server 5.6\lib, and add that to the system classpath.
I press Ctrl-D and then run to restart the app
I get the same NoClassDefFoundError about models.Company
So I am just as stuck as before.
Is this a typical getting started Odyssey? All I want to do is get the sample app going with MySQL, a super common database. My failed research process seems pretty undirected and futile for something that I would expect every other person to have to do in the beginning. Is Play intended for an audience for whom all of these "where do I put this file" and "why is it not finding my class" quandaries obvious?