0% found this document useful (0 votes)
2 views5 pages

Java Scheme

The document outlines the Continuous Internal Evaluation Scheme for the Advanced Java course at Vivekananda College of Engineering & Technology for the academic year 2024-25. It includes a series of programming tasks and questions related to Java, JSP, JDBC, and servlets, along with their respective marks and learning outcomes. The document serves as a guideline for evaluating students' understanding and practical skills in advanced Java programming concepts.

Uploaded by

dattebayo9012
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Java Scheme

The document outlines the Continuous Internal Evaluation Scheme for the Advanced Java course at Vivekananda College of Engineering & Technology for the academic year 2024-25. It includes a series of programming tasks and questions related to Java, JSP, JDBC, and servlets, along with their respective marks and learning outcomes. The document serves as a guideline for evaluating students' understanding and practical skills in advanced Java programming concepts.

Uploaded by

dattebayo9012
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Vivekananda College of Engineering & Technology CRM09

[A Unit of Vivekananda Vidyavardhaka Sangha, Puttur ®] Rev 1.6


Affiliated to Visvesvaraya Technological University <CS>
Approved by AICTE New Delhi & Govt of Karnataka <30/05/25>

CONTINUOUS INTERNAL EVALUATION– 2 : SCHEME OF EVALUATION

Academic Year- 2024-25


Dept:CSE Sem / Div: 6 CS A&B Sub: Advanced Java Sub Code: BCS613D
Date: 29/05/2025 Time:09:30-11:00 AM Max Marks: 50 Elective: Y
-
QN Answers/ Solutions Marks RBT COs
1 a Develop a program to create a JTextField, generate an action 4 L3 CO2
event when the user presses enter.
public class JTextFieldDemo extends JApplet {
JTextField jtf;
public void init() {
try {
[Link]( new Runnable() {
public void run() {
makeGUI(); } } );
} catch (Exception exc) {
[Link]("Can't create because of " + exc);
}
}
private void makeGUI() { 4
setLayout(new FlowLayout());
jtf = new JTextField(15);
add(jtf);
[Link](new ActionListener() {
public void actionPerformed(ActionEvent ae) {
showStatus([Link]()); } }); } }
b List and explain core classes and interfaces in [Link] L2 CO3
package.
Interfaces : 1
Servlet
ServletConfig
ServletContext
ServletRequest
ServletResponse
Classes:
GenericServlet
ServletInputStream
ServletOutputStream
ServletException
UnavailableException 8
explanation
c Develop a program to handle HTTP get requests and HTTP post L3 CO3
requests. HTML code:
<html>
<body> 4
<center>
Vivekananda College of Engineering & Technology CRM09
[A Unit of Vivekananda Vidyavardhaka Sangha, Puttur ®] Rev 1.6
Affiliated to Visvesvaraya Technological University <CS>
Approved by AICTE New Delhi & Govt of Karnataka <30/05/25>

CONTINUOUS INTERNAL EVALUATION– 2 : SCHEME OF EVALUATION


<form name="Form1" method="post"
action="[Link]
servlet/PostParametersServlet"> <table>
<tr>
<td><B>Employee</td>
<td><input type=textbox name="e" size="25"
value=""></td>
</tr>
<tr>
<td><B>Phone</td>
<td><input type=textbox name="p" size="25"
value=""></td>
</tr>
</table>
<input type=submit value="Submit">
</body>
</html>
[Link]
import [Link].*; 4
import [Link].*;
import [Link].*;
public class PostParametersServlet
extends GenericServlet {
public void service(ServletRequest request,
ServletResponse response)
throws ServletException, IOException {
// Get print writer.
PrintWriter pw = [Link]();
// Get enumeration of parameter names.
Enumeration e = [Link]();
// Display parameter names and values.
while([Link]()) {
String pname = (String)[Link]();
[Link](pname + " = ");
String pvalue = [Link](pname);
[Link](pvalue);
}
[Link]();
}}

2 a Develop a program to demonstrate JToggleButton. L3 CO2

public void init() {


try {
[Link]( 4
new Runnable() {
public void run() {
makeGUI(); } } );
Vivekananda College of Engineering & Technology CRM09
[A Unit of Vivekananda Vidyavardhaka Sangha, Puttur ®] Rev 1.6
Affiliated to Visvesvaraya Technological University <CS>
Approved by AICTE New Delhi & Govt of Karnataka <30/05/25>

CONTINUOUS INTERNAL EVALUATION– 2 : SCHEME OF EVALUATION


} catch (Exception exc) {
[Link]("Can't create because of " + exc); } }
private void makeGUI() {
setLayout(new FlowLayout()); 4
jlab = new JLabel("Button is off.");
jtbn = new JToggleButton("On/Off");
[Link](new ItemListener() {
public void itemStateChanged(ItemEvent ie) {
if([Link]())
[Link]("Button is on.");
else
[Link]("Button is off.");
} });
add(jtbn);
add(jlab); } }
b Explain different types of JSP tags by taking suitable example. 1 L2 CO3
Comment tag: A comment tag opens with<%--and closes with
--%>, 8
Declaration statement tags : A declaration statement tag
opens with <%! and is followed by a Java declaration
statement(s) that define variables, objects, and methods that
are available to other components of the JSP program .
A directive tag opens with <%@ and closes with %>.
Expression tags An expression tag opens with <%= and is
used for an expression statement.
Scriptlet tags A scriptlet tag opens with <% and contains
commonly used Java control statements and loops. A scriptlet
tag closes with%>.
c Develop a program to show how to define and call methods 8 L3 CO3
using JSP tags.

