Java tutorial in Hindi for beginners #75 Java Get record with input from MySQL Database

preview_player
Показать описание
Here we learn how to get record from mysql to java with user input and where condtion java in the Hindi Language. This is a step-by-step guide to java in Hindi.

Points of video
Make a function to get a record.
Get input from terimal.
Apply where condition with user input
Interview Questions
JDBC update record
JDBC MySQL in Hindi
java connect MySQL in IntelliJ idea

Рекомендации по теме
Комментарии
Автор

Nowadays, I'm feel interest to learn any topic with you keep going bro🎉🎉

alamshaikh
Автор

sir, php laravel Matrimoney website kaa tutorial upload karnoa plz sir i request you i learn this project.

gujjugamer
Автор

package naman;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Scanner;

public class pratice {

public static Connection getConnection(){
try {
String
String
String username="postgres";
String pass="1234";
Class.forName(Driver);
Connection conn= DriverManager.getConnection(dbUrl, username, pass);
System.out.println("Database Successfully Connected");
return conn;
}
catch (Exception e){
System.out.println("An Error Occured "+e);
}
return null;

}
public static void getData(){
try {
Scanner sc=new Scanner(System.in);
System.out.println("Please Mention the Name of Person");
String uName= sc.next();
Statement
ResultSet * from customer where name = '"+uName.toLowerCase()+"' ");
while (result.next()){
System.out.println("The Person id is:
System.out.println("The Person name is: "+result.getString("name"));
System.out.println("The Person email is:
System.out.println("The Person adress is:
}

}catch (Exception e){
System.out.println(e);
}
}
public static void insData(){
while(true){
try {
Scanner scanner=new Scanner(System.in);
System.out.print("Please Mention The Id Of Person: ");
int uid= scanner.nextInt();
System.out.print("Please Mention The Name of The person: ");
String uname= scanner.next();
System.out.print("Please Enter The Email Of Perosn: ");
String umail= scanner.next();
System.out.print("Enter Your Destination: ");
String uadd=scanner.next();
Statement statement=
int into customer (custid, name, email, address) values("+uid+", '"+uname.toLowerCase()+"', '"+umail+"', '"+uadd+"')");
if(result==1){
Updated");
}
else {
System.out.println("Not Updated");
}
}catch (Exception e){
System.out.println(e);
}
}}


















public static void main(String[] args) {
getConnection();
// getData();
insData();



}
}

Naman_Bansal
visit shbcf.ru