Skip to main content

Posts

how to store html form data in mysql database using hibernate | Java Servlet and hibernate Example

  how to store html form data in mysql database using hibernate | Java Servlet and hibernate Example For Explanation watch video: Directory Structure Pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>Servlet-Hibernate</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>Servlet-Hibernate Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <maven.compiler.source>1.9</maven.compiler.source> <maven.compiler.target>1.9</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId...

Linux Shell - Arithmetic Operations solution

 Linux Shell - Arithmetic Operations solution for explanation watch video:: code:: read string res= $(echo "scale=4;$string" | bc) printf  "%.3f"   "$res"  

how to store html form data in mysql database using java

how to store html form data in mysql database using java for explanation watch the video:: Step 1 : Create the peroject step 2 : create home.html in webapp step 3 : home.html home.html ========== <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css"> <!-- jQuery library --> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script> <!-- Popper JS --> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <!-- Latest compiled JavaScript --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script> <style> #div1 { width: 600p...

Weather Observation Station 19 Hackerrank Solution - SQL

  Weather Observation Station 19 Hackerrank Solution - SQL  for explanation watch video :: Code:: select round(sqrt(     power(max(lat_n)-min(lat_N),2)+     power(max(long_w)-min(long_w),2) ),4) from station;

Weather Observation Station 15 Hackerrank Solution - SQL

 Weather Observation Station 15 Hackerrank Solution - SQL For explanation watch video :: Code:: select round(long_w,4) from station where lat_n = (select max(lat_n) from station where lat_n<137.2345);

Weather Observation Station 14 Hackerrank Solution - SQL

Weather Observation Station 14 Hackerrank Solution - SQL For explanation watch video :: Code:: select round(max(LAT_N),4) from station where LAT_N < 137.2345;

Transaction Management in JDBC | JDBC Tutorial

  Transaction Management in JDBC For explanation watch video :: Code:: import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; public class OracleConn { public static void main(String[] args) { String url = "jdbc:oracle:thin:@localhost:1521:orcl"; String uname = "system"; String pwd = "tiger"; // take source account number and dest acc number from user Scanner scn = new Scanner(System.in); System.out.println("Enter source acc no: "); long srcAcNo = scn.nextLong(); System.out.println("Enter dest acc no: "); long destAcNo = scn.nextLong(); // take the amt to transfer System.out.println("Enter amt to transfer: "); long amt = scn.nextLong(); try (Connection con = DriverManager.getConnection(url, uname, pwd);  Statement st = con.createStatement();) { // Begin Tx if (con != null) con.set...