RedHat Cloud computing

RedHat cloud computing refers to the solutions for

  1. Public clouds
  2. private clouds
  3. hybrid clouds

RedHat provides/offers two types of cloud computing

  1. Cloud Forms
  2. Open Shift

Cloud Forms

Red Hat CloudForms is an Infrastructure-as-a-Service (IaaS) offering that builds upon a collection of more than 60 open sourceprojects. CloudForms include application lifecycle managementcapabilities as well as the capability to create hybrid, public and private clouds from the broadest range of computing resources with unique portability across physical, virtual and cloud computing resources.

Open Shift

Red Hat OpenShift is a platform-as-a-Service (PaaS) cloud for open source developers, providing a choice in languages, frameworks, and clouds to build, test, run, and manage applications.

Difference Between in and hasOwnProperty in javascript

Let me explain you briefly

⊕ in:

basically its a keywork in javascript, it checks whether the  propreties there are not in the object as well as its prototype chain.

  1. If properties are there it returns true
  2. otherwise false.

but

⊕ hasOwnProperty: 

it is also a keyword in javascript, it checks for the prorperties only in the object itself but not its prototype chain.

  1. If properties are there it returns true
  2. otherwise false.

Note:  every object has prototype in javascript.

please refer the link below for more information

Difference Between in and hasOwnProperty in javascript

typeof

  • typeof “text”  —->   string
  • typeof 123   ——      number
  • typeof Nan  ——>  number
  • typeof “123”——>  string
  • typeof []——>  object
  • typeof {}——>  object
  • typeof null——>  object
  • typeof false——>  boolean
  • typeof true——>  boolean

Exact meaning of Class.forName(); in JDBC

Before going to discuss, need to discuss about Drivers.

Inorder to connect a  java Application  with database ,  we need to follow the below important steps

  1. Use any JDBC  Driver class.
  2. This JDBC Driver class has to be instantiated.
  3. And Instantiated Driver class should be Registered with DriverManager class

For Example:

Let’s take Type1-Driver(sun.jdbc.odbc.JdbcOdbcDriver) which comes with JDK by Default

So Inorder to connect  a java application with  database with this driver we have to write following statements.

sun.jdbc.odbc.JdbcOdbcDriver driver=new sun.jdbc.odbc.JdbcOdbcDriver();

DriverManager.registerDriver(driver);

Ok.Then what is Class.forName(“com.Anyclass”) ?

Basically Class.forName("com.Anyclass");   used to load a class.

while loading a class, if that class contains static blocks, and any code which is in that static blocks,  will be executed.

So if write a statement  for Ex:      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 

code in static block of this driver will be executed while class is loading.

All most all JDBC drivers contains static blocks and these static block contains the code to

1) Instantiate the driver class

2) Register the driver with DriverManager.

Following  is the  static block in JdbcOdbcDriver


static{

JdbcOdbcTracer jdbcOdbcTracer= new JdbcOdbcTracer();

if(jdbcOdbcTracer.isTracing()){

</pre>
<pre>jdbcOdbcTracer.trace("JdbcOdbcDriver class loaded");</pre>
<pre>
}

sun.jdbc.odbc.JdbcOdbcDriver driver=new sun.jdbc.odbc.JdbcOdbcDriver();
DriverManager.registerDriver(driver);

}

Create,extract and see the contents of the JAR in Commnad Prompt

1)Create the jar file:

go the specific directory in which  .class files are there and the below command

jar cvf myproject.jar .

2) Extract the contents of the jar file

jar xvf myproject.jar 

3) To see the  contents of the jar file

jar tvf myproject.jar 

4) To know more about the jar options enter the below commnad

jar -help

5) To install the executable jar file

jar -jar sample.jar