Sunday, September 9, 2007

Trigger

Triggers are special type of stored procedures executed automatically when certain events take place. There are different types of triggers – for update, for insert and for delete. Each trigger is associated with a single database table

Stored Procedure

Stored Procedure is a set of SQL statements stored within a database server and is executed as single entity. Using stored procedures has several advantages over using inline SQL statements, like improved performance and separation of the application logic layer from database layer in n-tier applications

Primary Key

The primary key of a relational table holds a unique value, which identifies each record in the table. It can either be a normal field (column) that is guaranteed to be unique or it can be generated by the database system itself (GUID or Identity field in MS SQL Server for example). Primary keys may be composed of more than 1 field (column) in a table.

Oracle

Oracle is an enterprise relational database management system. Oracle's main rival product MS SQL Server is a low cost alternative offering the same features.

OLE DB

Short for Object Linking and Embedding Data Base. OLE DB is a set of COM-based interfaces that expose data from a range of sources. OLE DB interfaces give applications standardized access to data stored in various information sources like Relational Database Management Systems (MS SQL Server, Oracle, MySQL), small personal databases like MS Access, productivity tools like spreadsheets; plain text files, etc. These interfaces support the amount of DBMS functionality appropriate to the data store, allowing the data store to share its data.

ODBC

Short for Open DataBase Connectivity, a standard database access technology developed by Microsoft Corporation. The purpose of ODBC is to allow accessing any DBMS (DataBase Management System) from any application (as long as the application and the database are ODBC compliant), regardless of which DBMS is managing the data. ODBC achieves this by using a middle layer, called a database driver, between an application and the DBMS. The purpose of this layer is to transform the application's data queries into commands that the DBMS understands. As we said earlier, both the application and the DBMS must be ODBC compliant meaning, the application must be capable of sending ODBC commands and the DBMS must be capable of responding back to them.

Normalization

Normalization is the process of organizing data to minimize redundancy and remove ambiguity. Normalization involves separating a database into tables and defining relationships between the tables. There are three main stages of normalization called normal forms. Each one of those stages increases the level of normalization. The 3 main normal forms are as follows:
First Normal Form (1NF): Each field in a table must contain different information.
Second Normal Form (2NF): All attributes that are not dependent upon the primary key in a database table must be eliminated.
Third Normal Form (3NF): No duplicate information is permitted. So, for example, if two tables both require a common field, this common field information should be separated into a different table.

ADO.....?

Short for Microsoft ActiveX Data Objects. ADO enables your client applications to access and manage data from a range of sources through an OLE DB provider. ADO is built on top of OLE DB and its main benefits are ease of use, high speed, and low memory overhead. ADO makes the task of building complex database enabled client/server and web applications a breeze

ACID...?

ACID short for Atomicity – Consistency – Isolation – Durability and describes the four properties of an enterprise-level transaction:
ATOMICITY: a transaction should be done or undone completely. In the event of an error or failure, all data manipulations should be undone, and all data should rollback to its previous state.
CONSISTENCY: a transaction should transform a system from one consistent state to another consistent state.
ISOLATION: each transaction should happen independently of other transactions occurring at the same time.
DURABILITY: Completed transactions should remain stable/permanent, even during system failure

Oracle OLE DB & OleDbConnection (.NET framework) connection strings

Open connection to Oracle database with standard security:
1. "Provider=MSDAORA;Data Source= Your_Oracle_Database;UserId=Your_Username;Password=Your_Password;"
2. "Provider= OraOLEDB.Oracle;Your_Oracle_Database;UserId=Your_Username;Password=Your_Password;"

Open trusted connection to Oracle database
"Provider= OraOLEDB.Oracle;DataSource=Your_Oracle_Database;OSAuthent=1;"

Oracle ODBC connection strings

Open connection to Oracle database using ODBC
"Driver= {Microsoft ODBCforOracle};Server=Your_Oracle_Server.world;Uid=Your_Username;Pwd=Your_Password;"

MySQL OLE DB & OleDbConnection (.NET framework) connection strings

Open connection to MySQL database:
"Provider=MySQLProv;Data Source=Your_MySQL_Database;User Id=Your_Username; Password=Your_Password;"

MySQL ODBC connection strings

Open connection to local MySQL database using MySQL ODBC 3.51 Driver
"Provider=MSDASQL; DRIVER={MySQL ODBC 3.51Driver}; SERVER= localhost; DATABASE=Your_MySQL_Database; UID= Your_Username; PASSWORD=Your_Password; OPTION=3"

MS Access OLE DB & OleDbConnection (.NET framework) connection strings

Open connection to Access database:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; User Id=admin; Password="

Open connection to Access database using Workgroup (System database):
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; Jet OLEDB:System Database=c:\App1\Your_System_Database_Name.mdw"

Open connection to password protected Access database:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb; Jet OLEDB:Database Password=Your_Password"

Open connection to Access database located on a network share:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Server_Name\Share_Name\Share_Path\Your_Database_Name.mdb"

Open connection to Access database located on a remote server:
"Provider=MS Remote; Remote Server=http://Your-Remote-Server-IP; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb"

MS Access ODBC connection strings

Standard Security:
"Driver= {MicrosoftAccessDriver(*.mdb)};DBQ=C:\App1\Your_Database_Name.mdb;Uid=Your_Username;Pwd=Your_Password;"

