Wednesday, 14 August 2013
To deserialize an object from file, first get the serialized data from the file using FileInputStream. In case if you want to know how to serialize an object to file please check this article serialize an object to a file. Pass the FileInputStream object through ObjectInputStream. Now, get the object from ObjectInputStream using the API readObject().
Example:
Suppose we have a file named sampleClass.ser which contains the data of a serialized object of class SampleClass. Please check this post to create this file. Where SampleClass is a normal pojo class with 4 variables, among which 1 is declared as transient, that means, protected from serialization.
Wednesday, 14 August 2013 by Anijit Sarkar · 3 Read more »
Sunday, 11 August 2013
abstract: |
When a class contains any abstract method, it must be declared as abstract.
An abstract class cannot be
final.An abstract method cannot be
final, static nor native.Sunday, 11 August 2013 by Anijit Sarkar · 6 Read more »
Sunday, 17 March 2013
Syntax: SELECT [column_name] FROM [table_name] WHERE [condition_1] OR [condition_2];
Here, output will come if [condition_1] OR [condition_2] OR both satisfied. That means, it is SELECT [column_name] FROM [table_name] WHERE [condition_1] OR [condition_2] OR both applied.
Example:
Again, we will use the same table, to see the usage of OR command.
Table Name:
Employee Details ( employee_details)
Column Names:
Employee ID ( emp_id),
Employee Name (emp_name),
Employee Address (emp_address) and
Employee Role: (emp_role).
Table: employee_details
Now, using OR command, we will SELECT those tuple, WHERE emp_role is 'Developer' or 'Business Analyst'.
So, the query will be :
SELECT * FROM employee_details WHERE emp_role = 'Developer' OR emp_role = 'Business Analyst';
Result:
Sunday, 17 March 2013 by Anijit Sarkar · 0 Read more »
Friday, 1 March 2013
Syntax: SELECT [column_name] FROM [table_name] WHERE [condition_1] AND [condition_2];
[Note: AND means mandatory condition, that means, the operation has to always fulfill the criteria provied under AND block. ]
Example:
Again, use the same table, we will see the usage of AND command.
Employee Details ( employee_details), which contains
Employee ID ( emp_id),
Employee Name (emp_name),
Employee Address (emp_address) and
Employee Role: (emp_role).
Table: employee_details
Now, using AND command, we will SELECT those tuple, WHERE emp_role is 'Developer' and emp_address is 'Park Street, Kolkata'.
So, the query will be :
SELECT * FROM employee_details WHERE emp_role = 'Developer' AND emp_address = 'Park Street, Kolkata';
Result:
In this way, we can use multiple conditions on an RDBMS operation.
Friday, 1 March 2013 by Anijit Sarkar · 0 Read more »
Saturday, 23 February 2013
Syntax: SELECT [column_name] FROM [table_name] WHERE [condition]
Example:
Again, we will see the same table
Employee Details ( employee_details), which contains
Employee ID ( emp_id),
Employee Name (emp_name),
Employee Address (emp_address) and
Employee Role: (emp_role).
Table: employee_details
Now, from this table, if a situation ariser, where we have to just select the information of the developers, the we have to set some condition on our SELECT query, so that we can get the details of the employees with 'emp_role' 'Developer' . Then the Query will be
SELECT * FROM employee_details WHERE emp_role = 'Developer';
Result:
In this way we can filter our data output.
Saturday, 23 February 2013 by Anijit Sarkar · 1 Read more »
Popular Posts
-
public - public means everyone can access it.That means it's in global scope. As, main method is called by JVM [ Java Virtual Machine...
-
throw is used to throw an exception in a program, explicitly . Whereas, throws is included in the method's declaration part, wi...
-
Singleton in one of the most popular yet controversial design pattern, in the world of object oriented programming. It's one of t...
-
ORM ( Object Relational Mapping ) is a programming concept of a mapping between Object Oriented Programming and Relational Database ...
-
In Java Programming Language , we must declare a variable name and type, before using it. The data type of a variable defines the th...
-
Web Container / Servlet Container / Servlet Engine : In J2EE Architecture , a web container (also known as servlet container or ser...
-
Vector : It's synchronized. It's slower than ArrayList. It's generally used in ...
-
Program compiles. But at runtime throws an error “NoSuchMethodError”.








