Technology and more...
This blog is about everything I found useful and interesting.
Saturday, September 24, 2011
J2EE Introduction for beginners
Sunday, September 11, 2011
Tango dance
First time I saw it in the movie "the scent of a women". I was so much influenced by its music. It was like what I have been looking for since my whole life. It is one of the best dance. Although I never danced but I will surely learn it. This is some info regarding Tango if you like it too.
Tango is a dance that has influences from European and African culture.Dances from the candombe ceremonies of former slave peoples helped shape the modern day Tango. The dance originated in lower-class districts of Buenos Aires and Montevideo. The music derived from the fusion of various forms of music from Europe.The word "tango" seems to have first been used in connection with the dance in the 1890s. Initially it was just one of the many dances, but it soon became popular throughout society, as theatres and street barrel organs spread it from the suburbs to the working-class slums, which were packed with hundreds of thousands of European immigrants, primarily Italians, Spanish and French. (Source - Wikipedia)
Here are list of some songs that you can look for :
- Libertango
- Santa Maria by Project Gotan
Friday, May 27, 2011
JDBC and Microsoft Access
Here another most simple program.
There are following simple steps to do:
- To connect ms access with your program (of java) you need to create a database in ms access and then create a table in it. make sure that table name and database are different. so that you will not have confusion.
- Save the table and then database.
- Go to control panel.
- Go to Administrative Tools
- Click on Data Sources(ODBC)
- On User DSN(Data Source Name) tab you can easily see the MS Access Database in User Data Sources.
- Select the MS Access Database and click on configure (there will be ODBC Microsoft Access Setup open)
- Specify Data Source Name in Text field. The Description field is optional and you can leave it blank.
- In Database grid click on "select" and then go to path where database file is saved that was created by you.
- After this. Click on "Advanced " button and then specify a log in name and password and then click OK
- On System Database grid. click on none. and its done!! tadaaaaaaaa
I made an "employee" name database in MS Access and "emptable" named table which I am using here.
take a look at this.
This is the sample program that i had used for showing the database connectivity for a java program with Microsoft access.
Wednesday, May 25, 2011
Creating a Servlet without using IDE
It is my first blog. My heart felt apologies for the mistakes in the blog
I am demonstrating a program to manually create and run a servlet. I hope the reader is aware of core java. So here we go..
We need following stuff for this :
1.JDK 1.5 or latest version, ( I am here using JDK 1.6)
2. Apache Tomcat (Here we are using Apache Tomcat 6.0.32)
The Following is the code for the TestServlet.java. It simply sends the message to the browser.
I apologise if the code here is not well managed, because i am not so handy with blogging.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class TestServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throw IOException,ServletException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("Test Servlet ");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
doGet(request, response);
}
}
After this we need to put the information about our servlet in the web.xml file. Here is what you have to do.
compile your TestServlet.java and put the class file in the following location Apache Software Foundation\apache-tomcat-6.0.32\webapps\examples\WEB-INF\classes
Now update the file web.xml at location Apache Software Foundation\apache-tomcat-6.0.32\webapps\examples\WEB-INF with following information
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
The above information maps our servlet class to a URL Pattern , Apache tomcat picks your class file this way.
Voila!!. You have just created a servlet. Now we need to start the tomcat server.
After starting the server, type the url : http://localhost:8080/examples/test
You will see the message on the browser, that we put in the servlet.
if this blogs need any modification, your views are always welcomed.
Ravi