Browsing articles tagged with

java

How to install Oracle Java 8 on Ubuntu 16.04/Linux Mint 17 (PPA Method)

Install Oracle Java 8 Ubuntu has OpenJDK installed by default, but in certain cases you might need to install Oracle Java instead. It is possible to install Oracle Java manually, however the process is a bit lengthy and requires a lot of steps. Oracle Java can be downloaded from the official website over here - https://www.oracle.com/downloads/ However in this post we shall be installing ...

Udp socket programming in Java

Datagram sockets UDP sockets can be used in java with the DatagramSocket class. Server Let code a simple udp server that listens on a certain port number. /** Java ECHO server with UDP sockets example */ import java.io.*; import java.net.*; public class udp_server { public static void main(String args) { DatagramSocket sock = null; try { //1. creating a server socket, parameter is local port number sock = new DatagramSocket(7777); //buffer to receive incoming data byte buffer = new ...

Java socket programming tutorial

Socket programming in Java This is a quick guide/tutorial to learning socket programming in Java. The Socket class is documented at http://docs.oracle.com/javase/1.4.2/docs/api/java/net/Socket.html To summarise the basics, sockets are the fundamental "things" behind any kind of network communications done by your computer. For example when you type www.google.com in your web browser, it opens a socket and connects to google.com to fetch the page ...

Execute an sql script in jdbc

The SQL Script should have comments starting with - or -- only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute command would result in an exception. All instructions must be executed individually. A proper sql script should have all ...

Read write and save configurations to a file in java

Configuration files are used in applications to store settings, user preferences and other configuration parameters of an application so that. When configurations are changed from within the application these need to be saved so that next time the application starts with these new settings. In Java reading and writing to a configuration is pretty simple and straight forward. A configuration file can ...



Connect with us