Posted In: Java Core, String

How to read and parse CSV file using String Pattern

Splitting a comma-separated string but ignoring commas in quotes Parsing CSV input with a RegEx in java

Read More

Tags:

by , on August 29th, 2017

Posted In: Java Core, String

How to read and parse CSV file using Open CSV

Splitting a comma-separated string but ignoring commas in quotes Maven opencsv Example csv (cm24AUG2017bhav.csv) Example csv commas in quotes (cm24AUG2017bhav1.csv) opencsv import With deprecated CSVReader. Use CSVReaderBuilder With deprecated CSVReader. Use CSVReaderBuilder. commas in quotes data With CSVReaderBuilder With CSVReaderBuilder. commas in quotes data With CsvToBean and ColumnPositionMappingStrategy. CsvToBean.parse is deprecated With header element name

Read More

Tags:

by , on August 29th, 2017

Posted In: Java Core, String

How to read and parse CSV file using Apache Commons CSV

Splitting a comma-separated string but ignoring commas in quotes Maven commons-csv Example csv Example csv commons csv import With element index With header element name With header name and with commas in quotes With header name RFC4180 format

Read More

Tags:

by , on August 29th, 2017

Posted In: Apache, Spark

How to set up Spark on Windows

There are two options to run Spark. Run it on spark-shell or through Java Code in Eclipse 1. spark-shell – Software required 1. Install JDK 1.8 2. Download spark-2.2.0-bin-hadoop2.7.tgz 3. Download winutils.exe 4. Create /tmp/hive/ folder. 5. Add or set commands 4. Run spark-shell Step 1 – Install JDK and set JAVA_HOME Step 2 – […]

Read More

by , on August 28th, 2017

Posted In: JEE, JSP

How to display UTF-8 characters in JSP

Make sure to have charset=UTF-8 and pageEncoding=”UTF-8″ JSP

Read More

by , on August 27th, 2017

Posted In: JEE, JSP

How to strip whitespace from jsp output

How trimDirectiveWhitespaces works It removes spaces created by JSP tags. It will not remove spaces in body. trimDirectiveWhitespaces=”false” trimDirectiveWhitespaces=”true”;

Read More

by , on August 27th, 2017

Posted In: Server, Tomcat

Tomcat 9 – Why you should start using org.apache.tomcat.jdbc.pool

The JDBC Connection Pool org.apache.tomcat.jdbc.pool is a replacement or an alternative to the Apache Commons DBCP connection pool. So why do we need a new connection pool? Here are a few of the reasons: 1. Multi threaded. Support for highly concurrent environments and multi core/cpu systems. 2. Tomcat jdbc pool implements the ability retrieve a […]

Read More

by , on August 27th, 2017

Posted In: Server, Tomcat

Tomcat 9 – How to correct java.sql.SQLException: No suitable driver found

Case 1 – Using Tomcat connection pool Developer is using to create JNDI. Then please verify TOMCAT/lib has JDBC drivers available. Oracle – ojdbc6.jar MySQL – mysql-connector-java-6.0.5.jar HSQLDB – hsqldb-1.8.0.7.jar PostgreSQL – PostgreSQL JDBC 4.1 Driver, 42.1.4.jre7 Case 2 – Using JDBC driver manager to create connection Either put driver jar in WEB-INF/lib of your […]

Read More

by , on August 26th, 2017

Posted In: Server, Tomcat

How to set the context path of a web application in Tomcat 9

How to set the context path to “/” or root of a web application in Tomcat 9 Deploying my application at the root in Tomcat 1. Setting context path using Eclipse   Set context path in server web module   Set context path in Web project settings   2. Setting context path “/” directly on […]

Read More

by , on August 26th, 2017

Posted In: Apache, Server, Tomcat, Tomcat

How to save uploaded files in a enterprise application

Before writing about how to upload file developer needs to consider how to choose location to upload the file.   1. Not clustered environment – Basic file system Case 1 – Uploading files to Web root This is easiest solution to implement. Developer will be tempted to do this. E.G. Application is deployed at location […]

Read More

by , on August 25th, 2017

  • Categories