Monday, 29 September 2014

SQL SERVER – How to setup Database mail using FREE mail accounts

Database mail is one of the best features shipped in SQL Server 2005. It allows us to send mails without writing even a single line of script. However, there is a general perception that you must have your own mail server to configure Database Mail in the SQL Server and frankly speaking, to configure a mail server,  a good amount of expertise is required. Due to the lack of expertise in mail server configuration in new bie of SQL Server, they usually avoid learning, testing and implementing this nice feature.
However, one of the benefits of SQL Server Database mail is that,  it is NOTmandatory that you must have your own mail server, you can easily configure, test and implement it on any FREE mail servers like Gmail, Yahoo & Hotmailetc. and it is just a  matter of few clicks.
In this article, I will demonstrate step by step how to configure & test SQL Server database mail using Gmail, Yahoo & Hotmail accounts.
Before proceeding with the configuration, please make sure that you 
HAVE a valid email account in any of the FREE mail servers.

STEP 1  - Navigate to Database Mail:
First of all, you need to open SQL Server Management Studio (SSMS) and select Object Explorer followed by 
Management node and then Database Mail
as shown below.
STEP 2 – Configure Database Mail:
Once you select 
Database Mail, just right click on it and select Configure Database Mail 
as shown below.
STEP 3  - Welcome Screen:
Now, you are in 
welcome screen. This screen tells you all about Database Mail. However, you can check “skip the page in the future
” in order to avoid this screen next time. Just Press NEXT button to proceed as shown below.


STEP 4 – Configuration Task:
Next step is to create a new profile and then you can add multiple Email accounts in it in the later steps. In order to create a new profile you should select Option 1 (
Set up Database Mail by performing the following tasks 
) and press NEXT button as shown below.


STEP 5 – Enable Database Mail Feature:
Once you press Next button in the above step, it may ask you to 
Enable the Database Mail feature. It happens only when you configure the database mail for the first time. Click Yes and then Press NEXT to proceed.


STEP 6 – Profile Creation:
Once you enable the database mail, it will take you to the profile creation screen, where you can create a new 
profile as shown below. In this screen you can enter a unique profile name and a description (NOT mandatory), which is just an explanation to your profile. Once you are done with this information, just click Add 
button in order to add an Email account in the profile.



STEP 7 – Mail Account Creation:
Now you are in the Email account creation screen as shown below. You should be very careful to enter the data in this screen because your one typo mistake will 
STOP Database mail to send any email. The most important data that you must enter in this screen is its Server name (Actually SMTP Server name). In addition, you can use the Port No 25 but sometimes this port is blocked in your network. If you come across this situation, you can change the port number from 25 to 587.
Given below are the SMTP addresses of the FREE mail accounts.
·                         Yahoo : smtp.mail.yahoo.com
·                         Gmail : smtp.gmail.com
·                         Hotmail : smtp.live.com
Below are the configurations for each mail account, however, you will use one/all of them. In addition, you need to make sure that your email credentialsIS correct.
Yahoo account configuration :


Gmail account configuration :



Hotmail account configuration :



STEP 8 – Profile Verification:
Once you are done with the email account press OK button and it will take you back to the 
profile screen and it adds the email account, you just configured it in STEP 7 in the profile as shown below. Press NEXT button to proceed.



STEP 9 – Profile Security:
Now you entered into the manager profile security screen, you need to be very careful when 
configuring profile security. However, for testing purpose you can make it Public and default profile as well, as shown below and Press NEXT button.



STEP 10 – System Parameters:
This screen will show the configuration of 
system parameters as shown below, you just need to press NEXT button to proceed.



STEP 11  - Completion:
Now, you are in the database Mail complete wizard, this screen will show you a
summary of all your configuration, if you find any mistake even in this step, you can press BACK button and correct. However, if each and every configuration is correct, press FINISH button to complete the database mail configurations



STEP 12 – Status:
Once you press FINISH button in the above step, it will show you the status of the database mail configuration as shown below. It can be either be a success or a failure.


STEP 13  - Browse Send Test Email:
Lets test the database mail whether it is working fine or not. You need to again select the 
Database email and right click on it to further select the Send Test E-Mail.. 
as shown below.


STEP 14 – Send Test Email:
Once you select the 
Send Test E-Mail.., it opens a test email creation screen, where you will find your default profile to be selected. You just need to type any valid email address in the  To where you want to send a test mail. In addition, you can change the subject and body as well and press the Send Test E-Mail button. The moment you press this button, you will receive (Depends upon the server configuration) the test email in that defined email address from your Gmail, Yahoo or Hotmail account whichever you configured above in the selected profile.


