Triveni IT Academy

Triveni IT Academy IGNOU : Solved Assignment, Project, and other help
GATE : solved questions and other help
SSC : solved questions and other Questions. IT, CS project

05/02/2017

Hello student's gud news to all,
Triveni IT Academy launch online portal through youtube

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. Differentiate Inline stylesheet and Embedded stylesheet.
Ans. : To add CSS styles to your website, you can use three different ways to insert the CSS. You can Use an "External Stylesheet", an "Internal Stylesheet", or in "Inline Style". The benefit for using each depends on what you are doing with the Style.The following table explains the difference between them

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. Details and Summary tag
Ans. : Using the Details and Summary Elements

The and elements are used in combination to create a UI widget that allows the user to find out more information about a topic by clicking on a summary.

A simple details and summary element example.
A simple details and summary element example.

The element is responsible for marking up all of the content relevant to the particular topic. The element is used to specify a short piece of text that describes the rest of the content in the element.


Summary text
Content goes here...

By default, the browser will only display the content within the element to the user. Once this summary is clicked, the remaining content will become visible.

The browser will use the text from the first element within the element when constructing the widget. If no element is specified, the browser will simply display “Details.”

If you’d like the widget to be open when the page loads, you can specify the open attribute on your element.
..
The browser will toggle the open attribute for you as the user opens and closes the widget.

So what kind of content should you be using the and elements for? Simply, any additional information you’d like to provide about a subject. For example, you could use these elements for marking up order data within an e-commerce app. In the following example, the user is presented with an order number that, when clicked, will reveal the full information about the order.

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Ans. : SVG is an earlier standard for drawing shapes in browsers. However, SVG is at a fundamentally higher level because each drawn shape is remembered as an object in a scene graph or DOM, which is subsequently rendered to a bit map. This means that if attributes of an SVG object are changed, the browser can automatically re-render the scene.

In the example above, once the rectangle is drawn, the fact that it was drawn is forgotten by the system. If its position were to be changed, the entire scene would need to be redrawn, including any objects that might have been covered by the rectangle. But in the equivalent SVG case, one could simply change the position attributes of the rectangle and the browser would determine how to repaint it. It is also possible to paint a canvas in layers and then recreate specific layers.

SVG images are represented in XML, and complex scenes can be created and maintained with XML editing tools.

The SVG scene graph enables event handlers to be associated with objects, so a rectangle may respond to an onClick event. To get the same functionality with canvas, one must manually match the coordinates of the mouse click with the coordinates of the drawn rectangle to determine whether it was clicked.

Conceptually, canvas is a lower level protocol upon which SVG might be built.[citation needed] However, this is not (normally) the case—they are independent standards. The situation is complicated because there are scene graph libraries for Canvas, and SVG has some bit map manipulation functionality.

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
[12:31 PM, 12/18/2016] +91 88604 68870: Q. Web widget and Desktop widget
[12:31 PM, 12/18/2016] +91 88604 68870: Ans. : Main Difference

It feels that word synonym has no place on internet. The terms which looked same about few years ago are now recognized separately. Take the example of Gadget and Widget both have same functions but with the passage of time becoming different from each other.

Gadget

gadgetAt present there is no common definition of Gadget. Keeping in view the functions and features we can define that Gadget is a graphical tool, which works on limited websites with the help of a specific code. It is available in different form. You can use it both for website and desktop. It works with the help of code, which is necessary to collect the all relevant information to run the program. Most gadgets works on a specific website because their code is especially developed for limited or specific blogs and websites. Your system clock, local weather application and PC performance bar on desktop all are kinds of gadget.

Widget

widgetWidget is an application, software or icon, which performs a specific online functions when operated by a desktop computer, tablet or smart phone. It is a form of code, which can be used on any HTML supporting website. Like if you want to add counter, Facebook , Twitter or YouTube icon all you can do by a code, which will automatically generates all these on your blog or websites. And you can called them widget. A program that tells you about your system performance, security, battery life, Facebook notification of like, comment, message and friend requests are best examples of widget.

Key Difference

Gadgets are mostly operated on a specific website like Google gadgets is controlled by affiliated Google websites where as Web Widgets can easily handled by any website or blog.
Widgets are larger applications than Gadgets because they execute more programs than Gadgets.
Gadgets are incomplete without Widgets. More Gadgets demands for Widgets to run and perform properly.
Widgets are mostly designed to show information on your websites while Gadgets are developed and used for desktop applications.
DesktopX software is required for Widgets to run properly while there is no such requirement of any software for Gadgets and you can share it to Window XP users as well.

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. Write a JavaScript program to accept the first, middle, last names of the students and print them.
Ans. : // strings.js
// This script takes a name and spits out its character length with initials.