<HTML>
<HEAD>
<TITLE> JSP Programming </TITLE>
</HEAD>
<BODY>
<%! boolean curve)int grade)
{
return 10+grade;
}
%>
<P> Your curved grade is: <%=curve(80) %> </P>
</BODY>
</HTML>
3 a Explain the various steps of JDBC process. 8 L2 CO4
1. Loading the JDBC driver
2. Connecting to the DBMS
3. Creating and executing a statement
Vivekananda College of Engineering & Technology CRM09
[A Unit of Vivekananda Vidyavardhaka Sangha, Puttur ®] Rev 1.6
Affiliated to Visvesvaraya Technological University <CS>
Approved by AICTE New Delhi & Govt of Karnataka <30/05/25>

CONTINUOUS INTERNAL EVALUATION– 2 : SCHEME OF EVALUATION


4. Processing data returned by the DBMS
5. Terminating the connection with the DBMS
Explain in detail.
b Develop a program to demonstrate prepared statement object. L3 CO4
The query directs the DBMS to return an customer information
where the customer number equals the customer number
specified in the query. 7
try {
String query= “SELECT *FROM Customers WHERE
CustNumber=?”;
PreparedStatement pstatement=[Link](query);
[Link](1,”123”);
Results=[Link]();
[Link]();
} 2
output
c Develop a program to display four checkboxes and generate the L3 CO2
item event when the user clicks a check box
private void makeGUI() {
setLayout(new FlowLayout()); 4
JCheckBox cb = new JCheckBox("C");
[Link](this);
add(cb);
cb = new JCheckBox("C++");
[Link](this);
add(cb);
}
public void itemStateChanged(ItemEvent ie) { J
CheckBox cb = (JCheckBox)[Link]();
if([Link]()) 4
[Link]([Link]() + " is selected");
else
[Link]([Link]() + " is cleared");
}
}
Add four checkboxes .
4 a Explain the steps for Associating the JDBC/ODBC Bridge with L2 CO4
the Database.
[Link] Start | Settings, and then the Control Panel. 8
2. Select ODBC 32 to display the ODBC Data Source
Administrator.
3. Add a new user by selecting the Add button.
4. Select the driver then select Finish.
5. Enter the name of the database
6. Enter a description for the data source
7. Click the Select button and locate the database.
8. click the Advanced button to display the Set Advanced
Options dialog box.
Vivekananda College of Engineering & Technology CRM09
[A Unit of Vivekananda Vidyavardhaka Sangha, Puttur ®] Rev 1.6
Affiliated to Visvesvaraya Technological University <CS>
Approved by AICTE New Delhi & Govt of Karnataka <30/05/25>

CONTINUOUS INTERNAL EVALUATION– 2 : SCHEME OF EVALUATION


9. When the ODBC Microsoft Access Setup dialog box appears,
select OK.
10. Select OK to close the ODBC Data Source Administrator
dialog box.
b Develop a program to demonstrate Scrollable ResultSet. L3 CO4
try {
String query= “SELECT FirstName, LastName FROM 4
Customers”;
DataRequest= Db.
createStatement(TYPE_SCROLL_INSENSITIVE);
Results= [Link](query);
}
This enables the use of virtual cursor control methods .
try {
do {
[Link](); 5
[Link]();,
[Link]() ;
[Link](l0);
[Link](-2);
[Link](2) ;
FirstName= [Link](1);
LastName= Results. getString(2);
FirstName= [Link](1);
LastName= Results. getString(2);
printrow= FirstName+ “ “+LastName;
[Link](printrow);
} while([Link]());
[Link]();
}
c Develop a program to generate a JScrollPane consisting of 400 L3 CO2
buttons arranged into 20 columns.
private void makeGUI() {
JPanel jp = new JPanel();
[Link](new GridLayout(20, 20));
int b = 0; 4
for(int i = 0; i < 20; i++) {
for(int j = 0; j < 20; j++) {
[Link](new JButton("Button " + b)); ++b;
}}
JScrollPane jsp = new JScrollPane(jp); 4
add(jsp, [Link]); } }

Prepared by: Shreeja M HOD

You might also like