Skip to content

Commit

Permalink
labsheets update;
Browse files Browse the repository at this point in the history
  • Loading branch information
AkashKobal committed Jun 24, 2024
1 parent e8528c9 commit bdd87df
Show file tree
Hide file tree
Showing 51 changed files with 787 additions and 0 deletions.
18 changes: 18 additions & 0 deletions labsheet5/.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/Desktop/Java Full Stack Web Developement GitHub/mysql-connector-j-8.3.0.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
43 changes: 43 additions & 0 deletions labsheet5/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>labsheet5</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.jboss.tools.jst.web.kb.kbbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.jboss.tools.cdi.core.cdibuilder</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.jboss.tools.jst.web.kb.kbnature</nature>
<nature>org.jboss.tools.cdi.core.cdinature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
12 changes: 12 additions & 0 deletions labsheet5/.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 labsheet5/.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 labsheet5/.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 labsheet5/.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="labsheet5">
<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="labsheet5"/>
<property name="java-output-path" value="/labsheet5/build/classes"/>
</wb-module>
</project-modules>
10 changes: 10 additions & 0 deletions labsheet5/.settings/org.eclipse.wst.common.project.facet.core.xml
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="jst.web"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="java"/>
<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
1 change: 1 addition & 0 deletions labsheet5/.settings/org.eclipse.wst.jsdt.ui.superType.name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Window
Binary file added labsheet5/build/classes/DispData/DispData.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
66 changes: 66 additions & 0 deletions labsheet5/src/main/java/DispData/DispData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package DispData;

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;

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 jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;

/**
* Servlet implementation class 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/god","root","Akash@123");
PreparedStatement ps=con.prepareStatement("select * from mark 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)+ 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><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>"+"</td></tr>");
else
out.print("<td>Fail</td>"+"</td></tr>");
}
out.print("</table>");
}catch (Exception e2) {e2.printStackTrace();}
finally{out.close();}
}



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

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Servlet implementation class 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/god","root","Akash@123");
PreparedStatement st = con.prepareStatement("insert into mark 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);}
}
}

10 changes: 10 additions & 0 deletions labsheet5/src/main/java/InsertDataa/InsertDataa.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package InsertDataa;

import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;

public class InsertDataa extends HttpServlet {
private static final long serialVersionUID = 1L;


}
30 changes: 30 additions & 0 deletions labsheet5/src/main/webapp/Insert.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%@ 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"><br>
<input type="text" name="rollno" placeholder="Roll No:"/><br>
<input type="text" name="name" placeholder="Enter Name:"/><br>

Enter Section:<select name="section"> <br>
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select><br>
<input type="text" name="sub1" placeholder="Enter Subject 1 Mark:"/><br>
<input type="text" name="sub2" placeholder="Enter Subject 2 Mark:"/><br>
<input type="text" name="sub3" placeholder="Enter Subject 3 Mark:"/><br>
<input type="text" name="sub4" placeholder="Enter Subject 4 Mark:"/><br>
<input type="text" name="sub5" placeholder="Enter Subject 5 Mark:"/><br>
<input type="text" name="sub6" placeholder="Enter Subject 6 Mark:"/><br>
<input type="text" name="lab1" placeholder="Enter Lab 1 Mark:"/><br>
<input type="text" name="lab2" placeholder="Enter Lab 2 Mark:"/><br>
<input type="submit"/><br>
</form>
</body>
</html>
3 changes: 3 additions & 0 deletions labsheet5/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 labsheet5/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">
<input type="text" name="rollno" placeholder="Enter your Roll No:"/><br/>
<input type="submit" value="search"/>
</form>
</body>
</html>
Binary file not shown.
42 changes: 42 additions & 0 deletions labsheet5/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://jakarta.ee/xml/ns/jakartaee" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" version="5.0">
<servlet>
<description></description>
<display-name>InsertData</display-name>
<servlet-name>InsertData</servlet-name>
<servlet-class>InsertData.InsertData</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>InsertData</servlet-name>
<url-pattern>/InsertData</url-pattern>
</servlet-mapping>
<display-name>labsheet5</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<display-name>DispData</display-name>
<servlet-name>DispData</servlet-name>
<servlet-class>DispData.DispData</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DispData</servlet-name>
<url-pattern>/DispData</url-pattern>
</servlet-mapping>
<servlet>
<description></description>
<display-name>InsertDataa</display-name>
<servlet-name>InsertDataa</servlet-name>
<servlet-class>InsertDataa.InsertDataa</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>InsertDataa</servlet-name>
<url-pattern>/InsertDataa</url-pattern>
</servlet-mapping>
</web-app>
18 changes: 18 additions & 0 deletions labsheet6/.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/Desktop/Java Full Stack Web Developement GitHub/mysql-connector-j-8.3.0.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
43 changes: 43 additions & 0 deletions labsheet6/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>labsheet6</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.jboss.tools.jst.web.kb.kbbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.jboss.tools.cdi.core.cdibuilder</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.jboss.tools.jst.web.kb.kbnature</nature>
<nature>org.jboss.tools.cdi.core.cdinature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
Loading

0 comments on commit bdd87df

Please sign in to comment.