Tags » Java Programming

5 Reasons Why You Should Pursue Java Programming Training Online

With so many things on the plate, the professionals have a hard time to manage everything. Similarly, the students have to focus in different studies and entrance exams that they cannot find any synchronization to enhance their skills. 254 more words

Software

Java files and I/O

Here I’m going to talk about input and output in java. For this purpose, in java we have a package called java.io. This package is containing all the classes what we need to perform input and out functions in java. 187 more words

Java Programming

Java JDK Environment Variables Configuration in Linux (Centos)

Environment Variables need to be configured

PATH environment variable. Role is specified command search path, while executing a command in shell, it will go to the PATH variable to find the path specified to see if it could find the appropriate command. 472 more words

Java Programming

Custom thread pool creation in java using Blocking Queue

package org.dopler.concurrent;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author Manu Madanan
 *
 */
public class CustomThreadPool {

	BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
	Integer threadsActive = 0;
	List<Thread> threads = new ArrayList<Thread>();
	private boolean started = true;
	int size = 0;

	/**
	 * Create new instance of CustomThreadPool
	 * 
	 * @param size
	 */
	public CustomThreadPool(int size) {
		this.size = size;
	}

	/**
	 * Add a runnable job
	 * 
	 * @param runnable
	 */
	public synchronized void add(Runnable job) {
		queue.add(job);
		if (threads.size() < size) {
			Thread poolThread = new Thread(new Runnable() {
				@Override
				public void run() {
					while (started) {
						try {
							Runnable executeJob = queue.take();
							synchronized (threadsActive) {
								threadsActive++;
							}
							executeJob.run();
							synchronized (threadsActive) {
								threadsActive--;
							}
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}
			});
			threads.add(poolThread);
			poolThread.start();
		}
	}

	/**
	 * TO stop the thread pool after current job completion
	 */
	public void shutdown() {
		started = false;
	}

	/**
	 * TO stop the thread pool
	 */
	public void shutdownNow() {
		started = false;
		for (Thread thread : threads) {
			thread.interrupt();
		}
	}

	/**
	 * Get the current active threads count
	 * 
	 * @return
	 */
	public int getActiveThreads() {
		return threadsActive.intValue();
	}
}
… 68 more words
Java Programming

Benefits of Java Development

Java was produced by goes for giving a cross stage environment to software applications. Java is an exceptionally well-known and broadly utilized programming dialect for creating applications extending from versatile applications to big business servers and supercomputers. 523 more words

Few Reasons Why You Should Program In Java

Java is a standout amongst the most dynamic, intense and well-known programming dialects utilized today. If you are new to utilizing Java, you would be astounded at the exceeding expectations highlights that Java offers and why it is the most favored programming dialects among professional software engineers. 484 more words

java.sql.SQLRecoverableException: No more data to read from socket cause by connection pool running out

java.sql.SQLRecoverableException: No more data to read from socket caused by connection pool running out

Issues

Currently, in Oracle database server is built on more than one tablespace for different systems, both systems at the same time in the course of a project being developed in a test run, appeared from time to time the connection pool is full, connection is not the problem, so need to modify the Oracle connection pool configuration. 1,205 more words

Oracle Installation &amp; Configuration