Posts Tagged Query

NonUniqueResultException in Hibernate

March 6, 2012
NonUniqueResultException in Hibernate

Sometimes we will get the NonUniqueResultException when we tried to get the result-set by executing query using Hibernate. The following is the stack trace of the exception: query did not return a unique result: 2 org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.hibernate.internal.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:899) at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:890) at org.bss.dao.SampleDAO.main(SampleDAO.java:84) This happens because you’re expecting [...]

Deal with Stored Procedures using phpMyAdmin

March 2, 2012
Deal with Stored Procedures using phpMyAdmin

phpMyAdmin MySQL web interface doesn’t contain any editor to manipulate or create stored procedure like all other IDEs. But you can create/modify the Stored Procedure using the queries. Example query for creating Stored Procedure ‘SP_INS_MEMBER’ is: DELIMITER $$   DROP PROCEDURE IF EXISTS `DB_NAME`.`SP_INS_MEMBER`$$   CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_INS_MEMBER`(IN subProcessId VARCHAR(100), IN storeId VARCHAR(100), IN [...]

Enable log for queries on MySQL

December 23, 2011
Enable log for queries on MySQL

Generally we will get some situations where we need to see the each and every query hitting the MySQL server, especially while debugging. Viewing each & every query hitting any MySQl database is possible by enabling the logs in MySQL configuration. Go to the MySQL home directory where you installed MySQL. In my case it [...]

 

If you have a Tip, Comment, Article or anything you want to share, please send it to: i@poisure.com