Skip to main content

Posts

Head First HTML with CSS & XHTML by Elisabeth Freeman & Eric Freeman [PDF] free download

Very easy way to open and read any type of file in Java

How I can open a file in Java, read it and print its content 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import java.io.File ; import java.io.FileInputStream ; import java.io.BufferedInputStream ; import java.io.DataInputStream ; import javax.swing.JOptionPane ; public class FileReader { public static void main ( String [] args ) { File file = new File ( "C:\\Tasks.txt" ); try { BufferedInputStream bis ; DataInputStream dis ; try ( FileInputStream fis = new FileInputStream ( file )) { bis = new BufferedInputStream ( fis ); dis = new DataInputStream ( bis ); while ( dis . available () != 0 ) System . out . println ( dis . readLine ()); } bis . close (); dis . close (); } catch ( Exception e ){ JOptionPane . showMessageDialog ( null...

Program Development in Java (Software Construction) [PDF] by Barbara Liskov with John Guttage free download

Heap Creation and Sorting in C++ with checks free source code

Heap Data Structure Creation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 # include < iostream > using namespace std ; void heapCreation ( int item ); void heapSorting (); int i , p , n = 0 ; const int heapSize = 100 ; int arr [ heapSize ]; void heapCreation ( int item ){ if ( n >= heapSize ){ cout << "Heap is saturated: Insertion is void" << endl ; return ; } else { int temp ; cout << item << endl ; n = n + 1 ; arr [ n ]= item ; i = n ; p = i / 2 ; while ( p > 0 && arr [ p ]< arr [ i ]){ temp = arr [ i ]; arr [ i ]= arr [ p ]; arr [ p ]= temp ; i = p ; p = p / 2 ; } } } void heapSorting (){ int item , j , temp , lchild , rchild , i = n ; cout <...

MS SQL Server Java Connection Source Code

Source Code After running this code you will see the successful message as shown blow. Click here for Detailed Tutorial 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import java.sql.Connection ; import java.sql.DriverManager ; import javax.swing.JOptionPane ; /** * * @author cs2it.blogspot.com */ public class RealEstate { /** * @param args the command line arguments */ public static void main ( String [] args ) { try { final String DATABASE_URL = "jdbc:sqlserver://localhost:1433;databaseNam=YourDatabaseName" ; Connection connection = DriverManager . getConnection ( DATABASE_URL , "YourUserName" , "Password" ); JOptionPane . showMessageDialog ( null , "Connection to database is Successful" ); } catch ( Exception e ){ JOptionPane . showMessageDialog ( null , e ); ...

How to connect Java with MySQL/MicrosoftSQL server with pictures

Server Connection with Java using JDBC In this tutorial I'll tech you how you can connect any database (especially MS SQL Server) with your Java code. I'm using NetBeans (click here to download latest version of NetBeans) IDE to connect MSSQL Database. This is very simple and easy way, just follow the blow steps for connection. Open MS SQL Server and enter your user name, password and click next as shown in blow fig. After login into your server. Right click on Databases and select new database as shown blow A new window will open. Give any name to your database (i.e cs2it.blogspot.com) and click on OK button to execute. Now your database is showing under Databases tag as shown blow. After creating this database your mission will be to create its connection with you Java Code. So open your IDE (i.e NetBeans) and create new project as shown blow. A new window will open select Java Application . Give name to your project and click on f inish button .  After this add JDBC (Jav...

Addition/Multiplication of two integer numbers in Java using Graphical User Interface (GUI) using Netbeans with source code free download

In this post I will teach you how you can add two integer numbers in Java using Graphical User Interface. I made it very simple and easy for you. At the end of this tutorial you will be able create the following Graphical User Interface with many different properties. I'm using NetBeans IDE (Recommended for you) for this purpose. Just follow the following steps. Open NetBeans editor and click on new project as shown blow Select this project as a Java Application and click on next as show blow After this name your project, what you want. I named is " Addition GUI " as shown in blow fig. After the creating project make a new JFrame Form Class as show blow in fig. Name this class (i.e Addition) and a JFrame Form panel create to move forward as shown blow. Now drag a text field in you frame from Swing Controls as show shown blow After adding text field perform the following function on it. Right Click on text field Press Backspace button to remove all the text from textFiel...