Skip to content

Commit

Permalink
exp 5,6,7,8
Browse files Browse the repository at this point in the history
  • Loading branch information
AkashKobal committed Apr 27, 2024
1 parent ce5bcb2 commit 1b2e2be
Show file tree
Hide file tree
Showing 144 changed files with 1,952 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions EXPERIMENT 5/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/apache-tomcat-10.0.27">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="C:/Users/Admin/Downloads/mysql-connector-j-8.3.0/mysql-connector-j-8.3.0/mysql-connector-j-8.3.0.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
31 changes: 31 additions & 0 deletions EXPERIMENT 5/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Experiment 5</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
12 changes: 12 additions & 0 deletions EXPERIMENT 5/.settings/.jsdtscope
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/node_modules/*|**/*.min.js|**/bower_components/*" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
2 changes: 2 additions & 0 deletions EXPERIMENT 5/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
10 changes: 10 additions & 0 deletions EXPERIMENT 5/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
8 changes: 8 additions & 0 deletions EXPERIMENT 5/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="Experiment 5">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<property name="context-root" value="Experiment_5"/>
<property name="java-output-path" value="/Experiment 5/build/classes"/>
</wb-module>
</project-modules>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="apache-tomcat-10.0.27"/>
<fixed facet="java"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="jst.web"/>
<installed facet="java" version="17"/>
<installed facet="jst.web" version="5.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Window
Binary file not shown.
Binary file not shown.
75 changes: 75 additions & 0 deletions EXPERIMENT 5/src/main/java/DispData/DispData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package DispData;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;

@WebServlet("/DispData")
public class DispData extends HttpServlet {
private static final long serialVersionUID = 1L;

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try{
String rno=request.getParameter("rollno");
int rn=Integer.valueOf(rno);
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3308/module2","root","Akash@123");
PreparedStatement ps=con.prepareStatement("select * from studentMarks where rollno=?");
ps.setInt(1,rn);
out.print("<table width=50% border=1 ");
out.print("<caption>Result:</caption>");
ResultSet rs=ps.executeQuery();
/* Printing column names */
ResultSetMetaData rsmd=rs.getMetaData();
int total=rsmd.getColumnCount();
out.print("<tr>");
for(int i=1;i<=total;i++)
{
out.print("<th>"+rsmd.getColumnName(i)+"</th>");
}
out.print("<th>Status</th></tr>");
/* Printing result */
while(rs.next())
{
out.print("<tr><td>"+rs.getInt(1)+
"</td><td>"+rs.getString(2)+
"</td><td>"+rs.getString(3)+
"</td><td>"+rs.getInt(4)+
"</td><td>" + rs.getInt(5)+
"</td><td>" + rs.getInt(6)+
"</td><td>"+ rs.getInt(7)+
"</td><td>" + rs.getInt(8)+
"</td><td>"+ rs.getInt(9)+
"</td><td>"+ rs.getInt(10)+
"</td><td>"+rs.getInt(11)+
"</td>");


if(rs.getInt(4)>=40 && rs.getInt(5)>=40 && rs.getInt(6)>=40 && rs.getInt(7)>=40 && rs.getInt(8)>=40 && rs.getInt(9)>=40 && rs.getInt(10)>=40 && rs.getInt(11)>=40)
{
out.print("<td>Pass</td>");
} else {
out.print("<td>Fail</td><tr>");
}
}
out.print("</table>");
}catch (Exception e2) {e2.printStackTrace();}
finally{out.close();}
}
}




51 changes: 51 additions & 0 deletions EXPERIMENT 5/src/main/java/InsertData/InsertData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package InsertData;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

