-
1. Re: Wildfly REST server in Eclipse
ehugonnet Jun 20, 2016 1:49 AM (in response to royibernthal)Hi,
Maybe you should take a look at : Java API for RESTful Web Services (JAX-RS) - WildFly 10 - Project Documentation Editor
JSP are a template model for creating web pages mostly since you want to provide a REST API you shouldn't use them.
You may also want to take a look at various simple examples the WildFly team provides : GitHub - wildfly/quickstart: Holds all versioned docs & samples
-
2. Re: Wildfly REST server in Eclipse
royibernthal Jun 20, 2016 1:10 PM (in response to ehugonnet)Thank you I think I understand REST better now.
1) How should I approach simple database operations? Is there a simple framework or wildfly library perhaps that handles sql?
2) Is there a common alternative for phpMyAdmin in the Java world? Or is phpMyAdmin as good as any other choice?
-
3. Re: Wildfly REST server in Eclipse
ehugonnet Jun 20, 2016 1:16 PM (in response to royibernthal)I guess JPA is a valid answer to 1/ as for 2/ is it a DBA tool you are looking for ? then it depends on your database.
-
4. Re: Wildfly REST server in Eclipse
royibernthal Jun 20, 2016 5:33 PM (in response to ehugonnet)JPA is not quite specific.
Yes DBA, can you please explain what you meant by depends on my database?
Would you rather I'll choose correct answer for the REST answer and then open another thread for these questions? I'm not sure how things work around here.
-
5. Re: Wildfly REST server in Eclipse
ehugonnet Jun 21, 2016 3:54 AM (in response to royibernthal)Well you should take a look at a JavaEE tutorial as all is covered there with a 'standard' for most of your needs (JPA, JAX-RS, etc.)
phpMyAdmin is usable as any database tool to build or query you data. JPA can also create/update the schema according to your object model.
-
6. Re: Wildfly REST server in Eclipse
royibernthal Jun 21, 2016 5:39 PM (in response to ehugonnet)After a little research it seems JDBC would suit my specific needs more than JPA.
More specifically, I narrowed my options down to Spring JDBC vs Sql2o.
Do you by any chance know if there's a way in Spring JDBC to avoid having to create a Mapper and map things automatically like Sql2o does? (assuming I understood their examples correctly)
There's a third option actually:
Simple MySQL Library for Java | Unibia.net
I liked its syntax and simplicity, but it seems to be very old, would it be wise to use something that was last updated in 2011?
phpMyAdmin - I see, I'll probably stick to it then
-
7. Re: Wildfly REST server in Eclipse
ehugonnet Jun 22, 2016 3:36 AM (in response to royibernthal)JPA is an abstraction layer over JDBC, if you are in a Java EE application server maybe it is better this way, using also EJB for the transaction management.
Also if your queries are really simple JPA makes your code really easy to write.
Spring JDBC will bring a lot of stuff with it and i'm not sure of the benefits over the hassle but that's only my point of view.
I don't know Sql2o (which looks like JPA) nor Simple MySQL Library for Java but I think the community size / support is also a criterium when choosing a tool.
Also a point to note is that JPA being a standard you'll get a lot of documentation / support.
-
8. Re: Wildfly REST server in Eclipse
royibernthal Jun 25, 2016 6:56 PM (in response to ehugonnet)JPA vs JDBC - Yeah I'm aware of it. I'm under the impression that JPA will be more of a hassle in my case since I'm used to writing SQL, but I'll definitely reconsider - JPA might be the better choice in the long run.
Thank you very much for the help.