Posts

How to find the active connections in MySql?

Image
If you want to find the active open connections in your database By giving the command in your SqlYog mysql> SHOW STATUS LIKE '%conn%;

org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException

If you are using Struts2 Framework.  While Upload file normally you can upload below 2MB. If the file size exceeds more than 2MB. Then you will get this type of exception . 04-Feb-2016 15:42:41.141 INFO [http-nio-8084-exec-78]  com.opensymphony.xwork2.util.logging.commons.CommonsLogger.info  Unable to find 'struts.multipart.saveDir' property setting.  Defaulting to javax.servlet.context.tempdir 04-Feb-2016 15:42:41.203 WARNING [http-nio-8084-exec-78]  com.opensymphony.xwork2.util.logging.commons.CommonsLogger.warn  Request exceeded size limit!" org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:  the request was rejected because its size (2104281)  exceeds the configured maximum (2097152)   if you get this exception. Open your Struts.xml file    <constant name = "struts.multipart.maxSize" value = "10000000" />   Update this line and save. You run the file and try to upload your fil...

Quartz Scheduler Using Cron Trigger

ListenerStart.Java --------------------------   package com.AutomaticFileProcessing; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class ListenerStart implements ServletContextListener{       public void contextDestroyed(ServletContextEvent arg0)     {         System.out.println("Stopping Application successfully");     }        public void contextInitialized(ServletContextEvent arg0)     {        System.out.println("Initializing Application successfully");              try{            new CronTriggerExample().CronTriggerExample();        }        catch(Exception e)        {  ...

How to Read .xlsx excel file using java?

We can read the excel file using POI .jar file Before writing this java class. Whatever variables you want just create a POJO class.  And declare all the variables into it. -------------------- ExcelRead.java -------------------- import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.SQLException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.poi.xssf.usermodel.XSSFCell;import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class MetaDataServices {     public void meta_uploadServices(String metafilepath) throws FileNotFoundException, ClassNotFoundException, SQLException, IOException{         MetaClass meta = new MetaClass();         Query metaquery = new Query();         Query metaupdate=new Query(); ...

MySQL: How to find the column values having double quotes?

If  you are having a table. In the table you have list of columns Table name: Specification --------------------------- Spec Id    Title text                                                       ISBN                            Publisher name 1             Introduction to "Java Programming"            9789058699872           Pearson Education 2             Introducti...

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...