I have a Java application that has a GUI made with Swing and that uses two databases interchangeably. One of the two databases is mongoDB and the other one is MySQL. Which database to use is chosen with a command line option. For the MySQL database I am also using Hibernate and JPA. The code I have looks like this:
Advertisement
Tag: entitymanager
Returning result of count native query using EntityManager in Java?
I have the following SQL Query : SELECT COUNT(*) FROM DOG where ID = ‘SampleId’; I am trying to write this in java : public int returnCountOfDogTable(String id){ String sql= “SELECT …
Advertisement