Workgroup:
"Driver={Microsoft Access Driver (*.mdb)}; Dbq=C:\App1\Your_Database_Name.mdb; SystemDB=C:\App1\Your_Database_Name.mdw;"

Exclusive "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\App1\Your_Database_Name.mdb; Exclusive=1; Uid=Your_Username; Pwd=Your_Password;"

SQL SqlConnection .NET strings

Standard Security:
1. "Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;" < br>2. "Server=Your_Server_Name;Database=Your_Database_Name;UserID=Your_Username;Password=Your_Password;Trusted_Connection=False"

Trusted connection:
1. "Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"
2."Server=Your_Server_Name;Database=Your_Database_Name;Trusted_Connection=True;"

SQL OleDbConnection .NET strings

Standard Security:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"

Trusted connection:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"

SQL OLE DB connection strings

Standard Security:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"

Trusted connection:
"Provider=SQLOLEDB;Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"

SQL ODBC connection strings

Standard Security:< br> "Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Uid=Your_Username;Pwd=Your_Password;"

Trusted connection:< br> "Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Trusted_Connection=yes;"

Thursday, September 6, 2007

About hariyana...

Hindi (हिन्दी) is a language spoken in most states in northern and central India. It is an Indo-European language, of the Indo-Iranian subfamily. It evolved from the Middle Indo-Aryan prakrit languages of the middle ages, and indirectly, from Sanskrit. Hindi derives a lot of its higher vocabulary from Sanskrit. Due to Muslim influence in northern India, there are also a number of Persian and Turkish loanwords.

Linguists think of Hindi and Urdu as the same language, the difference being that Hindi is written in Devanagari and draws vocabulary from Sanskrit, while Urdu is written in Arabic script and draws on Persian. The separation is largely a political one; before the partition of India into India and Pakistan, spoken Hindi and Urdu were considered the same language, Hindustani. Since partition, Standard Hindi has developed by replacing many words of Persian origin with Sanskrit words. Hindi and Urdu presently have four standard literary forms: Standard Hindi, Urdu, Dakkhini (Dakhini), and Rehkta. Dakhini is a dialect of Urdu from the Deccan region of south-central India, chiefly from Hyderabad, that uses fewer Persian words. Rehkta is a form of Urdu used chiefly for poetry.

After Chinese, Hindi is the second most spoken language in the world. About 500 million people speak Hindi, in India and abroad, and the total number of people who can understand the language may be 800 million. A 1997 survey found that 66% of all Indians can speak Hindi, and 77% of the Indians regard Hindi as 'one language across the nation'. More than 180 million people in India regard Hindi as their mother tongue. Another 300 million use it as second language.

Outside of India, Hindi speakers are 100,000 in USA; 685,170 in Mauritius; 890,292 in South Africa; 232,760 in Yemen; 147,000 in Uganda; 5,000 in Singapore; 20,000 in New Zealand; 30,000 in Germany. Urdu, the official language of Pakistan, is spoken by about 41 million in Pakistan and other countries. Hindi became one of the official languages of India on January 26, 1965 and it is a minority language in a number of countries, including Fiji, Mauritius, Guyana, Suriname, Trinidad and Tobago, and United Arab Emirates.

Hindi is generally classified in the Central Zone of the Indo-Aryan languages. Khadiboli, the dialect spoken in Western Uttar Pradesh, east of Delhi is the basis for the language used by the government and taught in schools. Hindi is the predominant language in the states and territories of Himachal Pradesh, Delhi, Haryana, Chandigarh, Uttar Pradesh, Rajasthan, Madhya Pradesh, Bihar, as well as the cities of Mumbai and Hyderabad. Is not easy to delimit the borders of the Hindi speaking region. A number of spoken languages are very closely related to Hindi, and may be considered dialects, including Bambaiya Hindi, Bhaya, Braj, Braj Bhasha, Bundeli, Chamari, Ghera, Gowli, Haryanvi, Kanauji, and others. Some of the East-Central Zone languages, including Awadhi (Avadhi), Bagheli, Chhattisgarhi and Dhanwar, and Rajasthani languages, including Marwari, are also widely considered to be dialects of Hindi. There has been considerable controversy on the status of Punjabi and the Bihari languages, including Maithili, Bhojpuri, and Magadhi.

Hindi's popularity has been helped by Bollywood, the Hindi film industry. These movies have an international appeal and now they have broken into the Western markets as well. The beginnings of Hindi literature go back to the Prakrits that are a part of the classical Sanskrit plays. Tulasidas's Ramacharitamanas attained wide popularity. Modern masters include Sumitra Nandan Pant, Maithili Sharan Gupta, Mahadevi Varma, Ajneya.

About Delhi....

You’ve arrived at Delhi. The months of planning and curiosity are over; you’re actually in India. Every experience, every sound, every smell shouts that you’ve arrived somewhere magical. Somewhere Special. It is here that the deep love of one man for one woman created the Taj Mahal; where the King of Kings ruled; where the sacred Ganges flows past holy cities; where the Himalayas stand silent and magnificent; where 5000 years of culture waits to be absorbed.

