Skip to main content

Posts

Showing posts from September, 2011

Why Oracle over Microsoft SQL Server?

Why Oracle over Microsoft SQL Server? * What are the differences in terminology between MS-SQL and Oracle?  I also understand that SQL Server is far less flexible and robust than Oracle and I hope to know those features that I will not have in SQL Server? Answer:    Oracle is the world's most popular database primarily because it runs on every platform known, from a mainframe to a Mac.  MS-SQL on the other hand, is a Windows-only offering.   Both SQL Server and Oracle are relational databases, but it is their genealogy that tells about their core differences: SQL Server:   MS-SQL grew-up running tiny, departmental applications on personal computers.  Microsoft is trying to "push up" into the mainstream market, running SQL Server on super-large servers that run Windows. Oracle:   Oracle is a mature database with a decade head-start on MSSQL in terms of specialized features.  While SQL Server has tried to "push up" into the Corporate database mar

Why we use UPS instead of Power Invertors

Why we use UPS instead of Power  Invertors in Computing ------------------------------------------------------------------------------------------- The primary role of any UPS is to provide short-term power when the input power source fails. However, most UPS units are also capable in varying degrees of correcting common utility power problems: Power failure: defined as a total loss of input voltage. Surge: defined as a momentary or sustained increase in the main voltage . Sag: defined as a momentary or sustained reduction in input voltage. Spikes, defined as a brief high voltage excursion. Noise, defined as a high frequency transient or oscillation, usually injected into the line by nearby equipment. Frequency instability: defined as temporary changes in the mains frequency. Harmonic distortion: defined as a departure from the ideal sinusoidal waveform expected on the line. UPS units are divided into categories based on which of the above problems the

Setting Up A Static IP Address on UNIX system

Setting Up A Static IP Address Using The Command Line Log on as root, change directory to /etc/sysconfig/networking/devices and list all available devices. # cd /etc/sysconfig/networking/devices # ls Find the configuration file corresponding to the NIC for which you want to set a static IP and edit it. # vi ifcfg-eth0 I prefer using “joe” as a text editor rather than “vi”. You can install “joe” by issuing “yum install joe”. To invoke joe’s help menu, type “CTRL+K, H” from within the application. Now set the parameters below according to your settings (those in bold characters only): DEVICE=eth0 BOOTPROTO=none HWADDR=00:0C:29:DE:94:8B ONBOOT=yes TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes NETMASK=255.255.255.0 IPADDR=192.168.0.100 GATEWAY=192.168.0.1 Save the configuration file and exit the text editor. To set the nameservers, change directory to /etc and edit resolv.conf. # cd /etc # vi resolv.conf The file format should be like this: search yo

Manual Configuration to setup Linux Server

Manual Configuration You can use one of the above tools or configure the network the old fashioned way as follows: First to use networking on any permanent basis you should setup the file /etc/sysconfig/network similar to the example shown below. Assign an ip address with "ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up". Tell your machine that a hub is ready for information with the command "route add -net 192.168.0.0 netmask 255.255.255.0 eth0" To contact hosts outside your network if a machine with IP address 192.168.1.1 is the gateway use the command "route add default gw 192.168.1.1 eth0" If using a dialup connection use the command "route add default ppp0" The word default says if the packet is not for a machine on your local network, send it to the default device. These settings are not permanent, but go away the next time you boot. They are normally set up in the directory /etc/sysconfig/network-scripts. Add the network

Setting Static IP on LINUX System

Setting up a static IP address for your linux box is quite easy. I will show you how to do it through the GUI and command line. For this tutorial, I have been using CentOS 5 running as a virtual machine on VMware Server 1.0.2. Setting Up A Static IP Address Using The GUI If you are using Gnome, click on “System => Administration => Network”. From the Network Configuration window, select your NIC from de “Devices” tab and click on the “Edit” button. Select “Statically set IP addresses” and enter the IP address, subnet mask and default gateway. Click OK when done. Now back to the Network Configuration window, select the DNS tab. Enter your hostname and your DNS servers. Click on “File => Save” when you’re done.

Print System Date & Time In Java Console Program

import java.util.Calendar; import java.text.SimpleDateFormat; public class GetDateNow {   public static void  main(String arg[]) {   Calendar currentDate = Calendar.getInstance();   SimpleDateFormat formatter=    new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss");   String dateNow = formatter.format(currentDate.getTime());   System.out.println("Now the date is :=>  " + dateNow);   } }

Inheritance in Java

Inheritance in Java To know the concept of inheritance clearly you must have the idea of class and its features like methods, data members, access controls, constructors, keywords this, super etc. As the name suggests, inheritance means to take something that is already made. It is one of the most important feature of Object Oriented Programming. It is the concept that is used for reusability purpose. Inheritance is the mechanism through which we can derived classes from other classes. The derived class is called as child class or the subclass or  we can say the extended class and the class from which we are deriving the subclass is called the base class or the parent class. To derive a class in java the keyword extends is used. To clearly understand the concept of inheritance you must go through the following example. The concept of inheritance is used to make the things from general to more specific e.g. When we hear the word vehicle then we got an image in our mind that it

Connection over ORACLE 9i and JAVA with JDBC Provider

//Connection over ORACLE 9i and JAVA with JDBC Provider import java.sql.*; public class OCL { public static void main(String args[]) { Driver d; Connection con; Statement stmt; ResultSet rs; try {     d=(Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();   con =DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:oramax","scott","tiger");     stmt = con.createStatement();     rs= stmt.executeQuery("select * from EMP");     while(rs.next()) {   System.out.println(rs.getString(1));         System.out.print("\t"+rs.getString(2)); System.out.print("\t"+rs.getString(1)+"  "+rs.getString(2)); } } catch(Exception e) { System.out.println("in IllegalAccess exception"); } } }