Posts

How To Run Your First Java Program.

Image
Step 1:   Download and install the JDK(Java Devlopment Kit) from the below link. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Step 2:  Usally it is installed in "C" Folder C:\Program Files (x86)\Java\jdk1.7.0_55\bin Step 3: Now open the Notepad and copy the below program in it and name it as " HelloWorld.java " (which is the class name ). public class HelloWorld { public static void main(String[] args) { // Prints "Hello, World" in the terminal window. System.out.println("Hello, World"); } } Step 4: Now open a command prompt and follow the below steps. 1- Navigate to Folder where you have saved your program.(using cd command ) 2 - Now you have to set path using the command shown below. set path: C:\Program Files (x86)\Java\jdk1.7.0_55\bin; 3 - Now to check whether the path is set correctly or not you can type java in the command prompt you should see something...

Export Data from Excel File to a table in Database.

How to read Excel file from java:❓❓ Use APACHE POI.  Refer online for Tutorials: http://www.tutorialspoint.com/apache_poi/ 1. Install Apache POI (useful for importing and exporting data from excel files) 2. Import necessary Packages required for database connection and reading data from the spread sheets. 3. JDBC is used to connect to database, create a table in the database for exporting data into it. 4. Setup a File Input Stream for reading a excel file in java. (For reading a excel file.) 5. Now get the instance of workbook and iterate all the rows in the sheet 6. Iterate every row and insert them in to database table. Code: (I have five fields in my excel file and i am exporting it to database.)         int d1=0;         String d2="",d3="",d4="",d5="";         try         {                      //Databas...

SQL vs NOSQL

Image
Differences between Sql and Nosql Database:

Proces vs Thread

Image
Process :   Is an executing instance of an application . They run in separate memory space unlike threads. To put it in simple terms, we write our computer programs in a text file and when we execute this program, it becomes a process which performs all the tasks mentioned in the program. Example: when you double-click the Microsoft Word icon, you start a process that runs word. Threads :   are path of execution within a process . Threads within the same process runs in a shared memory space . ----------------------------------------------------------------- ----------------------------------------------------------------- U may have heard process is heavy weight . actually when process is created Operating system creates a PCB (process control block) which includes may things like  process id - Unique identification for each of the process in the operating system. pointers  - A pointer to parent process. state -The current state...

TCP vs UDP

Image
✅ TCP is Connection Oriented while UDP is connection less. ✅ Udp small header size.(8 bytes) where in TCP is 20 bytes. So udp is faster. ✅ Both has Error detection . ✅ Udp has No Error recovery. so in most cases of UDP, the packet is just discarded . While TCP has a error recovery mechanism. ✅ Packets may arrive or out of order in UDP. ✅ No congestion control in UDP. Congestion control is handled in TCP when ever network is congested the the transmission is delayed. ✅ No acks or retransmissions in UDP ✅ Flow control in TCP not present in UDP flow control means if reciver is slow the transmitter must act accordingly. ⭐In conclusion UDP may be light weight but it is not reliable. TCP and UDP are Used in: SMTP -TCP(sending mail) IMAP/POP -TCP(reciveing mail) FTP -TCP SSH(secure shell) -TCP HTTP -TCP Telnet...

What is a Firmware ? Differences b/w Software, Hardware and Firmware ?

Hardware : It is a collection of electronic equipment’s which are assembled together to  work as a single unit. This arrangement is used to direct the flow of electricity in a desired manner. Software : Software’s are nothing but programs which are used to generally perform advance tasks with the same set of hardware.  For example:  every mobile phone have flash for taking photos in the dark places. But someone developed a software to keep the light on continuously, this gave us flash light support in our mobiles but remember the hardware was still the same. Firmware :   Firmware is a set of most basic instructions that can be passed to the hardware for its basic functioning . In other words, these are the instructions which sits between the software & the hardware. Yes they're stored on ROM to prevent unauthorized alterations. Recall the example of flashlight, the basic instructions to the hardware were to open the light for the purpose of flash onl...

What is Kernel ?

Image
1) What is Kernel? A kernel is the central part of an Operating system. It manages the tasks of the computer and the hardware. A kernel is the part of the operating system that mediates access to system resources. It's responsible for enabling multiple applications to effectively share the hardware by controlling access to CPU, memory, disk I/O, and networking. An operating system is the kernel plus applications that enable users to get something done (i.e. compiler, text editor, window manager, etc.).