India’s capital city, Delhi is the second most widely used entry point into the country, being on the route of most major airlines. It is well linked by rail, air and road to all parts of the country. The remains of seven distinctive capital cities – among them Shahjahanabad and Qutab Minar – can be seen. Here, museums, art galleries and cultural centers attract the finest exhibitions and performances from India and abroad. Shopping encompasses virtually everything that can be bought in the country; hotels range from the deluxe to the more modest. Most fascinating of all is the character of Delhi which varies from the 13th century mausoleum of the Lodi kings set in a sprawling park to ultra modern chrome and glass skyscrapers; and from imperial India’s Parliament House and the President’s Palace to the never ending bustle of the walled city surrounding Jama Masjid. Delhi also makes the ideal base for a series of short excursions to neighbouring places, all connected by road.

The capital of India, Delhi blends an historic past and a vibrant present. The Imperial city planned for the British by Lutyens is set in parks and shaded avenues. Legend has it that Delhi, then called Indraprastha, was originally founded around 1200 B.C. by the Pandavas, the august heroesof the epic Mahabharata. Present day Delhi is built around the ruins of seven ancient cities.

Delhi is above all an historic city, an elegant capital, content to leave to Calcutta and Bombay the roles of commercial and business supremacy. It is in fact really two distinct cities; the energy and colour and the thronged bazaars and Moghul architecture of Old Delhi contrast with the formal splendour of New Delhi, whose wide boulevards offer ever-changing perspectives of Lutyen’s landscaped city. Delhi has several world-famous luxury hotels, with the comfort and style to ensure relaxation after your journey; from here, set forth to experience the sights and sounds of the city.

The gracious Red Fort, the Jama Masjid (the largest mosque in India), the Qutab Minar complex with its soaring tower - all are waiting to be explored. Allows some time to wander round the inexpensive modern shops and handicraft centres. Magicians and dancing bears entertain crowds in the marketplaces, while fortune tellers may offer glimpses of the future. The heat of the day gives way to balmy evenings; enjoy a meal in one of the many splendid restaurants, the exotic music of sitars and veenas and the subtle rhythms of the tabla accompanying the delicious cuisines from throughout the country. Flights and trains and buses run from Delhi all over north India, so it is always easy to reach the next destination

Temperature (deg C.): Summer - Max.41.2, Min.21.4; Winter - Max.33.7, Min.6.8.
Languages Spoken : Hindi, English and Punjabi in some parts.
Best Season : September to March.
TRANSPORT AND COMMUNICATION

Air :
Delhi is well connected with major cities by Indian Airlines & 0ther private Airlines.

Rail:
Delhi is the headquarters of the Northern Railway and is the most well connected railhead both on broad guage (New Delhi) and meter guage (Delhi Main) railway line with all of the major places in India.

Road:
Delhi is at the intersection of several national highways and is well connected by regular bus services from Inter State bus terminal (ISBT), Kashmiri Gate to Agra-203 kms, Allahabad-603 kms, Almora-373 kms, Amritsar -447 kms, Bhakra-354 kms, Bharatpur-190 kms, Calcutta-1490 kms, Chandigarh -238 kms, Corbet National Park-297 kms, Jaipur-258 kms, Khajuraho-596 kms, Kulu-502 kms, Mathura-147 kms, Mussoorie-269 kms, Nainital-318 kms, Shimla -343 kms, Shrinagar-376 kms, Udaipur-663 kms, Varanasi-738 kms etc.

PLACES OF INTEREST
Moghul Monuments Purana Quila (Old Fort), Kabuli or Khuni Darwaja, Feroz Shah Kotla,Kutub Minar, Tughlaqabad, Nizamuddin Aulia, Humayun's Tomb, Lodi's Tomb, Safdarjung's Tomb Jama Masjid, Jantar Mantar and Red Fort (Son-et-lumiere show) Timings : Summer 1900 to 2000 hrs (Hindi) 2030 to 2130 hrs (English) Winter 1800 to 1900 hrs (Hindi) 1930 to 2030 hrs (English)

British Monuments
India Gate, The Secretariat Complex, Rashtrapati Bhavan & Mughal Gardens, Parliament House, Teen Murti House and Connaught Place (Son-et-lumiere show) Timings : 1800 to 1900 hrs (Hindi) 1930 to 2030 hrs (English) Bahai (Lotus shaped) temple, a marble structure of remarkable beauty

Other Monuments
The Supreme Court, Raj Ghat, Shanti Vana, Vijay Ghat, Ladakh Buddha Vihara, Vigyan Bhavan, Diplomatic Enclave.

EXCURSIONS
Badhkal Lake 32 kms, Ballabgarh 36.8 kms, Karnalake 132 kms, Dabchick 92 kms, Dasna 40 kms, Dhanaa 41 kms, Dharudara 70 kms, Hindon 19.3 kms, Hodal 90 kms, Maur Bund 32 kms, Okhla 11 kms, Sardhana 24 kms, Sohna 56 kms and Suraj Kund 18 kms

Religion....

Most of the people in Himachal are Hindus. There is a sizable number of Buddhists who live in Himachal. Hinduism practiced in the areas of Himachal that are closer to the northern plains is very similar to the Hinduism practiced in the plains.

Upper hill areas have their own distinct flavor of Hinduism. Their practice of religion combines the local legends and beliefs with the larger Hindu beliefs. The temple architecture has also been influenced by local constraints such as availability or lack of availability of certain construction materials. Most of the upper hill temples are made of wood and more similar to Pagodas in design.

Most of the people of Himachal who live in the areas that border with China are Buddhist. There are many beautiful Buddhist temples and pagodas in Himachal.

Wednesday, September 5, 2007

People in himachal pradesh..

