9lessons Programming Blog - Tutorials about Angular, ReactJS, PHP, MySQL and Web Development
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Monday, October 08, 2012

RESTful Web Services JSON API Transformer with Java

This post is the continuation of my previous last post, I had explained how to create a basic RESTful web services API using Java, now I want to explain JSON transformer to work with input Get and Post methods parameters. Just added a new class called transformer it converts object data into JSON text output format.

RESTful Web Services with input parameters
Sunday, September 16, 2012

RESTful Web Services API using Java and MySQL

Are you working with multiple devices like iPhone, Android and Web, then take a look at this post that explains you how to develop a RESTful API in Java. Representational state transfer (REST) is a software system for distributing the data to different kind of applications. The web service system produce status code response in JSON or XML format.

RESTful Web Services using Java and MySQL
Monday, August 27, 2012

Java MySQL JSON Display Records using Jquery.

This is the continuation of my previous Java tutorial Insert Records into MySQL database using Jquery, now I want to explain how to convert records data into JSON data format and display JSON data feed using Jquery. It's simple just follow few steps with Eclipse IDE, hope you understand the Model View Controller pattern Thanks!

Java JSON Jquery Display Records
Wednesday, July 25, 2012

Java MySQL Insert Record using Jquery.

If you know Java concepts, you can easily understand any kind of language very quickly. If you want to became a good programmer, I strongly suggest start with J2EE programming. I heard that many people feels that it's though After long time I decided to write about J2EE programming with Jquery in a simple and better understanding way, hope you like it. Thanks!

Menu Design with JSON Data.
Wednesday, July 27, 2011

Get Started Developing for BlackBerry.

Are you looking for BlackBerry application development tutorial. Take a quick look at this post my friend want to explain how to download and install BlackBerry standard development kit with eclipse IDE. It's very simple just follow these steps and you can create Hello World program.

Get Started Developing for Blackberry with Eclipse
Sunday, February 14, 2010

Live Availability Checking with Java.

Some days I had posted an article about User name live availability checking with PHP and jquery. In this post my brother Ravi Tamada explained the same with Java technologies like JSP and servelts using MySQL database.

Live Availability Checking with Java.

Friday, May 22, 2009

Update a Record with Animation effect using JSP and jQuery.

I received a lot of requests about integration of JQuery and Ajax with Java (JSP). After long time again I'm working on JSP. I prepared a tutorial to update a record with animation effect using jQuery and JSP. Its very simple example contains some lines of Java and HTML code.

Tuesday, November 11, 2008

What is an Object? - Easy Lesson

Before the development of Object Oriented programming, the variables were considered as isolated entities. For example, suppose a program needs to handle data in car manufacturing company, here testing the cars having number, Color, Speed. Three separated variables will be declared for this.

int number,speed;
String color;




These two statements do two things:
1)It says that the variable number and speed are integers and color is a string variable.
2)It also allocates storage for these variables.

This approach has two disadvantages:
If the program needs to keep track of various cars records. There will be more declarations that would be needed for each car, for example.

int number1,speed1;
String color1;

int number2,speed2;
String color2;

This approach can become very cumbersome.
The other drawback is that this approach completely ignores the fact that the three variables number,speed and color, are related and are a data associated with a single car.
In order to address these to drawbacks java use a class to create new types. For example to define a type that represents a car, we need storage space for two integers and a string. this is defined as follows:

class Car
{
int number;
int speed;
String color;
}

A variable can be declared as of type car as follows:

Car c,c1;

The car variables of this class(number,speed and color) can be accessed using the dot(.) operator.

Creating an Object
The allocaton of memory of the reference type does not happen when the reference types are declared, as was the case of the primitive types, Simple diclaration of Non-primitive types does not allocate meomory space for the object.


In fact, a variable that is declared with a class type is not the data itself, but it is a

reference to the data, The actual storage is allocated to the object as follows.

Car c;
c=new Car();


The first statement just allocates enough space for the reference. The second statement allocates the space, called an Object, for the two integers and a string. After these two statements are executed, the contents of the Car can be accessed through c.

Example using Object.

Let us now write a example that creates an object of the class Car and display the

number,speed, etc....

class Car
{
    int number;
    int speed;
    String color;

    void print_Number()
   {
    System.out.println("Car Number = " + number);
    }

    void print_Speed()
   {
    System.out.println("Car Speed = " + speed);
    }

    void Stop()
    {
    System.out.println("Car Stopped");
    }

    void Horn()
    {
    System.out.println("Hooooooo.......rn");
    }

    void Go()
    {
    System.out.println("Car Going");
    }
}


