Posts

Showing posts with the label mysql

Servlet Project : User Management Project

Image
 Servlet Project : User Management Project For Explanation watch video: Note :: In this Project you must configure web server (for example tomcat) with eclipse ide Download Bootstrap  from ::         https://getbootstrap.com/docs/4.3/getting-started/download/ Download mysql jar file from :: https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.22 adding MySQL Connector/J jar file in eclipse ide for jdbc video :: video link : https://youtu.be/4Fyd-k3eG_I Directory Structure in eclipse web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">    <welcome-file-list>     <welcome-file>home.html</welcome-file>   </welcome-file-list>   <display-...

how to store html form data in mysql database using hibernate

Image
 how to store html form data in mysql database using hibernate 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> <artifactId>junit...

Java JDBC CRUD Operations in Eclipse using MySql

Image
 Java JDBC CRUD Operations in Eclipse using MySql  For Explanation Watch Video : Insert Class import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class Insert { public static void main(String[] args) { //load the driver try { Class.forName("com.mysql.cj.jdbc.Driver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } try (Connection con = DriverManager.getConnection("jdbc:mysql://@localhost:3306/new_schema", "root", "root"); Statement st = con.createStatement();) { String query = "INSERT INTO EMP(EID,ENAME) values(1,'Ram')"; int count = st.executeUpdate(query); if (count == 0) { System.out.println("Record not inserted"); } else { System.out.println("Record Inserted"); } } catch (SQLException se) { se.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } } Delete...