Most of the people in Himachal depend on agriculture for livelihood. Many people derive their income from sheep, goats, and other cattle. Ninety percent of the people live in villages and small towns. Villages usually have terraced fileds and small two storey houses with sloping roof. The villages are mostly self-contained with a few shops to take care of basic necessities of life. Most villages have a temple, where people congregate for worship. In many parts of the Himachal the village Gods are carried on palanquins to village fairs. On Dussehra the largest congregation of village Gods takes place at Kullu.

The SOAP Fault Element

An error message from a SOAP message is carried inside a Fault element.

If a Fault element is present, it must appear as a child element of the Body element. A Fault element can only appear once in a SOAP message.

The SOAP Fault element has the following sub elements:

Sub Element Description
A code for identifying the fault
A human readable explanation of the fault
Information about who caused the fault to happen
Holds application specific error information related to the Body element

The SOAP Body Element

The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message.

Immediate child elements of the SOAP Body element may be namespace-qualified. SOAP defines one element inside the Body element in the default namespace ("http://www.w3.org/2001/12/soap-envelope"). This is the SOAP Fault element, which is used to indicate error messages.


xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

Apples

The mustUnderstand Attribute

The SOAP mustUnderstand attribute can be used to indicate whether a header entry is mandatory or optional for the recipient to process.

If you add "mustUnderstand="1" to a child element of the Header element it indicates that the receiver processing the Header must recognize the element. If the receiver does not recognize the element it must fail when processing the Header.

Syntax
soap:mustUnderstand="0|1"

Example

xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">
234

...
...

The SOAP Envelope Element

The required SOAP Envelope element is the root element of a SOAP message. It defines the XML document as a SOAP message.

Note the use of the xmlns:soap namespace. It should always have the value of:

http://www.w3.org/2001/12/soap-envelope

and it defines the Envelope as a SOAP Envelope:


xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
Message information goes here
...

Skeleton SOAP Message


xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
...

...
...

...
...

Syntax Rules

Here are some important syntax rules:

A SOAP message MUST be encoded using XML
A SOAP message MUST use the SOAP Envelope namespace
A SOAP message MUST use the SOAP Encoding namespace
A SOAP message must NOT contain a DTD reference
A SOAP message must NOT contain XML Processing Instructions

SOAP Building Blocks

A SOAP message is an ordinary XML document containing the following elements:

A required Envelope element that identifies the XML document as a SOAP message
An optional Header element that contains header information
A required Body element that contains call and response information
An optional Fault element that provides information about errors that occurred while processing the message

Why SOAP?

It is important for application development to allow Internet communication between programs.

Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic.

A better way to communicate between applications is over HTTP, because HTTP is supported by all Internet browsers and servers. SOAP was created to accomplish this.

SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.

What is SOAP?

SOAP stands for Simple Object Access Protocol
SOAP is a communication protocol
SOAP is for communication between applications
SOAP is a format for sending messages
SOAP is designed to communicate via Internet
SOAP is platform independent
SOAP is language independent
SOAP is based on XML
SOAP is simple and extensible
SOAP allows you to get around firewalls
SOAP will be developed as a W3C standard

Java-language developers—learn how to create .NET applications with the Microsoft development tool for you: Visual J# .NET!

Leverage your Java skills and learn how to create powerful Windows® applications and high-performance, distributed applications with Microsoft® Visual J#® .NET in this comprehensive tutorial and reference. Presented in an easy-to-browse format, this erudite book provides the authoritative technical details you need to leverage Visual J# .NET and the richness of the Microsoft .NET Framework to build scalable, enterprise-level applications. You’ll examine the architecture of .NET, find out how to process data with Visual J# .NET, see how to create XML Web services, and discover how to build multithreaded applications that span the local area network. You’ll also look at the key topics for building applications that use Windows features and services and find out how to provide a global reach to your applications via the Internet. Topics covered include:

• The challenge of n-tier development
• The .NET platform
• Java and the common language runtime
• Graphical user interfaces
• Processing XML
• Transforming XML
• Microsoft ADO.NET
• Multithreading with .NET
• Basic network programming
• Serializing objects
• .NET remoting
• Using message queues
• Integrating with unmanaged components
• Serviced components and COM+
• Writing Windows services
• Microsoft ASP.NET—a better ASP
• Building a Web service
• Creating a Web service client

Why is a migration from the MSJVM necessary?

As per a legal agreement between Microsoft and Sun Microsystems, Microsoft is no longer updating the Microsoft Java Virtual Machine (MSJVM) and can only provide fixes for security issues through December 31, 2007. Microsoft cannot provide any other updates to the MSJVM, and after December 31, 2007 the MSJVM becomes obsolete.

Obsolete software, whether in the form of unsupported products, old service packs, or even expired certificates, is an issue every customer needs to be concerned with. Microsoft software life cycle communications help customers identify obsolete software in a proactive and ongoing fashion.

Can I migrate Java-language source code to J# and access it from, say, C# or Visual Basic .NET?

Yes; J# compiles to Microsoft intermediate language (MSIL) and any CLS-compliant language (such as C# or Visual Basic .NET) can utilize code generated by J#. Many customers are using J# to bring Java-language business logic or libraries over to the .NET Framework so that they can be used from their other applications. Likewise, J# can access functionality from assemblies created in C# and other languages.

How would a Java developer use Visual J# .NET?

