Home » Archives for 2013
Posted by TechBlogger on 12:34 PM

In this post we will illustrate how to Search and display information from database.
This post is continued from previous post have a look on how to do:
1. Database settings and Insetion of data into SQL database.
2. Searching information from Database
3. Deleting informstion from database
Create a html form upinfo.html
<html>
<head>
<h1><u>student form</u></h1>
</head>
<body bgcolor="DarkSalmon">
<form name=Student method=POST action=http://localhost:8080/examples/servlet/upinfo>
<font face="Copperplate Gothic Bold">STUDENT NAME</font face>:<input type="text" name="t1"...
Read more »
Posted by TechBlogger on 12:30 PM

In this post we will illustrate how to delete information from database.
This post is continued from previous post have a look on how to do:
1. Database settings and insetion of data into SQL database.
2. Searching information from database.
Create a html form delinfo.html
<html>
<head>
<h1><u>student form</u></h1>
</head>
<body bgcolor="DarkSalmon">
<form name=Student method=POST action=http://localhost:8080/examples/servlet/delinfo>
<font face="Copperplate Gothic Bold">ID</font face>:<input type="text" name="t2" size="30"><p><br>
<br>
<input type="submit"...
Read more »
Posted by TechBlogger on 12:24 PM

In this post we will illustrate how to Search and display information from database.This post is continued from previous post have a look on how to do:
1. Database settings & Insetion of data into SQL database.
Create a HTML page named searchinfo.html
<html>
<head>
<h1><u>student form</u></h1>
</head>
<body bgcolor="DarkSalmon">
<form name=Student method=POST action=http://localhost:8080/examples/servlet/searchinfo>
<font face="Copperplate Gothic Bold">ID</font face>:<input type="text" name="t2" size="30"><p><br>
<br>
<input type="submit" value="submit">
</form>
</body>
</html>
Now...
Read more »
Posted by TechBlogger on 12:18 PM

Unlike JSP and PHP Servlet is also server side scripting language. Servlet is Java based, Here this post we are going to illustrate how to add, delete , update and Search data from a form interacting with SQL database.
For consideration we will need tomcat server installed running on the system by default at port 8080 and sql database running on the system.
STEP 1:
Create database in Microsoft sql Query analyser .
Create table with 4 fields viz StudentName , ID , Age and Branch.
->Keep ID as INT and set it as primary key
->keep StudentName as VARCHAR(100)
->keep age as INTEGER
->Keep Branch as VARCHAR(100)
STEP 2 :
This...
Read more »
Posted by TechBlogger on 8:00 PM

searchstud.jsp
<%@page session="true"import="java.io.*"%>
<html>
<body bgcolor="#d0d0d0">
<br></br>
<br></br>
<br></br>
<h2><center>enter stuent details</center></h2>
<form name="searchstud"action="searchstudinfo.jsp"method="post">
<table border="2"align=center>
<tr><td>
<b>enter the id u want to search:</b>
<input type="text"name="id"/>
<br/>
<br/>
</td></tr>
</table>
<center>
<input type="submit"value="submit"/>
<input type="reset"value="reset"/>
</form>
</body>
</html>
searchstudinfo.jsp
<%@page...
Read more »
Posted by TechBlogger on 7:59 PM

upstud.jsp
<%@page session="true"import="java.io.*"%>
<html>
<body bgcolor="#d0d0d0">
<br></br>
<br></br>
<br></br>
<h2><center>enter stuent details</center></h2>
<form name="upstud"action="upstudinfo.jsp"method="post">
<table border="2"align=center>
<tr><td>
<b>student name:</b>
<input type="text"name="name"/>
<br/>
<br/>
</td></tr>
<tr><td>
<b>id:</b>
<input type="text"name="id"/>
<br/>
<br/>
</td></tr>
<tr><td>
<b>age:</b>
<input...
Read more »
Posted by TechBlogger on 7:51 PM

delstud.jsp
<%@page session="true"import="java.io.*"%>
<html>
<body bgcolor="#d0d0d0">
<br></br>
<br></br>
<br></br>
<h2><center>enter stuent details</center></h2>
<form name="delstud"action="delstudinfo.jsp"method="post">
<table border="2"align=center>
<tr><td>
<b>id:</b>
<input type="text"name="id"/>
<br/>
<br/>
</td></tr>
</table>
<center>
<input type="submit"value="submit"/>
<input type="reset"value="reset"/>
<input type="button"value="delete"/>
</form>
</body>
</html>
delstudinfo.jsp
<%@page...
Read more »
Posted by TechBlogger on 7:45 PM

JSP is widely used Java based server side scripting language . Here in this tutorial I am going to give you code which will post data from a html form. before you run through code ensure that the tomcat server is installed or you can download it directly from the official website also download and install Microsoft server 2000.Go to the database console and
1.Create database named "student1".
2.Create table with four fields NAME,ID,AGE and BRANCH , keep ID as primary key.
First we began with creating a html form. For consideration here we are going to create a form for entering student details such as NAME,ID,AGE and BRANCH....
Read more »
Posted by TechBlogger on 10:26 AM

The Animation program is Rolling Ball over a horizontal line . The ball start rolling at the start of the line and moves till the end of line length.The program is implemented using C++ MS Visual studio , MFC application.
PROGRAM:
void CAnimation1View::OnDraw(CDC* pDC)
{
CAnimation1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
POINT ball[2]={25,150,75,100};
pDC->Ellipse(ball[0].x,ball[0].y,ball[1].x,ball[1].y);
for(int i=0;i<600;i++)
{
pDC->FloodFill(50,50,RGB(100,100,100));
p...
Read more »
Posted by TechBlogger on 10:18 AM

Basic Computer Animation Program using MS Visual Studio 6.0 with MFC application.Here in this program we make use of flood fill concept . The function is very simple indicating just coordinates which has to be displayed on the screen.
PROGRAM:
void CBouncingballView::OnDraw(CDC* pDC)
{
CBouncingballDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
POINT ball[2]={25,150,75,100};
pDC->Ellipse(ball[0].x,ball[0].y,ball[1].x,ball[1].y);
for(int k=0;k<600;k++)
{
pDC->FloodFill(50,50,RGB(100,100,100));
pDC->MoveTo(10,150);
pDC->LineTo(600,150);
for(int i=0;i<250;i++)
{
for(int...
Read more »
Posted by TechBlogger on 10:08 AM

This Program illustrates how to draw a circle without using the direct function. The Program is written in C++ language using Microsoft Developer Studio , Format Version 6.00.This part of programming belongs to basic Computer graphics.Use MS visual studio 6.0 with MFC application.
PROGRAM:
#include "stdafx.h"
#include "ellipse.h"
#include "ellipseDoc.h"
#include "ellipseView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
#define ROUND(a)((int)(a+0.5))
static char THIS_FILE[] = __FILE__;
#endif
void ellipseMidPoint(int Xcenter,int Ycenter,int Rx,int Ry,CDC* pDC,COLORREF color)
{
int...
Read more »
Posted by TechBlogger on 9:47 AM
INTRODUCTION:
In the missionaries and cannibals problem(AI), three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries.) The boat cannot cross the river by itself with no people on board.The Program is implemented using C++ Programming language.
PROGRAM:
#include<iostream>
#include<list>
#include<stack>
using namespace std;
struct StateSTR
{
int Mlhs; //nr missionaries on LHS of river
int Clhs; //nr cannibals on LHS of river
...
Read more »