I have a query to get the size of databases I have. I have written the following:
@SuppressWaings("unchecked")
List<Long> results = (List<Long>)em.createQuery("SELECT sum( data_length + index_length ) / 1024 / 1024 "DataBaseSizeinMB" FROM information_schema.TABLES GROUP BY table_schema ").getResultList();
where em is the EntityManager. The query on its own runs successfully in myphpadmin. But when I run it in my java code, I get exception. Any idea what is wrong? Thanks.
