I am trying to get SQLite working with the playframework but so far no luck.
I have Downloaded sqlitejdbc-v056.jar and put it into the lib folder.
I then changed the application.conf:
db.driver=org.sqlite.JDBC
db.url="jdbc:sqlite:/db/geolookup.sqlite"
db.default.user=sa
db.default.password=sa
I created a folder db and drop my sqlite db into it.
Now I start play with play run
Everything seems to compile ok, but when I call the url: http://127.0.0.1:9000
I get the following error:
driver.url has type STRING rather than OBJECT with the following line highlited:
db.driver=org.sqlite.JDBC
What am I missing?
try this:
db.default.driver="org.sqlite.JDBC"
db.default.url="jdbc:sqlite:/home/tex/dbtest"
db.default.user="sa"
db.default.password=""
Notice that the folder of the db must be an absolute path !
(BTW: with this configuration the application starts but when I try to run the evolution it throws an exception, I think this is a "dialect" problem...)
Hope this helps...
You are propably using the wrong method to get the data from the config. From your error I assume you use it like this:
configuration.getConfig("db.driver")
But this method expects an JSON object under the path "db.driver". Since under the "db.driver" path you have a string, you should read the data using this method:
configuration.getString("db.driver")
This will make the "rather than OBJECT" error go away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With