Posts

Showing posts from October, 2021

JSP With JDBC

login.html      <html> <body>     <form action="http://localhost/Hello/login.jsp" method="GET">         <table border="1">             <tr>                 <th colspan="2">                     Login Page with JSP                 </th>             </tr>             <tr>                 <td>                     Name :                 </td>                 <td>                     <input type="text" name="nm" value="">                 </td>             </tr>             <tr>             <tr>                 <td>                     Password :                 </td>                 <td>                     <input type="password" name="pw" value="">                 </td>             </tr>             <tr>                 <td colspan="2"&g

ASP.NET CRUD OPERATION

 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Web.Configuration; public partial class _Default : System.Web.UI.Page {     private SqlConnection con;     private void connection()     {         string constring = WebConfigurationManager.             ConnectionStrings["connstring"].ToString();         con = new SqlConnection(constring);     }     protected void Page_Load(object sender, EventArgs e)     {         if(!IsPostBack)         {             gvdisp();         }     }     protected void btninsert_Click(object sender, EventArgs e)     {         try         {             connection();             con.Open();             bool rescheckrecord = CheckRecord(txtname.Text, txtcity.Text);             if (rescheckrecord == false)             {                 con.Close();                 Response.Write("<font color='

PRODUCT MANAGEMENT SYSTEM USING PYTHON

   PRODUCT MANAGEMENT SYSTEM USING PYTHON    File Name :"product_crud_opertion.py" import mysql.connector myconn = mysql.connector.connect(     host = "localhost",     user = "root",     password = "5044",     database = "prod_info"     ) cur = myconn.cursor() def add_prod():     pid = input("\n\t\tEnter Prodcut ID : ")     pnm = input("\t\tEnter Product Name : ")     pprice = input("\t\tEnter Product Price :")     pstk = input("\t\tEnter Product Stock : ")          data = (pid, pnm, pprice, pstk)     sql = "INSERT INTO prod_tbl values(%s, %s, %s, %s)"       cur.execute(sql,data)     myconn.commit() def display_prod():     cur.execute("select * from prod_tbl")     rec = cur.fetchall()     print("\n\t\tPID\tPNAME\tPRICE\tPSTOCK")     for row in rec:         print("\t\t",row[0],"\t",row[1],"\t",row[2],"\t",row[3]) def display_spec

Servlet Databse Insert Operation

//HTML FILE <form action="http://localhost/servlet/Servlet3_insert_db" method="get">         ID : <input type="Text" name="id"><br><br>         Username : <input type="Text" name="unm"><br><br>         Password : <input type="Text" name="pass"><br><br>                     <input type="submit" name="sb" value="submit">             </form>  //Servlet Databse Insert Operation import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import pack.database_connection; public class Servlet3_insert_db extends HttpServlet {     public void doGet(HttpServletRequest req, HttpServletResponse res)     throws ServletException, IOException     {         res.setContentType("text/html");         PrintWriter out = res.getWriter();         try         {                          String

Get parameters value from the users

 // Get parameters value from the users import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class Servlet2_getparameter extends HttpServlet {     public void doGet(HttpServletRequest req, HttpServletResponse res)     throws ServletException, IOException     {         res.setContentType("text/html");         PrintWriter out = res.getWriter();         out.println("<h1>" + req.getParameter("first_name") + "</h1>"             + "\n" +             "<h1>" + req.getParameter("last_name") + "</h1>");     } } //HTML FILE. <form action="http://localhost/servlet/Servlet2_getparameter" method="get">         First Name : <input type="Text" name="first_name"><br><br>         Last Name : <input type="Text" name="last_name"><br><br>                     <input type="

Simple HelloWorld Program

 // Simple HelloWorld Program import javax.servlet.*; //Servlet Hello World Program import javax.servlet.http.*; import java.io.*; public class Servlet1 extends HttpServlet {     private String str;     public void init() throws ServletException     {         str = "Hello World";     }     public void doGet(HttpServletRequest req, HttpServletResponse res)     throws ServletException, IOException     {         res.setContentType("text/html");         PrintWriter out = res.getWriter();         out.println("<h1>" + str + "<h1>");     }     public void destroy()     {         //do Nothing.     } }