Read Write to excel using JAVA

 In this video, I have shown how you can create an excel file using java. 1. Project structure. 2. DB_Connection.java, This connection class is used to connect with database. You will need to update the host,dbname,username and password according to your project. package jinuclass; import java.sql.Connection; import java.sql.DriverManager; public class DBConnection_HR { public Connection …

Continue reading

Earn Money by adding captchas in websites

In this video I have shown how you can earn money by adding captchas in your website. In this example I have shown with JAVA JSP as my webpage. You can use the same method for any front end technologies. You can download the source code I have shown in the video here solvemedia.zip

Continue reading

How to open any File in Java

 In this video, I have shown how you can open any type of file using java. Code is shown below. package test; import java.io.File; public class open_file { public static void main(String[] args) { String path = “E:\\jinu.txt”; File file = new File(path); try { if (file.exists()) { Process pro = Runtime.getRuntime().exec(“rundll32 url.dll,FileProtocolHandler ” …

Continue reading

Export MySQL Table in to CSV file using JAVA

In this video I have shown how you can export MySQL table into a CSV file. You will need to import MySQL jar file into class path of eclipse IDE to work on this program. You can download here, mysql-connector-java-5.1.42-bin.rar 1. Project Structure in Eclipse IDE. 2.Create_CSV.java package com.chillyfacts.com; import java.io.File; import java.io.PrintWriter; import java.sql.Connection; …

Continue reading

How to create CSV file using java

In this video I have shown how you can create a CSV file or Comma Separated Values file using java. The below source code is explained in the video, Create_CSV.java package com.chillyfacts.com; import java.io.File; import java.io.PrintWriter; public class Create_CSV { public static void main(String[] args) { try { PrintWriter pw= new PrintWriter(new File(“C:\\Users\\MIRITPC\\Desktop\\csv\\books_table.csv”)); StringBuilder sb=new …

Continue reading

JAVA send http Get Post request with basic authentication

In the video I have shown how you can send HTTP get request and Post request with a real time example. The server is giving response in JSON format. The JSON response is parsed with java to get the parameters output. This source code is demonstrated with reddit login API documents. You will have to …

Continue reading

Simple JAVA program to download Youtube vidoes

Using the below simple java program you can download Youtube videos. We have to download an executable exe file from below link or their website. Download youtube-dl here. youtube-dl.rar Download this exe file and keep in the folder where you need to have your downloaded videos. 1. Project Structure in Eclipse IDE. 2. my_main.java package …

Continue reading

Create Document file dynamically using java

In this project we are trying to create a Microsoft Word file using Apache POI api with JAVA. 1. Project Structure 2. Jars used in the project are, 1. poi-3.17.jar 2. poi-ooxml-3.17.jar 3. poi-ooxml-schemas-3.17.jar 4. xmlbeans-2.6.0.jar 5. Mysql connector jar 3. Generate_Document.java package com.chillyfacts.com; import java.io.File; import java.io.FileOutputStream; import org.apache.poi.xwpf.usermodel.VerticalAlign; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; import …

Continue reading

Java Switch Statement source code

Java Switch statement executes if any of the cases in the switch is matched. Just like if-else-if ladder statement. Switch statements can be used only to String,int and enum parameters by default. 1.Java Switch with Integer Argument example. Java_Switch.java package com.chillyfacts.com; public class Java_Switch { public static void main(String[] args) { int i = 100; …

Continue reading

JAVA JSP file upload example source code

In this video I have shown how you can create a JSP file upload. This project is shown in Eclipse IDE. 1. Project Structure 2. The jar file used in the project are, 1.org.apache.commons.io.jar 2.commons-fileupload-1.3.1.jar 3. The servlet will upload the image to d:\uploaded_files folder FileUploadHandler.java package com.chilyfacts.com; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import …

Continue reading