This week's book giveaways are in the Cloud and AI/ML forums. We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line! See this thread and this one for details.
I have been writing a little APEX, but I was told it would be a good idea to learn JAVA before I continue with APEX. I created a JAVA application and I have a MySQL server / database to connect to. I created an Order Class, OrderDAO Class, and a ConnectionPOOL class. The Order class is the pojo. I'm trying to write a getAllOrders () method in the OrderDAO class (and UPDATE and DELETE), but I can't seem to get it to work. Would anyone mind taking a look?
I'm getting an error with the statement s and catch?
Whenever you post code please surround it with Code tags. In the editor window highlight (select) your block of code and then click on the "Code" button just above the editor pane. I fixed it for you this time.
I would expect your DAO class to have at least the following fields: id, name, and createdDate.
I would expect that you would construct a DAO object with the data in the result set.
I would expect the constructed DAOs to be gathered up in a List<OrderDAO>, and that this list would be returned from the method.
You should provide a toString() method to print out the state of the fields and then use that in place of this println() construct.
Edit: Went back to your code and I forgot that you had an "Order" class, so that should be used in my preceding comments.