Visual J# .NET provides functionality equivalent to most of the JDK 1.1.4 libraries and some of the JDK 1.2 libraries. Of course, this level of support isn’t going to allow a full-scale J2EE application to compile without errors on the .NET Framework. But it turns out that this level of JDK functionality actually provides coverage for a great deal of existing business logic, and several customers are using J# for this purpose.



If you are able to separate the business logic from your application (or maybe you have libraries that are entirely business logic) then in many cases you can just compile this with Visual J# .NET and generate an MSIL assembly (that is, a .dll or .exe file) with little or no additional modifications. If there is JDK functionality being used in your code that is not supported with J#, remember that J# has full access to the .NET Framework and chances are good that you can find an equivalent .NET Framework class.

Tuesday, September 4, 2007

Visual J# .NET

Visual J# .NET brings support for the Java-language syntax to Visual Studio .NET. Visual J# .NET provides developers with full access to the rich set of development libraries found in the .NET Framework while preserving the familiar Java-language syntax. Visual J# .NET also provides functionality equivalent to most of the JDK 1.1.4 libraries, some JDK 1.2 libraries, and most of the libraries included with Visual J++ 6.0.

Monday, September 3, 2007

How do you restrict page errors display in the JSP page?

You first set "Errorpage" attribute of PAGE directory to the name of the error page (ie Errorpage="error.jsp")in your jsp page .Then in the error jsp page set "isErrorpage=TRUE". When an error occur in your jsp page it will automatically call the error page.

How do I prevent the output of my JSP or Servlet pages from being cached by the browser?

You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Just execute the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser. You need both the statements to take care of some of the older browser versions.

Why does JComponent have add() and remove() methods but Component does not?

because JComponent is a subclass of Container, and can contain other components and jcomponents. How can I implement a thread-safe JSP page? - You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@ page isThreadSafe="false" % > within your JSP page.

How do I include static files within a JSP page?

Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should always supply a relative URL for the file attribute. Although you can also include static resources using the action, this is not advisable as the inclusion is then performed for each and every request.

What are stored procedures? How is it useful?

A stored procedure is a set of statements/commands which reside in the database. The stored procedure is pre-compiled and saves the database the effort of parsing and compiling sql statements every time a query is run. Each database has its own stored procedure language, usually a variant of C with a SQL preproceesor. Newer versions of db’s support writing stored procedures in Java and Perl too. Before the advent of 3-tier/n-tier architecture it was pretty common for stored procs to implement the business logic( A lot of systems still do it). The biggest advantage is of course speed. Also certain kind of data manipulations are not achieved in SQL. Stored procs provide a mechanism to do these manipulations. Stored procs are also useful when you want to do Batch updates/exports/houseKeeping kind of stuff on the db. The overhead of a JDBC Connection may be significant in these cases.

Can we use the constructor, instead of init(), to initialize servlet?

Yes , of course you can use the constructor instead of init(). There’s nothing to stop you. But you shouldn’t. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructur a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or ServletContext.

How to Retrieve Warnings?

SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object

