Tuesday, February 24, 2015

What is VPN?


A Virtual Private Network (VPN) is a network technology that creates a secure network connection over a public network such as the Internet or a private network owned by a service provider. Large corporations, educational institutions, and government agencies use VPN technology to enable remote users to securely connect to a private network.
A VPN can connect multiple sites over a large distance just like a Wide Area Network (WAN). VPNs are often used to extend intranets worldwide to disseminate information and news to a wide user base. Educational institutions use VPNs to connect campuses that can be distributed across the country or around the world.
In order to gain access to the private network, a user must be authenticated using a unique identification and a password. An authentication token is often used to gain access to a private network through a personal identification number (PIN) that a user must enter. The PIN is a unique authentication code that changes according to a specific frequency, usually every 30 seconds or so.

Monday, February 23, 2015

How to connect two laptops or computers wirelessly

How to connect two laptops or computers wirelessly
Need to quickly connect up to another laptop wirelessly so you can transfer some data without a router or Internet connection? 
However, if you have a laptop or computer that has a wireless card and so does your buddy, you can use the cards to make a wireless connection between the two computers. Once they are connected wirelessly (also called a peer-to-peer ad-hoc wireless network), you can easily share data between the computers.
You can create an ad-hoc network in Windows or in OS X and in this article I’ll explain the steps for creating the network 
It’s important to note that ad-hoc networks in general have certain limitations that make them only useful for certain situations. Firstly, the speed of an ad-hoc network is normally less than that of a normal infrastructure network. Ad-hoc network specs only require a max speed of 11Mbps, which is way slower
Setting Up an ad hoc Network

This tutorial will be written for Windows 7, but you can follow the same instructions for Windows 8 and Windows Vista. To get started, open the Control Panel and click on Network and Sharing Center.




On the next dialog, click on the Setup a new connection or network link towards the bottom.


Sunday, February 22, 2015

Network Topologies

Topologies

The first thing to consider about a network is its physical shape, or the design layout, which will be extremely important when you select a wiring scheme and design the wiring for a new installation.
Network really has two shapes, or two types of topology; one is physical and the other is logical. The physical topology is the shape you can see, and the logical topology is the shape that the data travels in.

Physical Topologies


Physical topology is further divided in two section
·         Point-to-point connections
·         Multipoint connections

Point-to-point connections


Only two devices are involved in a point-to-point connection, with one wire (or air, in the case of wireless) sitting between them.'


Creating a windows 8 like home page in HTML


 Here I have used CSS and HTML to create this windows 8 like home page in HTML. The main tags I have used are the <div> tags which I have used to create the tiles and with the help of CSS I have arranged the tiles according to my imagination.
Ex:
<div class="tile azul">
                                                <span class="titulo"> heading </span>
                                                </div>

Here I have given class names to the <div> tags to identify them separately and to give different properties to the tiles using CSS.
Ex:
<div class="tile azul">
                                                <span class="titulo"> heading </span>
                                                </div>
<div class="tile tileLargo verde">
                                   <span class="titulo"> heading </span>
                                    </div>

The <span> tag is used here to give a heading to each tile in the home page

Here is the HTML code for the windows 8 like home page.


Thursday, February 19, 2015

Introduction to IP Addressing

This document gives you basic information needed in order to configure your router for routing IP, such as how addresses are broken down and how sub netting works. 
The main requirement for IP Addressing is to have a sound knowledge of binary and decimal numbers.
Definition of some main words used in the process.


·         Address—The unique number ID assigned to one host or interface in a network.
·         Subnet—A portion of a network sharing a particular subnet address.
·         Subnet mask—A 32-bit combination used to describe which portion of an address refers to the subnet and which part refers to the host.
·         Interface—A network connection.



An IP address is an address used in order to uniquely identify a device on an IP network.
The address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask.
The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot).
For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary.
Here is how binary octets convert to decimal: The right most bit, or least significant bit, of an octet holds a value of 20. The bit just to the left of that holds a value of 21. This continues until the left-most bit, or most significant bit, which holds a value of 27. So if all binary bits are a one, the decimal equivalent would be 255 as shown here:


  1  1  1  1 1 1 1 1
128 64 32 16 8 4 2 1 (128+64+32+16+8+4+2+1=255)


 this is sample shows an IP address represented in both binary and decimal.

        10.       1.      23.      19 (decimal)

  00001010.00000001.00010111.00010011 (binary)

Producing a report using JSP and java

First import the required file to the jsp file.

<%@page import="pac.LoginServlet"%>
<%@page import="pac.SaveRegistrationsServlet"%>
<%@page import="pac.DatabaseConnection"%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
As we are writing the java code in a JSP file we are using the <% %> tags to write the java code.

Next we write a java code to write the SQL query.

<% 
        String id=LoginServlet.id;
        out.print(id);
        DatabaseConnection db=new DatabaseConnection();
        String sql="SELECT * from members where m_id ='"+id+"'";
        Statement st=db.getConnection().createStatement();
        ResultSet rs=st.executeQuery(sql);
        while(rs.next()){
            out.print(rs.getString(2));
        %>


To create the database connection class read this: Database Connection

Friday, February 13, 2015

Getting data to table in a jsp file from an SQL database.

Follow the steps to get the data from a SQL database to a jsp file.

Here in this tutorial we are creating two java classes and one jsp file to import the data from a SQL database. First we’ll create the two java classes.

Here I am creating this to get user details so, first I’m creating a java class called “users” with the getters and the setters.
First we declare the variables

private String username;
private String password;

then we create the getters and the setters to get data and to change the data.

public User() {
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
   


Thursday, February 12, 2015

How to Connect to a MySQL database in java web applications


Follow to the steps to connect the MySQL database


In your project open a new java class and name it, here ill name it as “DatabaseConnection”. Then write these import statements.

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



after importing the above files, inside the DatabaseConnection class write the below code

public Statement stmt;
    public ResultSet res;
    public Connection conn;
   
    public DatabaseConnection(){
       
    }
   
    @SuppressWarnings("CallThreadDumpStack")
    public Connection SetConnection(){
        try{
        
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection("jdbc:mysql://localhost/lms","root","");
            
        }
        catch(Exception e){
           e.printStackTrace();
        }
        return conn;
       
    }
   
    public ResultSet getResult(String query, Connection conn){
            this.conn = conn;
            try{
                stmt = conn.createStatement();
                res = stmt.executeQuery(query);
               
               
            }
            catch(Exception e){
               
            }
            return res;
           
    
        }