Let me know if you configured Database and faced any particular issue in setting it up.

Rakhis

Thursday, 25 September 2014

Thiruvananthapuram Corporation



Official Website of Thiruvananthapuram Corporation

http://www.corporationoftrivandrum.in/

Thiruvananthapuram became the capital of Travancore in 1750. The city gets its name from the word, Thiru-anantha-puram, meaning the city of Anantha or "the town of Lord ANANTHA", the abode of the sacred Serpent Anantha on which Lord Vishnu, the preserver of the Hindu trinity, reclines. Thiruvananthapuram, the capital of the state of Kerala is a beautiful seaside city built on seven hills. The city is characterized by its undulating terrain of low coastal hills with narrow winding lanes and busy commercial alleys.

IKM

Information Kerala Mission

http://www.infokerala.org/
http://en.wikipedia.org/wiki/Information_Kerala_Mission

Information Kerala Mission [1] (IKM),Is an Autonomous Institution under Local self government Depart ment, Govermnet of kerala, for computerisation and networking of local governments in Kerala (India) and has been in existence for a decade since August 1999. The purpose of the Institution was to "facilitate easy and prompt communication between State Planning Board (SPB) and 1215 local 'bodies' for swift monitoring".[1]

Tuesday, 23 September 2014

Mangalyaan a success, reaches Mars orbit


Mars Orbiter Mission: India creates space history -  Congrats !

Mangalyaan - Mars Orbiter Mission successfully enters Mars' orbit. India is the first country in the world to succeed in its first attempt to enter the Mars orbit.

Mars Orbiter Mission is India's first interplanetary mission to planet Mars with an orbiter craft designed to orbit Mars in an elliptical orbit.Five solar-powered instruments aboard Mangalyaan will gather data to help determine how Martian weather systems work. Mangalyaan will also search Mars for methane, a key chemical in life processes on Earth that could also come from geological processes.

Congrats ISRO team

Mars Orbiter Mission: India creates space history - Congrats !


Proud moment for all Indians

ISRO created history with the success of Mars Orbiter Mission/Mangalyan. India has become the first country to achieve success in it's maiden Mars mission. Proud moment for all Indians

Difference between JDK, JRE and JVM

Understanding the difference between JDK, JRE and JVM is important in Java. We are having brief overview of JVM here.
If you want to get the detailed knowledge of Java Virtural Machine, move to the next page. Firstly, let's see the basic differences between the JDK, JRE and JVM.


JVM

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.
JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.
The JVM performs following main tasks:
  • Loads code
  • Verifies code
  • Executes code
  • Provides runtime environment

JRE

JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM.It physically exists.It contains set of libraries + other files that JVM uses at runtime.
Implementation of JVMs are also actively released by other companies besides Sun Micro Systems.
jre

JDK

JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools.
jdk

How to set path in Java

The path is required to be set for using tools such as javac, java etc.
If you are saving the java source file inside the jdk/bin directory, path is not required to be set because all the tools will be available in the current directory.
But If you are having your java file outside the jdk/bin folder, it is necessary to set path of JDK.
There are 2 ways to set java path:
  1. temporary
  2. permanent

1) How to set Temporary Path of JDK in Windows

To set the temporary path of JDK, you need to follow following steps:
  • Open command prompt
  • copy the path of jdk/bin directory
  • write in command prompt: set path=copied_path

For Example:

set path=C:\Program Files\Java\jdk1.6.0_23\bin
Let's see it in the figure given below:

how to set path in java

2) How to set Permanent Path of JDK in Windows

For setting the permanent path of JDK, you need to follow these steps:
  • Go to MyComputer properties -> advanced tab -> environment variables -> new tab of user variable -> write path in variable name -> write path of bin folder in variable value -> ok -> ok -> ok

For Example:

1)Go to MyComputer properties
how to set path in java
2)click on advanced tab
how to set path in java
3)click on environment variables
how to set path in java
4)click on new tab of user variables
how to set path in java
5)write path in variable name
how to set path in java
6)Copy the path of bin folder
how to set path in java
7)paste path of bin folder in variable value
how to set path in java
8)click on ok button
how to set path in java
9)click on ok button
how to set path in java
Now your permanent path is set.You can now execute any program of java from any drive.