/**
* Servlet implementation class InsertData
*/
@WebServlet("/InsertData")
public class InsertData extends HttpServlet {
private static final long serialVersionUID = 1L;

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3308/module2","root","Akash@123");
PreparedStatement st = con.prepareStatement("insert into studentMarks values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");


st.setInt(1, Integer.valueOf(request.getParameter("rollno")));
st.setString(2, request.getParameter("name"));
st.setString(3, request.getParameter("section"));
st.setInt(4, Integer.valueOf(request.getParameter("sub1")));
st.setInt(5, Integer.valueOf(request.getParameter("sub2")));
st.setInt(6, Integer.valueOf(request.getParameter("sub3")));
st.setInt(7, Integer.valueOf(request.getParameter("sub4")));
st.setInt(8, Integer.valueOf(request.getParameter("sub5")));
st.setInt(9, Integer.valueOf(request.getParameter("sub6")));
st.setInt(10, Integer.valueOf(request.getParameter("lab1")));
st.setInt(11, Integer.valueOf(request.getParameter("lab2")));

st.executeUpdate();
st.close();
con.close();
PrintWriter out = response.getWriter();
out.println("<html><body><b>Successfully Inserted"
+ "</b></body></html>");
}catch(Exception e){
System.out.println(e);}
}
}

54 changes: 54 additions & 0 deletions EXPERIMENT 5/src/main/webapp/Insert.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<form action="./InsertData" method="post">
<table>
<tr><td>Enter Roll No:</td>
<td><input type="text" name="rollno"/></td>
</tr>
<tr><td>Enter Name:</td>
<td><input type="text" name="name"/></td>
</tr>
<tr><td>Enter Section:</td>
<td><select name="section">
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select>
</td>
</tr>
<tr><td>Enter Subjet1 Mark:</td>
<td><input type="text" name="sub1"/></td>
</tr>
<tr><td>Enter Subject2 Mark:</td>
<td><input type="text" name="sub2"/></td>
</tr>
<tr><td>Enter Subjet3 Mark:</td>
<td><input type="text" name="sub3"/></td>
</tr>
<tr><td>Enter Subject4 Mark:</td>
<td><input type="text" name="sub4"/></td>
</tr>
<tr><td>Enter Subject5 Mark:</td>
<td><input type="text" name="sub5"/></td>
</tr>
<tr><td>Enter Subject6 Mark:</td>
<td><input type="text" name="sub6"/></td>
</tr>
<tr><td>Enter Lab1 Mark:</td>
<td><input type="text" name="lab1"/></td>
</tr>
<tr><td>Enter Lab2 Mark:</td>
<td><input type="text" name="lab2"/></td>
</tr>
<tr><td><input type="submit"/></td></tr>
</table>
</form>
</body>
</html>
3 changes: 3 additions & 0 deletions EXPERIMENT 5/src/main/webapp/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

15 changes: 15 additions & 0 deletions EXPERIMENT 5/src/main/webapp/Search.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="./DispData" >
Enter your Roll No:<input type="text" name="rollno"/><br/>
<input type="submit" value="search"/>
</form>
</body>
</html>
Binary file not shown.
18 changes: 18 additions & 0 deletions EXPERIMENT 6/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/apache-tomcat-10.0.27">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="C:/Users/Admin/Downloads/mysql-connector-j-8.3.0/mysql-connector-j-8.3.0/mysql-connector-j-8.3.0.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
31 changes: 31 additions & 0 deletions EXPERIMENT 6/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Experiment 6</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
12 changes: 12 additions & 0 deletions EXPERIMENT 6/.settings/.jsdtscope
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/node_modules/*|**/*.min.js|**/bower_components/*" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
2 changes: 2 additions & 0 deletions EXPERIMENT 6/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
10 changes: 10 additions & 0 deletions EXPERIMENT 6/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
8 changes: 8 additions & 0 deletions EXPERIMENT 6/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="Experiment 6">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<property name="context-root" value="Experiment_6"/>
<property name="java-output-path" value="/Experiment 6/build/classes"/>
</wb-module>
</project-modules>
Loading

0 comments on commit 1b2e2be

Please sign in to comment.