Posts

Showing posts from August, 2023

Title: A Comprehensive Guide to Java Programming

 Certainly, writing a comprehensive blog about Java is a great idea. Here's an outline you can follow to structure your blog post: **Introduction:** - Briefly introduce Java as a versatile and widely-used programming language. - Mention its history, its role in web development, backend systems, Android apps, and more. **1. Getting Started with Java:** - Discuss Java's simple syntax and its "write once, run anywhere" philosophy. - Explain how to set up the Java Development Kit (JDK) and a code editor (e.g., Eclipse, IntelliJ IDEA). **2. Core Concepts:** - Dive into the core principles of Object-Oriented Programming (OOP). - Explain classes, objects, inheritance, encapsulation, abstraction, and polymorphism. - Provide code examples for each concept. **3. Working with Data Types and Variables:** - Discuss Java's primitive data types (int, float, char, etc.) and reference types (objects). - Explain how to declare variables, initialize them, and perform type casting. *...

JDBC Crud Operation Delete Multiple Records With Prepared Statement in Java

  package jdbc_pre_stmt ; import java . sql . Connection ; import java . sql . DriverManager ; import com . mysql . jdbc . PreparedStatement ; public class Jdbc_Pre_Stmt_Delete { public static void main ( String [] args ) throws Exception { Class . forName ( "com.mysql.jdbc.Driver" ) ; System . out . println ( "Driver Loaded......" ) ; Connection cn = DriverManager . getConnection ( "jdbc:mysql://localhost:3306/batch138" , "root" , "root" ) ; System . out . println ( "Connection Success....." ) ; PreparedStatement ps = ( PreparedStatement ) cn . prepareStatement ( "delete from student where id=?" ) ; ps . setInt ( 1 , 1010 ) ; ps . execute () ; ps . setInt ( 1 , 1 ) ; ps . execute () ; ps . setInt ( 1 , 10 ) ; ps . execute () ; } }

JDBC Crud Operation Update Multiple Records With Prepared Statement in Java

  package jdbc_pre_stmt ; import java . sql . Connection ; import java . sql . DriverManager ; import com . mysql . jdbc . PreparedStatement ; public class Jdbc_Pre_Stmt_Update { public static void main ( String [] args ) throws Exception { Class . forName ( "com.mysql.jdbc.Driver" ) ; System . out . println ( "Driver Loaded......" ) ; Connection cn = DriverManager . getConnection ( "jdbc:mysql://localhost:3306/batch138" , "root" , "root" ) ; System . out . println ( "Connection Success....." ) ; PreparedStatement ps = ( PreparedStatement ) cn . prepareStatement ( "update student set name=? where id=?" ) ; ps . setString ( 1 , "Pune" ) ; ps . setInt ( 2 , 3010 ) ; ps . execute () ; ps . setString ( 1 , "Python" ) ; ps . setInt ( 2 , 102 ) ; ps . execute () ; ps . setString ( 1 , "Acer" ) ; ps . setInt ( 2 , 101...

JDBC Crud Operation Insert Multiple Records With Prepared Statement in Java

  package jdbc_pre_stmt ; import java . sql . Connection ; import java . sql . DriverManager ; import com . mysql . jdbc . PreparedStatement ; public class Jdbc_Pre_Stmt { public static void main ( String [] args ) throws Exception { Class . forName ( "com.mysql.jdbc.Driver" ) ; System . out . println ( "Driver Loaded......" ) ; Connection cn = DriverManager . getConnection ( "jdbc:mysql://localhost:3306/batch138" , "root" , "root" ) ; System . out . println ( "Connection Success....." ) ; PreparedStatement pd = ( PreparedStatement ) cn . prepareStatement ( "insert into student values(?,?)" ) ; pd . setInt ( 1 , 301 ) ; pd . setString ( 2 , "Python" ) ; pd . execute () ; pd . setInt ( 1 , 1010 ) ; pd . setString ( 2 , "Java" ) ; pd . execute () ; pd . setInt ( 1 , 10 ) ; pd . setString ( 2 , "SQL" ) ; pd . exec...

JDBC CRUD Statement Operation.

package jdbc_stmt_example ; import java . sql .*; public class Jdbc_CRUD_Stmt { public static void main ( String [] args ) throws Exception { Class . forName ( "com.mysql.jdbc.Driver" ) ; System . out . println ( "Driver Load Success....." ) ; Connection cn = DriverManager . getConnection ( "jdbc:mysql://localhost:3306/batch138" , "root" , "root" ) ; System . out . println ( "Connection Success....." ) ; Statement stmt = cn . createStatement () ; stmt . executeUpdate ( "insert into Student values(101,'Ganesh')" ) ; System . out . println ( "Inserted......" ) ; stmt . executeUpdate ( "update student set name='jaa' where id=101" ) ; System . out . println ( "Updated...." ) ; stmt . executeUpdate ( "delete from student where id=101" ) ; } }

SpringBoot + Hibernate Integration=MVC Project SI2

 *Database connection Code* ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)spring.datasource.url = jdbc:mysql://localhost:3306/databaseName spring.datasource.username = root spring.datasource.password = root spring.datasource.driver-class-name=com.mysql.jdbc.Driver ## Hibernate Properties # The SQL dialect makes Hibernate generate better SQL for the chosen database #spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect # Hibernate ddl auto (create, create-drop, validate, update) spring.jpa.hibernate.ddl-auto = update spring.jackson.serialization.fail-on-empty-beans=false *front end jsp extension and view folder path* spring.mvc.view.prefix=/view/ spring.mvc.view.suffix=.jsp *MySQL connector dependancy version 5.0* <dependency>  <groupId>mysql</groupId>  <artifactId>mysql-connector-java</artifactId>  <version>5.1.6</version> </dependency> *Front end JSP Page cal...