Below program inserts record into employee table.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo {

	public static void main(String[] args) {
		Connection connection = null;
		Statement stmt=null;
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			connection = DriverManager.getConnection(
					"jdbc:oracle:thin:@localhost:1521:XE", 
					"system", 
					"oracle");
			String sql2 = "insert into employee(empNo,empName,empAddress)values(100,'emp1','address1')";
			stmt = connection.createStatement();
			stmt.executeUpdate(sql2);
		} catch (ClassNotFoundException | SQLException ex) {
			ex.printStackTrace();
		} finally {
			try {
				if(connection!=null){
				 connection.close();
				}
				if(stmt!=null){
					stmt.close();
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}

	}
}