// Function called when the form is submitted.
// Function performs the calculation and returns false.
function formatNames() {
'use strict';

// For storing the Full Name, Middle name, initials, length:
var lengthName;
var middleName;
var yourInitials;

// Get a reference to the form values:
var fullName = document.getElementById('fullName').value;

// Perform the character spit out:
lengthName = fullName.length;

// Pull out the middle name:

// Display the volume:
document.getElementById('nameLength').value = lengthName;

// Return false to prevent submission:
return false;

} // End of formatNames() function.

// Function called when the window has been loaded.
// Function needs to add an event listener to the form.
function init() {
'use strict';
document.getElementById('theForm').onsubmit = formatNames;
} // End of init() function.
window.onload = init;

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. Create a WML program which should include a table, an image, a text paragraph and any two WML input elements.
Ans. : WML : Wireless Markup Language (WML), based on XML, is a markup language intended for devices that implement the Wireless Application Protocol (WAP) specification, such as mobile phones.

WML - Overview
The topmost layer in the WAP (Wireless Application Protocol) architecture is made up of WAE (Wireless Application Environment), which consists of WML and WML scripting language.

WML stands for Wireless Markup Language

WML is an application of XML, which is defined in a document-type definition.

WML is based on HDML and is modified so that it can be compared with HTML.

WML takes care of the small screen and the low bandwidth of transmission.

WML is the markup language defined in the WAP specification.

WAP sites are written in WML, while web sites are written in HTML.

WML is very similar to HTML. Both of them use tags and are written in plain text format.

WML files have the extension ".wml". The MIME type of WML is "text/vnd.wap.wml".

WML supports client-side scripting. The scripting language supported is called WMLScript.

WML Program Structure:
Following is the basic structure of a WML program:








This is the first card in the deck





Ths is the second card in the deck



18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. Assume that there is a table which contains field names such as name, programme, course code and grade. Write a program using JSP and JDBC to insert records into the database.
Ans. : Write a code in JSP to insert a record in product table with fields: prod_d id, prod_name, quantity, price. Assuming that product table is create in MS-Access database. MCS51-june09-1b

JSP code



0){
out.write("Records inserted");
}else{
out.write("insertion faild");
}
}catch(Exception e){
out.write("Exception : "+e);
}
%>

JAVA Codes

import java.sql.*;
class Insert2{
public static void main(String ar[]){
int prod_id=2;
String prod_name="Laptop";
int qty=2;
float price=22000.30f;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:NaveenRahul");
Statement st=con.createStatement();
String query="insert into product values("+prod_id+",'"+prod_name+"',"+qty+","+price+")";
if(st.executeUpdate(query)>0){
System.out.println("Records inserted");
}else{
System.out.println("insertion faild");
}
con.close();
}catch(Exception e){
System.out.println("Exception : "+e);
}
}
}

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. What are JDBC Driver(s) ? Name them and differentiate between Two and Three tier database access.
Ans. : JDBC Driver : A driver is nothing but software required to connect to a database from Java program. JDBC is just an API, which Java has designed and onus to implement this API lies on different vendor because different database works in a different way, they internally use different protocols.

One of the oldest Java interview question is what is the difference between different types of JDBC drivers e.g. what is the difference between type 1, type 2, type 3 or type 4 drivers? Sometimes also asked as how do you choose between different JDBC driver? When to use type 3 over type 4 driver etc. It's 2015 now and I doubt anyone is using JDBC driver other than type 4 for connecting to database, but let's see how to answer this question when you face it during the interview. The difference between different types of JDBC driver comes from the fact how they work, which is basically driven by two factors, portability, and performance. Type 1 JDBC driver is the poorest in terms of portability and performance while type 4 JDBC driver is highly portable and gives the best performance. You will learn more differences between different JDBC drivers as we go along.

Since the database is very important and almost all Java application uses the database in some form or other, it's important to learn JDBC well. If you are a beginner started to learn Java and struggling with JDBC then I suggest you to take a look at Practical Database Programming with Java By Ying Bai. It's one of the rarest book, which covers Java database connectivity well,

18/12/2016

BCA 6th Sem.
BCS-053 some solved questions.
Q. What are cookies ? Write a program to create cookies to store User ID and password of the client on his/her machine.
[12:27 PM, 12/18/2016] +91 88604 68870: Ans. : Cookies : Cookies are text files stored on the client computer and they are kept for various information tracking purpose. Java Servlets transparently supports HTTP cookies. There are three steps involved in identifying returning users: Server script sends a set of cookies to the browser