SQLWarning warning = stmt.getWarnings();
if (warning != null)
{
while (warning != null)
{
System.out.println(\"Message: \" + warning.getMessage());
System.out.println(\"SQLState: \" + warning.getSQLState());
System.out.print(\"Vendor error code: \");
System.out.println(warning.getErrorCode());
warning = warning.getNextWarning();
}
}

HTML for Lists

1. Bulleted Lists:
    begins a bulleted, indented list. Each item in the list is then prefaced with the
  • tag. It is not necessary to insert a break at the end of each line -- the
  • tag automatically creates a new line.

    * with

  • * with

  • * with


  • 2. Numbered Lists:
      begins a numbered, indented list. Each item in the list is then prefaced with the
    1. tag. You need to close the list with the
    tag. Note: You can expand the
      to specify the TYPE of numbering:

        1 (decimal numbers: 1, 2, 3, 4, 5, ...)
          a (lowercase alphabetic: a, b, c, d, e, ...)
            A (uppercase alphabetic: A, B, C, D, E, ...)
              i (lowercase Roman numerals: i, ii, iii, iv, v, ...)
                I (uppercase Roman numerals: I, II, III, IV, V, ...)

How do I get special characters in my HTML?

The special case of the less-than ('<'), greater-than ('>'), and ampersand ('&') characters. In general, the safest way to write HTML is in US-ASCII (ANSI X3.4, a 7-bit code), expressing characters from the upper half of the 8-bit code by using HTML entities.
Working with 8-bit characters can also be successful in many practical situations: Unix and MS-Windows (using Latin-1), and also Macs (with some reservations).
Latin-1 (ISO-8859-1) is intended for English, French, German, Spanish, Portuguese, and various other western European languages. (It is inadequate for many languages of central and eastern Europe and elsewhere, let alone for languages not written in the Roman alphabet.) On the Web, these are the only characters reliably supported. In particular, characters 128 through 159 as used in MS-Windows are not part of the ISO-8859-1 code set and will not be displayed as Windows users expect. These characters include the em dash, en dash, curly quotes, bullet, and trademark symbol; neither the actual character (the single byte) nor its �nnn; decimal equivalent is correct in HTML. Also, ISO-8859-1 does not include the Euro currency character. (See the last paragraph of this answer for more about such characters.)
On platforms whose own character code isn't ISO-8859-1, such as MS-DOS and Mac OS, there may be problems: you have to use text transfer methods that convert between the platform's own code and ISO-8859-1 (e.g., Fetch for the Mac), or convert separately (e.g., GNU recode). Using 7-bit ASCII with entities avoids those problems, but this FAQ is too small to cover other possibilities in detail.
If you run a web server (httpd) on a platform whose own character code isn't ISO-8859-1, such as a Mac or an IBM mainframe, then it's the job of the server to convert text documents into ISO-8859-1 code when sending them to the network.
If you want to use characters not in ISO-8859-1, you must use HTML 4 or XHTML rather than HTML 3.2, choose an appropriate alternative character set (and for certain character sets, choose the encoding system too), and use one method or other of specifying this.

How can I show HTML examples without them being interpreted as part of my document?

Within the HTML example, first replace the "&" character with "&" everywhere it occurs. Then replace the "<" character with "<" and the ">" character with ">" in the same way.
Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.

What is a DOCTYPE? Which one do I use?

According to HTML standards, each HTML document begins with a DOCTYPE declaration that specifies which version of HTML the document uses. Originally, the DOCTYPE declaration was used only by SGML-based tools like HTML validators, which needed to determine which version of HTML a document used (or claimed to use).
Today, many browsers use the document's DOCTYPE declaration to determine whether to use a stricter, more standards-oriented layout mode, or to use a "quirks" layout mode that attempts to emulate older, buggy browsers.

What is everyone using to write HTML?

Everyone has a different preference for which tool works best for them. Keep in mind that typically the less HTML the tool requires you to know, the worse the output of the HTML. In other words, you can always do it better by hand if you take the time to learn a little HTML.

How comfortable are you with writing HTML entirely by hand?

Very. I don’t usually use WYSIWYG. The only occasions when I do use Dreamweaver are when I want to draw something to see what it looks like, and then I’ll usually either take that design and hand-modify it or build it all over again from scratch in code. I have actually written my own desktop HTML IDE for Windows (it’s called Less Than Slash) with the intention of deploying it for use in web development training. If has built-in reference features, and will autocomplete code by parsing the DTD you specify in the file. That is to say, the program doesn’t know anything about HTML until after it parses the HTML DTD you specified. This should give you some idea of my skill level with HTML.

What is a Hypertext link?

A hypertext link is a special tag that links one page to another page or resource. If you click the link, the browser jumps to the link's destination.

How can I include comments in HTML?

Technically, since HTML is an SGML application, HTML uses SGML comment syntax. However, the full syntax is complex, and browsers don't support it in its entirety anyway. Therefore, use the following simplified rule to create HTML comments that both have valid syntax and work in browsers:

An HTML comment begins with "", and does not contain "--" or ">" anywhere in the comment.
The following are examples of HTML comments:

*
*
*

Do not put comments inside tags (i.e., between "<" and ">") in HTML markup.

How do I create frames? What is a frameset?

Frames allow an author to divide a browser window into multiple (rectangular) regions. Multiple documents can be displayed in a single window, each within its own frame. Graphical browsers allow these frames to be scrolled independently of each other, and links can update the document displayed in one frame without affecting the others.
You can't just "add frames" to an existing document. Rather, you must create a frameset document that defines a particular combination of frames, and then display your content documents inside those frames. The frameset document should also include alternative non-framed content in a NOFRAMES element.
The HTML 4 frames model has significant design flaws that cause usability problems for web users. Frames should be used only with great care.

What is the simplest HTML page?

HTML Code:


This is my page title!


This is my message to the world!



Browser Display:
This is my message to the world!

What is a tag?

In HTML, a tag tells the browser what to do. When you write an HTML page, you enter tags for many reasons -- to change the appearance of text, to show a graphic, or to make a link to another page.

What is HTML?

Answer1:
HTML, or HyperText Markup Language, is a Universal language which allows an individual using special code to create web pages to be viewed on the Internet.

Answer2:
HTML ( H yper T ext M arkup L anguage) is the language used to write Web pages. You are looking at a Web page right now.
You can view HTML pages in two ways:
* One view is their appearance on a Web browser, just like this page -- colors, different text sizes, graphics.
* The other view is called "HTML Code" -- this is the code that tells the browser what to do.

Design Aims

In designing XHTML, a number of design aims were kept in mind to help direct the design. These included:

As generic XML as possible: if a facility exists in XML, try to use that rather than duplicating it.
Less presentation, more structure: already mentioned above.
More usability: try to make the language easy to write, and make the resulting documents easy to use.
More accessibility: some call it 'designing for our future selves'; the design should be as inclusive as possible.
Better internationalization: it is a World Wide Web.
More device independence: new devices coming online, such as telephones, PDAs, tablets, televisions and so on mean that it is imperative to have a design that allows you to author once and render in different ways on different devices, rather than authoring new versions of the document for each type of device.
Less scripting: achieving functionality through scripting is difficult for the author and restricts the type of user agent you can use to view the document. We have tried to identify current typical usage, and include those usages in markup.

XHTML2 and Presentation

The original version of HTML was designed to represent the structure of a document, not its presentation. Even though presentation-oriented elements were later added to the language by browser manufacturers, HTML is at heart a document structuring language. XHTML2 takes HTML back to these roots, by removing all presentation elements, and subordinating all presentation to stylesheets. This gives greater flexibility, and more powerful presentation possibilities, since CSS can do more than the presentational elements of HTML ever did.

What is XHTML 2?

XHTML 2 is a general purpose markup language designed for representing documents for a wide range of purposes across the World Wide Web. To this end it does not attempt to be all things to all people, supplying every possible markup idiom, but to supply a generally useful set of elements, with the possibility of extension using the span and div elements in combination with stylesheets.

Sunday, September 2, 2007

Why are you leaving (or did you leave) this position ?
(If you have a job presently tell the hr)

If you’re not yet 100% committed to leaving your present post, don’t be afraid to say so. Since you have a job, you are in a stronger position than someone who does not. But don’t be coy either. State honestly what you’d be hoping to find in a new spot. Of course, as stated often before, you answer will all the stronger if you have already uncovered what this position is all about and you match your desires to it.

(If you do not presently have a job tell the hr.)

Never lie about having been fired. It’s unethical – and too easily checked. But do try to deflect the reason from you personally. If your firing was the result of a takeover, merger, division wide layoff, etc., so much the better.

But you should also do something totally unnatural that will demonstrate consummate professionalism. Even if it hurts , describe your own firing – candidly, succinctly and without a trace of bitterness – from the company’s point-of-view, indicating that you could understand why it happened and you might have made the same decision yourself.

Your stature will rise immensely and, most important of all, you will show you are healed from the wounds inflicted by the firing. You will enhance your image as first-class management material and stand head and shoulders above the legions of firing victims who, at the slightest provocation, zip open their shirts to expose their battle scars and decry the unfairness of it all.

For all prior positions:

Make sure you’ve prepared a brief reason for leaving. Best reasons: more money, opportunity, responsibility or growth.
Tell me about something you did – or failed to do – that you now feel a little ashamed of ?
As with faults and weaknesses, never confess a regret. But don’t seem as if you’re stonewalling either.

Best strategy: Say you harbor no regrets, then add a principle or habit you practice regularly for healthy human relations.

Example: Pause for reflection, as if the question never occurred to you. Then say to hr, “You know, I really can’t think of anything.” (Pause again, then add): “I would add that as a general management principle, I’ve found that the best way to avoid regrets is to avoid causing them in the first place. I practice one habit that helps me a great deal in this regard. At the end of each day, I mentally review the day’s events and conversations to take a second look at the people and developments I’m involved with and do a double check of what they’re likely to be feeling. Sometimes I’ll see things that do need more follow-up, whether a pat on the back, or maybe a five minute chat in someone’s office to make sure we’re clear on things…whatever.”

“I also like to make each person feel like a member of an elite team, like the Boston Celtics or LA Lakers in their prime. I’ve found that if you let each team member know you expect excellence in their performance…if you work hard to set an example yourself…and if you let people know you appreciate and respect their feelings, you wind up with a highly motivated group, a team that’s having fun at work because they’re striving for excellence rather than brooding over slights or regrets.”
What are your greatest weaknesses ?
Disguise a strength as a weakness.

Example: “I sometimes push my people too hard. I like to work with a sense of urgency and everyone is not always on the same wavelength.”

Drawback: This strategy is better than admitting a flaw, but it's so widely used, it is transparent to any experienced interviewer.

BEST ANSWER: (and another reason it's so important to get a thorough description of your interviewer's needs before you answer questions): Assure the interviewer that you can think of nothing that would stand in the way of your performing in this position with excellence. Then, quickly review you strongest qualifications.

Example: “Nobody's perfect, but based on what you've told me about this position, I believe I' d make an outstanding match. I know that when I hire people, I look for two things most of all. Do they have the qualifications to do the job well, and the motivation to do it well? Everything in my background shows I have both the qualifications and a strong desire to achieve excellence in whatever I take on. So I can say in all honesty that I see nothing that would cause you even a small concern about my ability or my strong desire to perform this job with excellence.”

Alternate strategy (if you don't yet know enough about the position to talk about such a perfect fit):

Instead of confessing a weakness, describe what you like most and like least, making sure that what you like most matches up with the most important qualification for success in the position, and what you like least is not essential.

Example: Let's say you're applying for a teaching position. “If given a choice, I like to spend as much time as possible in front of my prospects selling, as opposed to shuffling paperwork back at the office. Of course, I long ago learned the importance of filing paperwork properly, and I do it conscientiously. But what I really love to do is sell (if your interviewer were a sales manager, this should be music to his ears.)
What are your greatest strengths ?

You know that your key strategy is to first uncover your interviewer's greatest wants and needs before you answer questions. And from Question 1, you know how to do this.

Prior to any interview, you should have a list mentally prepared of your greatest strengths. You should also have, a specific example or two, which illustrates each strength, an example chosen from your most recent and most impressive achievements.

You should, have this list of your greatest strengths and corresponding examples from your achievements so well committed to memory that you can recite them cold after being shaken awake at 2:30AM.

Then, once you uncover your interviewer's greatest wants and needs, you can choose those achievements from your list that best match up.

As a general guideline, the 10 most desirable traits that all employers love to see in their employees are:

A proven track record as an achiever...especially if your achievements match up with the employer's greatest wants and needs.

Intelligence...management "savvy".

Security Tip

Use Firefox instead of Internet Explorer and PREVENT Spyware !


Firefox is free and is considered the best free, safe web browser available today
Get Firefox with Google Toolbar for better browsing

Honesty...integrity...a decent human being.

Good fit with corporate culture...someone to feel comfortable with...a team player who meshes well with interviewer's team.

Likeability...positive attitude...sense of humor.

Good communication skills.

Dedication...willingness to walk the extra mile to achieve excellence.

Definiteness of purpose...clear goals.

Enthusiasm...high level of motivation.

Confident...healthy...a leader.

HR Interview Questions Answers .....?

Tell me about yourself ?
Start with the present and tell why you are well qualified for the position. Remember that the key to all successful interviewing is to match your qualifications to what the interviewer is looking for. In other words you must sell what the buyer is buying. This is the single most important strategy in job hunting.

So, before you answer this or any question it's imperative that you try to uncover your interviewer's greatest need, want, problem or goal.

To do so, make you take these two steps:
Do all the homework you can before the hr interview to uncover this person's wants and needs (not the generalized needs of the industry or company)

As early as you can in the interview, ask for a more complete description of what the position entails. You might say: “I have a number of accomplishments I'd like to tell you about, but I want to make the best use of our time together and talk directly to your needs. To help me do, that, could you tell me more about the most important priorities of this position? All I know is what I (heard from the recruiter, read in the classified ad, etc.)”

Then, ALWAYS follow-up with a second and possibly, third question, to draw out his needs even more. Surprisingly, it's usually this second or third question that unearths what the interviewer is most looking for.

You might ask simply, "And in addition to that?..." or, "Is there anything else you see as essential to success in this position?:

This process will not feel easy or natural at first, because it is easier simply to answer questions, but only if you uncover the employer's wants and needs will your answers make the most sense. Practice asking these key questions before giving your answers, the process will feel more natural and you will be light years ahead of the other job candidates you're competing with.

After uncovering what the employer is looking for, describe why the needs of this job bear striking parallels to tasks you've succeeded at before. Be sure to illustrate with specific examples of your responsibilities and especially your achievements, all of which are geared to present yourself as a perfect match for the needs he has just described.
Be natural
Many interviewees adopt a stance which is not their natural self.
It is amusing for interviewers when a candidate launches into an accent which he or she cannot sustain consistently through the interview or adopt mannerisms that are inconsistent with his/her personality.
Interviewers appreciate a natural person rather than an actor.
It is best for you to talk in natural manner because then you appear genuine.
Eye contact
You must maintain eye contact with the panel, right through the interview. This shows your self-confidence and honesty.
Many interviewees while answering, tend to look away. This conveys you are concealing your own anxiety, fear and lack of confidence.
Maintaining an eye contact is a difficult process. As the circumstances in an interview are different, the value of eye contact is tremendous in making a personal impact.
Humor
A little humor or wit thrown in the discussion occasionally enables the interviewers to look at the pleasant side of your personality,. If it does not come naturally do not contrive it.
By injecting humor in the situation doesn’t mean that you should keep telling jokes. It means to make a passing comment that, perhaps, makes the interviewer smile.
The interviewer normally pays more attention if you display an enthusiasm in whatever you say.
This enthusiasm come across in the energetic way you put forward your ideas.
You should maintain a cheerful disposition throughout the interview, i.e. a pleasant countenance hold s the interviewers interest.

Tips For HR Interview...?

Entering the room
Prior to the entering the door, adjust your attire so that it falls well.
Before entering enquire by saying, “May I come in sir/madam”.
If the door was closed before you entered, make sure you shut the door behind you softly.
Face the panel and confidently say ‘Good day sir/madam’.
If the members of the interview board want to shake hands, then offer a firm grip first maintaining eye contact and a smile.
Seek permission to sit down. If the interviewers are standing, wait for them to sit down first before sitting.
An alert interviewee would diffuse the tense situation with light-hearted humor and immediately set rapport with the interviewers.

How many people have held the position in the past several years?

Knowing how many people have been in your job and why they left can offer you great insights. You'll want to know if they were promoted or quit altogether. A steady stream of resignations may be a sign you could be reentering the job market soon.

While many of the reasons positions eventually become unfulfilling are unavoidable, such as hitting a plateau after repeatedly performing the same duties, job seekers should consider the ways a new position will advance them

How many of my skills and experiences will I be able to use and learn?

Make sure your unique skills and talents will be used and that training and promotion are open in the future. When you decide to move on, you'll want to have a new crop of experiences to sell to your next employer. Your goal is to perform well at work while constantly growing and learning.

How much change is in the works at your prospective company, and what kind?

Constant change at work can mean constant stress. Find out if there are any big changes coming, such as new processing systems or management, impending retirements or adoption of new procedures that still need to be ironed out. At the same time, remember that some of these transitions will have less effect on your position than others.

What are the boss's strengths and weaknesses?

This question can be tough to answer, and it's best saved for after the job offer has been extended. You'll want to get a good idea for your potential boss's management style. Speak to your potential boss as much as possible to get a feel for his personality and what you can live with. Does he micromanage? Will you get consistent feedback and reviews? Does he make small talk, or is every conversation strictly business?

Will the actual work and job responsibilities provide gratification, fulfillment and challenge?

This question is often overlooked, because applicants get hung up on job titles, salary and benefits. Try to get a clear sense of what an actual day would be like. What will you spend the majority of your time doing? Is the work in line with your values? Will you likely learn this job quickly and become bored and unchallenged?

What to Ask After the Offer...?

All job hunters are waiting for that call -- the one that says they've landed the job. But as eager as you may be to escape either your current job or the unemployment ranks, don't abdicate your power position once the offer comes in. Now it's your turn to sit in the interviewer's seat and ask the company and yourself some tough questions -- the answers to which could mean the difference between career bliss and disaster.