Submit Search
Upload
Connectivity coding for java and mysql
•
Download as DOCX, PDF
•
1 like
•
98 views
F
Fahad Ali Khan
Follow
FOR CONNECTING JAVA(FRONTEND) WITH ANY BACKEND(MYSQL)
Read less
Read more
Software
Report
Share
Report
Share
1 of 9
Download now
Recommended
Sequelize
Sequelize
Tarek Raihan
MySql:Introduction
MySql:Introduction
DataminingTools Inc
Java assgn
Java assgn
aa11bb11
Lecture6 display data by okello erick
Lecture6 display data by okello erick
okelloerick
Update&delete
Update&delete
Bongza Naruk
MySql:Basics
MySql:Basics
DataminingTools Inc
Swing database(mysql)
Swing database(mysql)
vishal choudhary
Nantes Jug - Java 7
Nantes Jug - Java 7
Sébastien Prunier
Recommended
Sequelize
Sequelize
Tarek Raihan
MySql:Introduction
MySql:Introduction
DataminingTools Inc
Java assgn
Java assgn
aa11bb11
Lecture6 display data by okello erick
Lecture6 display data by okello erick
okelloerick
Update&delete
Update&delete
Bongza Naruk
MySql:Basics
MySql:Basics
DataminingTools Inc
Swing database(mysql)
Swing database(mysql)
vishal choudhary
Nantes Jug - Java 7
Nantes Jug - Java 7
Sébastien Prunier
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
Denis Ristic
Micro(Lightweight) Django
Micro(Lightweight) Django
Grigory Petrov
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
DataStax Academy
Learn PHP Lacture2
Learn PHP Lacture2
ADARSH BHATT
MySQL for beginners
MySQL for beginners
Saeid Zebardast
Transaction isolationexamples
Transaction isolationexamples
Mahabubur Rahaman
Solr integration in Magento Enterprise
Solr integration in Magento Enterprise
Tobias Zander
Lock basicsexamples
Lock basicsexamples
Mahabubur Rahaman
Beginner guide to mysql command line
Beginner guide to mysql command line
Priti Solanki
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
PgDay.Seoul
groovy databases
groovy databases
Paul King
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginners
Saeid Zebardast
Web app development_crud_13
Web app development_crud_13
Hassen Poreya
Php mysq
Php mysq
prasanna pabba
Real Time Web with Node
Real Time Web with Node
Tim Caswell
Node Powered Mobile
Node Powered Mobile
Tim Caswell
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
John David Duncan
Python database access
Python database access
Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai
Database administration commands
Database administration commands
Varsha Ajith
3 database-jdbc(1)
3 database-jdbc(1)
hameedkhan2017
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
Zianed Hou
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
Alexandre Morgaut
More Related Content
What's hot
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
Denis Ristic
Micro(Lightweight) Django
Micro(Lightweight) Django
Grigory Petrov
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
DataStax Academy
Learn PHP Lacture2
Learn PHP Lacture2
ADARSH BHATT
MySQL for beginners
MySQL for beginners
Saeid Zebardast
Transaction isolationexamples
Transaction isolationexamples
Mahabubur Rahaman
Solr integration in Magento Enterprise
Solr integration in Magento Enterprise
Tobias Zander
Lock basicsexamples
Lock basicsexamples
Mahabubur Rahaman
Beginner guide to mysql command line
Beginner guide to mysql command line
Priti Solanki
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
PgDay.Seoul
groovy databases
groovy databases
Paul King
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginners
Saeid Zebardast
Web app development_crud_13
Web app development_crud_13
Hassen Poreya
Php mysq
Php mysq
prasanna pabba
Real Time Web with Node
Real Time Web with Node
Tim Caswell
Node Powered Mobile
Node Powered Mobile
Tim Caswell
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
John David Duncan
Python database access
Python database access
Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai
Database administration commands
Database administration commands
Varsha Ajith
What's hot
(19)
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
Micro(Lightweight) Django
Micro(Lightweight) Django
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
Learn PHP Lacture2
Learn PHP Lacture2
MySQL for beginners
MySQL for beginners
Transaction isolationexamples
Transaction isolationexamples
Solr integration in Magento Enterprise
Solr integration in Magento Enterprise
Lock basicsexamples
Lock basicsexamples
Beginner guide to mysql command line
Beginner guide to mysql command line
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
groovy databases
groovy databases
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginners
Web app development_crud_13
Web app development_crud_13
Php mysq
Php mysq
Real Time Web with Node
Real Time Web with Node
Node Powered Mobile
Node Powered Mobile
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
Python database access
Python database access
Database administration commands
Database administration commands
Similar to Connectivity coding for java and mysql
3 database-jdbc(1)
3 database-jdbc(1)
hameedkhan2017
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
Zianed Hou
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
Alexandre Morgaut
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of Things
Alexander Rubin
JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)
Craig Dickson
Library system project file
Library system project file
PrithwishBhattachary2
Jdbc
Jdbc
Indu Lata
Swift で JavaScript 始めませんか? #iOSDC
Swift で JavaScript 始めませんか? #iOSDC
Tomohiro Kumagai
code for quiz in my sql
code for quiz in my sql
JOYITAKUNDU1
JDBC Tutorial
JDBC Tutorial
Information Technology
Hadoop Integration in Cassandra
Hadoop Integration in Cassandra
Jairam Chandar
Jdbc ja
Jdbc ja
DEEPIKA T
Jdbc
Jdbc
Rami Nayan
Wwe Management System
Wwe Management System
NeerajMudgal1
Executing Sql Commands
Executing Sql Commands
phanleson
Executing Sql Commands
Executing Sql Commands
leminhvuong
Modul Praktek Java OOP
Modul Praktek Java OOP
Zaenal Arifin
Advance Java Programs skeleton
Advance Java Programs skeleton
Iram Ramrajkar
This is a basic JAVA pgm that contains all of the major compoents of DB2
This is a basic JAVA pgm that contains all of the major compoents of DB2
Sheila A. Bell, MS, PMP
JDBC - JPA - Spring Data
JDBC - JPA - Spring Data
Arturs Drozdovs
Similar to Connectivity coding for java and mysql
(20)
3 database-jdbc(1)
3 database-jdbc(1)
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of Things
JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)
Library system project file
Library system project file
Jdbc
Jdbc
Swift で JavaScript 始めませんか? #iOSDC
Swift で JavaScript 始めませんか? #iOSDC
code for quiz in my sql
code for quiz in my sql
JDBC Tutorial
JDBC Tutorial
Hadoop Integration in Cassandra
Hadoop Integration in Cassandra
Jdbc ja
Jdbc ja
Jdbc
Jdbc
Wwe Management System
Wwe Management System
Executing Sql Commands
Executing Sql Commands
Executing Sql Commands
Executing Sql Commands
Modul Praktek Java OOP
Modul Praktek Java OOP
Advance Java Programs skeleton
Advance Java Programs skeleton
This is a basic JAVA pgm that contains all of the major compoents of DB2
This is a basic JAVA pgm that contains all of the major compoents of DB2
JDBC - JPA - Spring Data
JDBC - JPA - Spring Data
Recently uploaded
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
shikhaohhpro
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Jhone kinadey
Professional Resume Template for Software Developers
Professional Resume Template for Software Developers
Vinodh Ram
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
kellynguyen01
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
MyIntelliSource, Inc.
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
kalichargn70th171
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
harshavardhanraghave
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
gurkirankumar98700
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Andolasoft Inc
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
MyIntelliSource, Inc.
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ComplianceQuest1
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Steffen Staab
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
ThousandEyes
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
panagenda
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
Willy Marroquin (WillyDevNET)
DNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Dynamic Netsoft
Recently uploaded
(20)
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Professional Resume Template for Software Developers
Professional Resume Template for Software Developers
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
DNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Connectivity coding for java and mysql
1.
For database name
“fahad” in mysql. For table name “stu” under database “fahad”.
2.
CONNECTIVITY CODING: importjava.sql.*; importjavax.swing.JOptionPane; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connectioncon=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mannan","root","sds"); StringSQL="select* fromstu";
3.
Statementstmt=con.createStatement(); ResultSetrs=stmt.executeQuery(SQL); while(rs.next()) { } intANo=Integer.parseInt(jTextField1.getText()); StringSName=jTextField2.getText(); StringSclass=jTextField3.getText(); StringstrSQL="insertintostu(rno,sname,sclass) values('"+(ANo)+"','"+(SName)+"','"+(Sclass)+"')"; introweff=stmt.executeUpdate(strSQL); JOptionPane.showMessageDialog(rootPane,"One row
inserted"); con.close(); } catch(Exceptione){ JOptionPane.showMessageDialog(this,e.getMessage()); }
4.
MODIFY RECORD: importjava.sql.*; importjavax.swing.JOptionPane; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connectioncon=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mannan","root","sds"); Statementst=con.createStatement(); intr=Integer.parseInt(jTextField1.getText()); Stringq="select* fromstu
where rno='"+(r)+"'"; ResultSetrs=st.executeQuery(q);
5.
while(rs.next()) { intrno=rs.getInt("rno"); Stringsn=rs.getString("sname"); Stringsc=rs.getString("sclass"); jTextField2.setText(""+sn); jTextField3.setText(""+sc); } con.close(); } catch(Exceptione){ JOptionPane.showMessageDialog(this,e.getMessage()); } } private voidjButton2ActionPerformed(java.awt.event.ActionEventevt) { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connectioncon=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mannan","root","sds"); Statementst=con.createStatement();
6.
intr=Integer.parseInt(jTextField1.getText()); Stringsn=jTextField2.getText(); Stringsc=jTextField3.getText(); Stringq="update stusetsname='"+(sn)+"',sclass='"+(sc)+"'whererno='"+(r)+"'"; introw=st.executeUpdate(q); JOptionPane.showMessageDialog(rootPane,"recordupdated"); con.close(); } catch(Exceptione){ JOptionPane.showMessageDialog(this,e.getMessage()); } DISPLAYING RECORDIN
TABLE: importjava.sql.*;
7.
importjavax.swing.JOptionPane; importjavax.swing.table.*; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connectioncon=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mannan","root","sds"); Statementstmt=con.createStatement(); Stringq="select* fromstu"; ResultSetrs=stmt.executeQuery(q); DefaultTableModel m=(DefaultTableModel)jTable1.getModel(); introws=m.getRowCount(); if
(rows>0) { for(inti=0;i<rows;i++) { m.removeRow(0); } } while (rs.next()) { Stringr=rs.getString("rno");
8.
Stringsn=rs.getString("sname"); Stringsc=rs.getString("sclass"); m.addRow(newObject[]{r,sn,sc}); } con.close(); } catch(Exceptione){ JOptionPane.showMessageDialog(this,e.getMessage()); } DELETINGA RECORD: importjava.sql.*; importjavax.swing.JOptionPane; try
9.
{ Class.forName("com.mysql.jdbc.Driver").newInstance(); Connectioncon=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mannan","root","sds"); //StringSQL="select*fromstu"; Statementstmt=con.createStatement(); intr=Integer.parseInt(jTextField1.getText()); Stringq="delete fromstuwhere rno='"+(r)+"'"; introw=stmt.executeUpdate(q); JOptionPane.showMessageDialog(rootPane,"recorddeleted"); con.close(); } catch(Exceptione){ JOptionPane.showMessageDialog(this,e.getMessage()); }
Download now