Cookies are text files stored on the client computer and they are kept for various information tracking purpose. Java Servlets transparently supports HTTP cookies.

There are three steps involved in identifying returning users:

Server script sends a set of cookies to the browser. For example name, age, or identification number etc.

Browser stores this information on local machine for future use.

When next time browser sends any request to web server then it sends those cookies information to the server and server uses that information to identify the user.

This chapter will teach you how to set or reset cookies, how to access them and how to delete them.

The Anatomy of a Cookie:
Cookies are usually set in an HTTP header (although JavaScript can also set a cookie directly on a browser). A servlet that sets a cookie might send headers that look something like this:

HTTP/1.1 200 OK
Date: Fri, 04 Feb 2000 21:03:38 GMT
Server: Apache/1.3.9 (UNIX) PHP/4.0b3
Set-Cookie: name=xyz; expires=Friday, 04-Feb-07 22:03:38 GMT;
path=/; domain=tutorialspoint.com
Connection: close
Content-Type: text/html
As you can see, the Set-Cookie header contains a name value pair, a GMT date, a path and a domain. The name and value will be URL encoded. The expires field is an instruction to the browser to "forget" the cookie after the given time and date.

If the browser is configured to store cookies, it will then keep this information until the expiry date. If the user points the browser at any page that matches the path and domain of the cookie, it will resend the cookie to the server. The browser's headers might look something like this:

GET / HTTP/1.0
Connection: Keep-Alive
User-Agent: Mozilla/4.6 (X11; I; Linux 2.2.6-15apmac ppc)
Host: zink.demon.co.uk:1126
Accept: image/gif, /
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
Cookie: name=xyz
A servlet will then have access to the cookie through the request method request.getCookies() which returns an array of Cookie objects.

Servlet Cookies Methods:
Following is the list of useful methods which you can use while manipulating cookies in servlet.

S.N. Method & Description
1
public void setDomain(String pattern)

This method sets the domain to which cookie applies, for example tutorialspoint.com.

2
public String getDomain()

This method gets the domain to which cookie applies, for example tutorialspoint.com.

3
public void setMaxAge(int expiry)

This method sets how much time (in seconds) should elapse before the cookie expires. If you don't set this, the cookie will last only for the current session.

4
public int getMaxAge()

This method returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist until browser shutdown.

5
public String getName()

This method returns the name of the cookie. The name cannot be changed after creation.

6
public void setValue(String newValue)

This method sets the value associated with the cookie.

7
public String getValue()

This method gets the value associated with the cookie.

8
public void setPath(String uri)

This method sets the path to which this cookie applies. If you don't specify a path, the cookie is returned for all URLs in the same directory as the current page as well as all subdirectories.

9
public String getPath()

This method gets the path to which this cookie applies.

10
public void setSecure(boolean flag)

This method sets the boolean value indicating whether the cookie should only be sent over encrypted (i.e. SSL) connections.

11
public void setComment(String purpose)

This method specifies a comment that describes a cookie's purpose. The comment is useful if the browser presents the cookie to the user.

12
public String getComment()

This method returns the comment describing the purpose of this cookie, or null if the cookie has no comment.
[12:27 PM, 12/18/2016] +91 88604 68870: Ex. Example:
Let us modify our Form Example to set the cookies for first and last name.

// Import required java libraries
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

// Extend HttpServlet class
public class HelloForm extends HttpServlet {

public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
// Create cookies for first and last names.
Cookie firstName = new Cookie("first_name",
request.getParameter("first_name"));
Cookie lastName = new Cookie("last_name",
request.getParameter("last_name"));

// Set expiry date after 24 Hrs for both the cookies.
firstName.setMaxAge(60*60*24);
lastName.setMaxAge(60*60*24);

// Add both the cookies in the response header.
response.addCookie( firstName );
response.addCookie( lastName );

// Set response content type
response.setContentType("text/html");

PrintWriter out = response.getWriter();
String title = "Setting Cookies Example";
String docType =
"\n";
out.println(docType +
"\n" +
"" + title + "\n" +
"\n" +
"" + title + "\n" +
"\n" +
" First Name: "
+ request.getParameter("first_name") + "\n" +
" Last Name: "
+ request.getParameter("last_name") + "\n" +
"\n" +
"");
}
}

Address

Vikrantgoel1991@gmail. Com
Delhi
110035

Telephone

+918860468870

Website

Alerts

Be the first to know and let us send you an email when Triveni IT Academy posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Business

Send a message to Triveni IT Academy:

Share