Posts

How to fetch large size XML document values by StaX using Java?

package com.main.File; public class BulkFileSeparationReader {     public static void main(String[] args) throws ClassNotFoundException {         String fileName = "combine.xml";                List<BookSpecBean> bookspec2 = (List<BookSpecBean>) parseXML2(fileName);         for(BookSpecBean bean : bookspec){ //          System.out.println(bean.recordreferencechar); //           System.out.println(bean.pricetypecodechar); //          System.out.println(bean.priceamountchar); //          System.out.println(bean.currencycodechar); //          //          System.out.println(bean.toStr...

How to fetch particular values from a column among different values?

If you are having a table named Status_details TABLE NAME :Status_details OrderId      EmployeeName    EmployeeId          Status                 BillingNumber  Date 101              Selvan                     120021           Hand Delivery      CTS02153     2015-07-01 102              Selvam                    120022           Dispatched           CTS02154...

how to take date exactly older than 30 days in mysql?

If you want to take the date exactly older 30 days in mysql database If your current date is 4/09/2015 You want the record older than 30 days then the 30th day date is 05/08/2015 mysql> Select * from table_name where current_date() - INTERVAL 30 DAY; IF YOU GIVE LIKE THIS YOU WILL GET THE EXACTLY THE 30 DAY . SUPPOSE YOU WANT THE LIST OF ALL THE RECORDS THAT ARE 30 DAYS OLDEER. FOR THAT MYSQL> SELECT * FROM table_name where receiveddate < date_sub(now(), INTERVAL 30 DAY) This will dispaly all the records that are 30 days older. Hope this post will help someone around the world. Thank you......

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 ...
i have one requirement..some one help me out how to do it...my query was.if the user is selecting two days ex:monday and wednesday. i need to get all the monday and wednesday date from current date for 24 days ... like if the select tuesday and thursday i want to get date of those days for 24 count ...

Few Question in Mysql. If any one know means tell me?

Am working in live server database without taking backup. Unfortunately I truncate the table means is there any way to retrieve the truncate table in mysql? Answer Please... Like wise same i working in live server database without taking backup. IF i delete the row in a table. Is there any other way to retrieve the row? Answer Please....  Likewise same while working in MySqlYog if we have duplicate values in a table. We selecting the row with where condition. Then it will display the values Table name: orderdetails Orderid  Ordernumber  Employeeid 1                  1201          231 2                  1201          231 We select the any one values and click the delete button. Then it will ...