public class Object_Car
{
    public static void main(String args[])
   {
    Car c;
    c=new Car();
    c.number=401;
    c.speed=90;
    c.print_number();
    c.print_speed();
    c.Horn();
    c.Stop();

    Car c1;
    c1=new Car();
    c1.number=402;
    c1.speed=80;
    c1.print_number();
    c1.print_speed();
    c1.Go();
    c1.Horn();

    }
}

Output:
>javac Object_Car.java
>java Object_Car

Car Number = 401
Car Speed = 90
Car Stopped
Hooooooo.......rn

Car Number = 402
Car Speed = 80
Hooooooo.......rn
Car Going

Do you have an Information? Add a comment with you link!
Friday, October 31, 2008

What Web Server Do?

A Web Server takes a Client request and gives something back to the Client.
A web browser lets a user request a resource. The web server gets the request,
finds the resource, and returns something to the Client Sometimes that resouce is an HTML page. Sometimes it's a picture. Or a PDF file(Data). Doesn't matter- the client asks for the resouce and server sends it back.

When we say "server", we mean either the physical machine (hardware) or the web server application (software). Real time example.



Above picture some transaction between Client House and Server House for transportation using Truck(Web Server). Client House need package (Truck Driver taking Request- URL) and pass the information to Server House. In the Server House Workers( Helper - JSP Files, Server side files) load the package into the Truck. It taking back to the Client House.

For Transportation people are using different vehicles(Airbus, Ship, Truck). Same way Web Servers(software) also diffrent products like Tomcate(Open source), Bea Web Logic, IBM Websphere,etc...

When we talk about clients, througn, we usally mean both(or either) the human user and the browse application.

The browser is the piece of software(Firefox or Opera) that knows how to communicate with the server. The browser's other big job is iterpreting the HTML code and rendeing the web page for the user.

HTTP is the protocal Client and Servers use on the web to communicate. The server uses HTTP to send HTML to the client.

The HTTP protocol has serveral methods, but the onew we'll use most often are GET and POST.

GET is te simples HTTP method, and its main job in life is to ask the server to get a resource and send it back. That resource might be an HTML page ,a PDF etc. Doesn't matter. The poing of GET is to Get someting back from the server.

POST is a more powerful request, IT' like a GET plus plus. With POST, we can request something and at the same time send form data to the server.

Web Server softwares having different tree stuctures and defalut port numbers. Weblogic running at http://localhost:7001, Tomcat at http://localhost:8080, IBM Websphere at http://localhost:9080

If you know any information about this topic please comment..
Wednesday, October 29, 2008

Java Inheritance Easy Lesson

Inheritance involves creating new classes from the existing ones. it provides the ability to take the data and methods from an existing class and derive a new class. The keyword extends is used to inherit data and methods from a existing class. the extends keyword is used as

class New_Class extends Old_Class { ....... }



The inherited methods and data are those that are declared public or protected inside the super class. Using(Extending) same Engine.

Note: private members are not inherited. Here key is private

Java Access Modifiers Lesson

Eg How Inheritance works.

class Add
{

int x;
int y;

public int Add_xy()

{
int sum=0;
sum=x+y;
return sum;

}

}
class Sub extends Add
{
public int Sub_xy()
{
int sub;
sub=x-y;
return sub;
}
}

class Inheritance
{
pubic static void main(String args[])
{
Sub sub_obj=new Sub();
sub_obj.x=10;
sub_obj.y=4;
int a=sub_obj.Add_xy();
int s=sub_obj.Sub_xy();
System.out.println("x value is "+sub_obj.x);
System.out.println("y value is "+sub_obj.y);
System.out.println("sum is "+a);
System.out.println("subtraction is "+s);
}
}

Download Source
>javac Inheritance.java

>java Inheritance

output:

x value is 10;
y value is 4;
sum is 14;
subtraction is 6;

Note : The object of the sub-class was created inside the main. The class Sub extends the class Add. This ist derives all the protected and public members of the class Add. The class Sub contains a method of it own, Sub_xy()/ The Object of class Sub in the main() is used to assign values to x and y and then the two methods are called.

Java does not support multiple inheritance directly. This means that the class in Java cannot have more than one super class.

Eg:

class Derived extends Super_one, Super_two
{
-----------------
-----------------
}


is illegal/not permitted in Java.

However, to be able to let the java programmers use the immense functionality provided by multiple inheritance, the java language developers incorporated this concept with the use of interfaces. (I will post an article about Interfaces with in few days)
mailxengine Youtueb channel
Make in India
X