Posts

Showing posts from August, 2015

Query : How to give privileges to create a procedure in Mysql?

Please Help.. Am using MySQL database While creating Procedure DELIMITER $$ CREATE PROCEDURE getStatus() BEGIN SELECT COUNT(*) FROM status_table; END $$ -------------------------------------------------- I received this Error Query: Create procedure getStatus() Begin Select count(*) from status_table; End Error Code: 1044 Access denied for user 'd5'@'192.168.10.65' to database 'onlinecard' Execution Time : 0 sec Transfer Time  : 0 sec Total Time     : 0.005 sec ----------------------------------------------------------------- How can i give grant permission to create procedure ? If any one knows means tell me From the morning itself i tried with few queries... That are listed below: GRANT SELECT ON mysql.proc TO 'Username'@'IPAddress'; If any one knows tell me..... Thanks in advance.....

How to change the String Value to Date Value without Hardcoded String value

If we have a Method updateStatusBySales1(bean, bean.dispatcheddate ); In this method we have dispatcheddate . this dispatcheddate is assigned here as String . While inserting into table it will through error. Because in the database table the dispatched date is assigned as date format. Want to change the dispatched date value as date. How to change the String value into date without hardcoded the value... While Surfing the net i found that all the examples given is hard coded value.  For example String str = "07/02/2010"  SimpleDateFormat formatter = new SimpleDateFormat ( "dd-MMM-yyyy" ) ; String dateInString = "07/02/2010" ; try { Date date = formatter . parse ( dateInString ) ; System . out . println ( date ) ; System . out . println ( formatter . format ( date ) ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; }  -------------------------------- Here i will show you Records fetching from excel ...