Setting Java Path in Linux OS

Setting the path in Linux OS is same as setting the path in the Windows OS. But here we use export tool rather than set. Let's see how to set path in Linux OS:

export PATH=$PATH:/home/jdk1.6.01/bin/
Here, we have installed the JDK in the home directory under Root (/home).

Internal Details of Hello Java Program

In the previous page, we have learned about the first program, how to compile and how to run the first java program. Here, we are going to learn, what happens while compiling and running the java program. Moreover, we will see some question based on the first program.

What happens at compile time?

At compile time, java file is compiled by Java Compiler (It does not interact with OS) and converts the java code into bytecode.
compilation of simple java program






What happens at runtime?

At runtime, following steps are performed:
what happens at runtime when simple java program runs
Classloader: is the subsystem of JVM that is used to load class files.
Bytecode Verifier: checks the code fragments for illegal code that can violate access right to objects.
Interpreter: read bytecode stream then execute the instructions.


Q)Can you save a java source file by other name than the class name?

Yes, like the figure given below illustrates:
how to save simple java program by another name
To compile:javac Hard.java
To execute:java Simple


Q)Can you have multiple classes in a java source file?

Yes, like the figure given below illustrates:
how to contain multiple class in simple java program

Simple Program of Java

Simple Program of Java

In this page, we will learn how to write the simple program of java. We can write a simple hello java program easily after installing the JDK.
To create a simple java program, you need to create a class that contains main method. Let's understand the requirement first.

Requirement for Hello Java Example

For executing any java program, you need to

Creating hello java example

Let's create the hello java program:
  1. class Simple{  
  2.     public static void main(String args[]){  
  3.      System.out.println("Hello Java");  
  4.     }  
  5. }  
Test it Now
save this file as Simple.java

To compile:javac Simple.java
To execute:java Simple
Output:Hello Java

Understanding first java program

Let's see what is the meaning of class, public, static, void, main, String[], System.out.println().
  • class keyword is used to declare a class in java.
  • public keyword is an access modifier which represents visibility, it means it is visible to all.
  • static is a keyword, if we declare any method as static, it is known as static method. The core advantage of static method is that there is no need to create object to invoke the static method. The main method is executed by the JVM, so it doesn't require to create object to invoke the main method. So it saves memory.
  • void is the return type of the method, it means it doesn't return any value.
  • main represents startup of the program.
  • String[] args is used for command line argument. We will learn it later.
  • System.out.println() is used print statement. We will learn about the internal working of System.out.println statement later.




To write the simple program, open notepad by start menu -> All Programs -> Accessories -> notepadand write simple program as displayed below:
simple program of java

As displayed in the above diagram, write the simple program of java in notepad and saved it as Simple.java. To compile and run this program, you need to open command prompt by start menu -> All Programs -> Accessories -> command prompt.


how to compile and run simple program of java


To compile and run the above program, go to your current directory first; my current directory is c:\new . Write here:
To compile:javac Simple.java
To execute:java Simple

How many ways can we write a java program

There are many ways to write a java program. The modifications that can be done in a java program are given below:
1) By changing sequence of the modifiers, method prototype is not changed.
Let's see the simple code of main method.
  1. static public void main(String args[])  
2) subscript notation in java array can be used after type, before variable or after variable.
Let's see the different codes to write the main method.
  1. public static void main(String[] args)  
  2. public static void main(String []args)  
  3. public static void main(String args[])  
3) You can provide var-args support to main method by passing 3 ellipses (dots)
Let's see the simple code of using var-args in main method. We will learn about var-args later in Java New Features chapter.
  1. public static void main(String... args)  
4) Having semicolon at the end of class in java is optional.
Let's see the simple code.
  1. class A{  
  2. static public void main(String... args){  
  3. System.out.println("hello java4");  
  4. }  
  5. };  

Valid java main method signature

  1. public static void main(String[] args)  
  2. public static void main(String []args)  
  3. public static void main(String args[])  
  4. public static void main(String... args)  
  5. static public void main(String[] args)  
  6. public static final void main(String[] args)  
  7. final public static void main(String[] args)  
  8. final strictfp public static void main(String[] args)  

Invalid java main method signature

  1. public void main(String[] args)  
  2. static void main(String[] args)  
  3. public void static main(String[] args)  
  4. abstract public static void main(String[] args)  

Resolving an error "javac is not recognized as an internal or external command" ?

how to resolve the problem of simple program in java