// API callback
related_results_labels_thumbs({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$blogger":"http://schemas.google.com/blogger/2008","xmlns$georss":"http://www.georss.org/georss","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$thr":"http://purl.org/syndication/thread/1.0","id":{"$t":"tag:blogger.com,1999:blog-913600556879440043"},"updated":{"$t":"2024-01-01T15:38:08.302+05:30"},"category":[{"term":"Java"},{"term":"General"},{"term":"C Plus Plus Programming"},{"term":"Selenium Automation Testing"},{"term":"High Performance Computing"},{"term":"PPL"},{"term":"Parallel Computing"},{"term":"My Vlogs"},{"term":"Blogging Tips"},{"term":"Skill Development Lab"},{"term":"Compiler"},{"term":"Website Designing"},{"term":"Data Structures"},{"term":"Android"},{"term":"Database"},{"term":"CUDA"},{"term":"OPENMP"},{"term":"YouTube Tips"},{"term":"Youtube"},{"term":"C Programming"},{"term":"How To Write Blog"},{"term":"Android App Development"},{"term":"Salesforce"},{"term":"Multithreading"},{"term":"Networking"},{"term":"Swing"},{"term":"LEX \u0026 YACC"},{"term":"Linux"},{"term":"Ubuntu"},{"term":"Mysql"},{"term":"Nanded City Pune"},{"term":"GATE"},{"term":"Cloud Computing"},{"term":"MS Excel Formulas \u0026 Functions"},{"term":"Applet"},{"term":"Computer Networks"},{"term":"Google Forms"},{"term":"SQL"},{"term":"MPI"},{"term":"OpenMPI"},{"term":"Socket Programming"},{"term":"Thread Pool"},{"term":"Amazon Links Summary"},{"term":"Fedora"},{"term":"Guest Blogging"},{"term":"Python"},{"term":"SDL"},{"term":"Wine"},{"term":"Abbreviations in Computer Science"},{"term":"Amazon Affiliate Program"},{"term":"Dia Software"},{"term":"Lisp"},{"term":"Mathematics"},{"term":"OPENCL"},{"term":"Udemy Courses"},{"term":"Unboxing \u0026 Review"},{"term":"Vedic Mathematics"},{"term":"Vocabulary"}],"title":{"type":"text","$t":"Computer Revolution (www.comrevo.com)"},"subtitle":{"type":"html","$t":""},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/posts\/default"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/-\/Mysql?alt=json-in-script\u0026max-results=6"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/search\/label\/Mysql"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"},{"rel":"next","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/-\/Mysql\/-\/Mysql?alt=json-in-script\u0026start-index=7\u0026max-results=6"}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"generator":{"version":"7.00","uri":"http://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"7"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"6"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-913600556879440043.post-7007112937468221678"},"published":{"$t":"2019-07-29T11:03:00.001+05:30"},"updated":{"$t":"2020-09-25T11:26:30.569+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Database"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Java"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Mysql"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Skill Development Lab"}],"title":{"type":"text","$t":"MySQL stored procedure parameters IN OUT INOUT | How to use parameters in MySQL procedure"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; In this post, we will see MySQL stored procedure parameters IN OUT INOUT.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; In last post\u0026nbsp;\u003Ca href=\"https:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html\u003C\/a\u003E, we have seen how to create procedure in MySQL. In this post, we will see how to use parameters in procedure.\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003EFor Details, Watch Following Video:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\n  \n  \n  \u003Ciframe width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/dBgkCGu7njI\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen\u003E\u003C\/iframe\u003E\n  \n  \n  \n  \u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EWatch on YouTube:\u0026nbsp;\u003Ca href=\"https:\/\/www.youtube.com\/watch?v=dBgkCGu7njI\" target=\"_blank\"\u003Ehttps:\/\/www.youtube.com\/watch?v=dBgkCGu7njI\u003C\/a\u003E\u003Cbr \/\u003E\u003C\/b\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Ca name='more'\u003E\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003EWhat is the advantage of having parameters in SQL Procedure?\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; By \u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Eusing parameters IN, OUT, INOUT we can send values and also receive results from procedure.\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: center;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E1. IN\u003C\/b\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; It is used to declare input parameters in procedure. \u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Ecreate procedure procedure_name(IN parameter_name data_type(size))\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Ebegin\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ESQL Queries\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Eend\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EFor Example:\u003C\/b\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cu\u003E(Creating procedure)\u003C\/u\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; delimiter \/\/\u003Cbr \/\u003Emysql\u0026gt; create procedure sample(IN city_proc varchar(10))\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; begin \u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; select * from student where city=city_proc;\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; end\/\/\u003Cbr \/\u003EQuery OK, 0 rows affected (0.02 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; delimiter ;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cu\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E(Calling procedure)\u003C\/span\u003E\u003C\/span\u003E\u003C\/u\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; call sample('Pune');\u003Cbr \/\u003E+--------+-------+---------+------+\u003Cbr \/\u003E| rollno | class | college | city |\u003Cbr \/\u003E+--------+-------+---------+------+\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 1221 | SE\u0026nbsp;\u0026nbsp;\u0026nbsp; | PICT\u0026nbsp;\u0026nbsp;\u0026nbsp; | Pune |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 3201 | te\u0026nbsp;\u0026nbsp;\u0026nbsp; | coep\u0026nbsp;\u0026nbsp;\u0026nbsp; | Pune |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 2301 | SE\u0026nbsp;\u0026nbsp;\u0026nbsp; | COEP\u0026nbsp;\u0026nbsp;\u0026nbsp; | Pune |\u003Cbr \/\u003E+--------+-------+---------+------+\u003Cbr \/\u003E3 rows in set (0.03 sec)\u003Cbr \/\u003E\u003Cbr \/\u003EQuery OK, 0 rows affected (0.06 sec)\u003Cbr \/\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: center;\"\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E2. OUT\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; It is used to declare output variable in procedure.\u003C\/span\u003E\u003C\/span\u003E\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E \u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Ecreate procedure procedure_name(OUT parameter_name data_type(size))\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Ebegin\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ESQL Queries\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Eend\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EFor Example:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cu\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E(Creating Procedure)\u003C\/span\u003E\u003C\/span\u003E\u003C\/u\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; delimiter \/\/\u003Cbr \/\u003Emysql\u0026gt; create procedure sample(IN city_proc varchar(10), OUT total int(10))\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; begin\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; select count(*) into total from student where city=city_proc;\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; end\/\/\u003Cbr \/\u003EQuery OK, 0 rows affected (0.00 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; delimiter ;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cu\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/u\u003E\n\u003Cu\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E(Calling Procedure)\u003C\/span\u003E\u003C\/span\u003E\u003C\/u\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003C\/span\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003C\/span\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; call sample('Pune', @total);\u003Cbr \/\u003EQuery OK, 1 row affected (0.00 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; select @total;\u003Cbr \/\u003E+--------+\u003Cbr \/\u003E| @total |\u003Cbr \/\u003E+--------+\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 3 |\u003Cbr \/\u003E+--------+\u003Cbr \/\u003E1 row in set (0.00 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; select @total AS Num_of_records;\u003Cbr \/\u003E+----------------+\u003Cbr \/\u003E| Num_of_records |\u003Cbr \/\u003E+----------------+\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; 3 |\u003Cbr \/\u003E+----------------+\u003Cbr \/\u003E1 row in set (0.00 sec)\u003C\/span\u003E\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: center;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E3. INOUT\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003C\/b\u003EIt is used to declare parameter which can be used as input as well as outout parameter.\u003Cbr \/\u003E\u003Cb\u003E\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Ecreate procedure procedure_name(INOUT parameter_name data_type(size))\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Ebegin\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ESQL Queries\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Eend\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EFor Example:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cu\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E(Creating Procedure)\u003C\/span\u003E\u003C\/span\u003E\u003C\/u\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; delimiter \/\/\u003Cbr \/\u003Emysql\u0026gt; create procedure sample(INOUT num int(10))\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; begin\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; select count(*) into num from student where rollno=num;\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; end\/\/\u003Cbr \/\u003EQuery OK, 0 rows affected (0.00 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; delimiter ;\u003Cbr \/\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cu\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E(Calling Procedure)\u003C\/span\u003E\u003C\/span\u003E\u003C\/u\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; set @num=3303;\u003Cbr \/\u003EQuery OK, 0 rows affected (0.00 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; call sample(@num);\u003Cbr \/\u003EQuery OK, 1 row affected (0.01 sec)\u003Cbr \/\u003E\u003Cbr \/\u003Emysql\u0026gt; select @num;\u003Cbr \/\u003E+------+\u003Cbr \/\u003E| @num |\u003Cbr \/\u003E+------+\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp;\u0026nbsp; 2 |\u003Cbr \/\u003E+------+\u003Cbr \/\u003E1 row in set (0.00 sec)\u003Cbr \/\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; Thank You.\u003C\/span\u003E \u003C\/span\u003E\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/7007112937468221678\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/mysql-stored-procedure-parameters-in-out-inout.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/7007112937468221678"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/7007112937468221678"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/mysql-stored-procedure-parameters-in-out-inout.html","title":"MySQL stored procedure parameters IN OUT INOUT | How to use parameters in MySQL procedure"}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https:\/\/img.youtube.com\/vi\/dBgkCGu7njI\/default.jpg","height":"72","width":"72"},"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-913600556879440043.post-4718996954718911133"},"published":{"$t":"2019-07-25T14:06:00.001+05:30"},"updated":{"$t":"2019-07-29T11:26:47.308+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Database"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Java"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Mysql"}],"title":{"type":"text","$t":"Java MySQL CallableStatement Example | Java MySQL Call Stored Procedure Example ( Callable Statement )"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; \u003C\/b\u003E\u003Cspan style=\"font-size: large;\"\u003EIn this post, we will see Java MySQL CallableStatement Example OR Java MySQL Call Stored Procedure Example ( Callable Statement ).\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Ca name='more'\u003E\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; In previous posts, we have seen\u0026nbsp;\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E1. How to insert records (rows) into MySQL database:\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E \u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Ca href=\"https:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-insert-data-into-mysql-database.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-insert-data-into-mysql-database.html\u003C\/a\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E2. Java MySQL Insert Example using PreparedStatement:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Ca href=\"https:\/\/www.comrevo.com\/2019\/07\/java-mysql-insert-example-using-prepared-statement.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2019\/07\/java-mysql-insert-example-using-prepared-statement.html\u003C\/a\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; In this post, we will see how to use \u003Cb\u003ECallableStatement\u003C\/b\u003E. \u003Cu\u003EIt is used to run stored procedure from database\u003C\/u\u003E.\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; \u003Cb\u003EHow to create procedures in MySQL database, check in following post:\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Ca href=\"https:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html\u003C\/a\u003E\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EWhat is \u003C\/span\u003E\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003ECallableStatement?\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; CallableStatement is an Interface. PreparedStatement interface is extended in CallableStatement interface.\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; Check following example. We have already created procedure \u003Cb\u003Esample()\u003C\/b\u003E which has three SQL queries (insert, update and select). You can add any number of queries in procedure. For details, check link\u0026nbsp;\u003Ca href=\"https:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html\u003C\/a\u003E. \u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\n \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; Here \u003Cb\u003Esdldb\u003C\/b\u003E is the database name. User name is \u003Cb\u003Esdl\u003C\/b\u003E and password is \u003Cb\u003Esdl123\u003C\/b\u003E. \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; \u003C\/span\u003E\u003C\/div\u003E\n\u003Cb style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EProgram (JdbcCS.java):\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Ctd\u003E\u003Cspan style=\"font-size: large;\"\u003Eimport java.sql.*;\u003Cbr \/\u003E\u003Cbr \/\u003Eclass JdbcCS\u003Cbr \/\u003E{\u003Cbr \/\u003Epublic static void main(String args[]) throws Exception\u003Cbr \/\u003E{\u003Cbr \/\u003EClass.forName(\"com.mysql.jdbc.Driver\");\u003Cbr \/\u003EConnection con=DriverManager.getConnection(\"jdbc:mysql:\/\/localhost:3306\/sdldb\",\"sdl\",\"sdl123\");\u003Cbr \/\u003ECallableStatement st=con.prepareCall(\"call sample()\");\u003Cbr \/\u003EResultSet rs=st.executeQuery();\u003Cbr \/\u003Ewhile(rs.next())\u003Cbr \/\u003E{\u003Cbr \/\u003ESystem.out.print(rs.getString(1)+\" \");\u003Cbr \/\u003ESystem.out.print(rs.getString(2)+\" \");\u003Cbr \/\u003ESystem.out.print(rs.getString(3)+\" \");\u003Cbr \/\u003ESystem.out.print(rs.getString(4)+\" \");\u003Cbr \/\u003E\u003Cbr \/\u003ESystem.out.println(\"\\n\");\u003Cbr \/\u003E}\u003Cbr \/\u003E\u003Cbr \/\u003Ers.close();\u003Cbr \/\u003Est.close();\u003Cbr \/\u003Econ.close();\u003Cbr \/\u003E}\u003Cbr \/\u003E}\u0026nbsp; \u003C\/span\u003E\u003C\/td\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv dir=\"ltr\" style=\"orphans: auto; text-align: left; text-indent: 0px; widows: 1;\" trbidi=\"on\"\u003E\n\u003Cdiv style=\"-webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px;\"\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Ctd\u003E\u003Cspan style=\"font-size: large;\"\u003Eparag@parag-Inspiron-N4010:~\/Desktop\/programs\/jdbc$ javac JdbcCS.java \u003Cbr \/\u003Eparag@parag-Inspiron-N4010:~\/Desktop\/programs\/jdbc$ java JdbcCS\u003Cbr \/\u003E1221 SE PICT Pune \u003Cbr \/\u003E\u003Cbr \/\u003E3221 TE VJTI Mumbai \u003Cbr \/\u003E\u003Cbr \/\u003E1201 se vjti mumbai \u003Cbr \/\u003E\u003Cbr \/\u003E3201 te coep Pune \u003Cbr \/\u003E\u003Cbr \/\u003E4201 be wce Sangli \u003Cbr \/\u003E\u003Cbr \/\u003E3303 TE GCOE Aurangabad \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003C\/td\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003Cdiv\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; Hope, it will be helpful for you. Thank You.\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"font-family: \u0026quot;times new roman\u0026quot;; font-size: large;\"\u003ECheck jdbc code for fetching data from database in this post:\u0026nbsp;\u003C\/span\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-retrieve-data-from-mysql-database.html\" style=\"font-family: 'Times New Roman'; font-size: x-large;\" target=\"_blank\"\u003Ehttp:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-retrieve-data-from-mysql-database.html\u003C\/a\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003Cdiv style=\"text-align: center;\"\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Ccenter\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Cth\u003E\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2016\/09\/database.html\" target=\"_blank\"\u003ECheck Other Posts on Database\u003C\/a\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003C\/th\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003C\/center\u003E\n\u003C\/div\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/4718996954718911133\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/java-mysql-callablestatement-example-or-java-mysql-call-stored-procedure-example.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/4718996954718911133"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/4718996954718911133"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/java-mysql-callablestatement-example-or-java-mysql-call-stored-procedure-example.html","title":"Java MySQL CallableStatement Example | Java MySQL Call Stored Procedure Example ( Callable Statement )"}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-913600556879440043.post-6559038143277845616"},"published":{"$t":"2019-07-25T12:08:00.002+05:30"},"updated":{"$t":"2020-09-25T10:52:43.697+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Database"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Mysql"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Skill Development Lab"},{"scheme":"http://www.blogger.com/atom/ns#","term":"SQL"}],"title":{"type":"text","$t":"How to create procedure in MySQL database?"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; In this post, we will see how to create procedure in MySQL database\u003C\/span\u003E.\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003EWhat is the need of procedure?\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E1. By creating procedure, we can run multiple SQL queries in a single call.\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E2. Another advantage is that procedure is stored and can be called at any time. No need to write same SQL queries again and again.\u0026nbsp;\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003EFor Demonstration, watch following video:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\n  \n  \u003Ciframe width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/02clWrruoKE\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen\u003E\u003C\/iframe\u003E\n  \n  \n  \u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EWatch on YouTube:\u0026nbsp;\u003Ca href=\"https:\/\/www.youtube.com\/watch?v=02clWrruoKE\" target=\"_blank\"\u003Ehttps:\/\/www.youtube.com\/watch?v=02clWrruoKE\u003C\/a\u003E\u003C\/b\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; Check following example:\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Ca name='more'\u003E\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cb style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EProcedure in MySQL:\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Ctd\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; delimiter \/\/\u003Cbr \/\u003Emysql\u0026gt; create procedure sample()\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; begin\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; insert into student values(3303,'TE','GCOE','Amravati');\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; update student set city='Aurangabad' where college='GCOE';\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; select * from student;\u003Cbr \/\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp; -\u0026gt; end\/\/\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; delimiter ; \u003C\/span\u003E\u003C\/td\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Ctd\u003E\u003Cspan style=\"font-size: large;\"\u003Emysql\u0026gt; call sample();\u003Cbr \/\u003E+--------+-------+---------+------------+\u003Cbr \/\u003E| rollno | class | college | city\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E+--------+-------+---------+------------+\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 1221 | SE\u0026nbsp;\u0026nbsp;\u0026nbsp; | PICT\u0026nbsp;\u0026nbsp;\u0026nbsp; | Pune\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 3221 | TE\u0026nbsp;\u0026nbsp;\u0026nbsp; | VJTI\u0026nbsp;\u0026nbsp;\u0026nbsp; | Mumbai\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 1201 | se\u0026nbsp;\u0026nbsp;\u0026nbsp; | vjti\u0026nbsp;\u0026nbsp;\u0026nbsp; | mumbai\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 3201 | te\u0026nbsp;\u0026nbsp;\u0026nbsp; | coep\u0026nbsp;\u0026nbsp;\u0026nbsp; | Pune\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 4201 | be\u0026nbsp;\u0026nbsp;\u0026nbsp; | wce\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; | Sangli\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 2301 | SE\u0026nbsp;\u0026nbsp;\u0026nbsp; | COEP\u0026nbsp;\u0026nbsp;\u0026nbsp; | Pune\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 3301 | TE\u0026nbsp;\u0026nbsp;\u0026nbsp; | SGGS\u0026nbsp;\u0026nbsp;\u0026nbsp; | Nanded\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; |\u003Cbr \/\u003E|\u0026nbsp;\u0026nbsp; 3303 | TE\u0026nbsp;\u0026nbsp;\u0026nbsp; | GCOE\u0026nbsp;\u0026nbsp;\u0026nbsp; | Aurangabad |\u003Cbr \/\u003E+--------+-------+---------+------------+\u003Cbr \/\u003E8 rows in set (0.17 sec)\u003Cbr \/\u003E\u003Cbr \/\u003EQuery OK, 0 rows affected (0.17 sec)\u003C\/span\u003E\u003C\/td\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003Cbr \/\u003E\n\u003Cu\u003E\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003EExplanation\u003C\/span\u003E\u003C\/b\u003E\u003C\/u\u003E\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E:\u0026nbsp;\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003Cb\u003Edelimiter\u003C\/b\u003E command is used to change the end of MySQL Query.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ee.g. Generally end of SQL query is \u003Cb\u003E;\u003C\/b\u003E . Now, if we want to change it to \u003Cb\u003E\/\/\u003C\/b\u003E. Then execute \u003Cb\u003Edelimiter \/\/\u003C\/b\u003E. If we want to make end of each sql query as \u003Cb\u003E$$\u003C\/b\u003E, then execute \u003Cb\u003Edelimiter $$\u003C\/b\u003E.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; In above example, we have to add multiple SQL queries in procedure \u003Cb\u003Esample()\u003C\/b\u003E, hence we have changed the end of SQL query as \u003Cb\u003E\/\/\u003C\/b\u003E by executing \u003Cb\u003Edelimiter \/\/\u003C\/b\u003E. After defining procedure sample, again we have reset the end of SQL query as \u003Cb\u003E;\u003C\/b\u003E by executing \u003Cb\u003Edelimiter ;\u003C\/b\u003E .\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax for creating procedure in MySQL is as follows:\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ecreate procedure procedure_name\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ebegin\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; SQL Queries;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eend\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax for calling procedure is as follows:\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ecall procedure_name();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax for displaying all procedures:\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eshow procedure status;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax for deleting any procedure:\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Edrop procedure procedure_name;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003ESyntax for getting all options for show command:\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ehelp show; \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cu\u003E\u003Cb\u003EFind how to use parameters IN, OUT, INOUT in MySQL procedure in next \u003C\/b\u003E\u003Cb\u003Epost\u003C\/b\u003E\u003C\/u\u003E\u0026nbsp; \u003Ca href=\"https:\/\/www.comrevo.com\/2019\/07\/mysql-stored-procedure-parameters-in-out-inout.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2019\/07\/mysql-stored-procedure-parameters-in-out-inout.html\u003C\/a\u003E. \u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003C\/span\u003E\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/6559038143277845616\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/6559038143277845616"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/6559038143277845616"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/how-to-create-procedure-in-mysql-database.html","title":"How to create procedure in MySQL database?"}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https:\/\/img.youtube.com\/vi\/02clWrruoKE\/default.jpg","height":"72","width":"72"},"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-913600556879440043.post-9192667777190529616"},"published":{"$t":"2019-07-25T11:24:00.003+05:30"},"updated":{"$t":"2020-09-25T11:22:00.114+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Database"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Java"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Mysql"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Skill Development Lab"}],"title":{"type":"text","$t":"Java MySQL Insert Example using Prepared Statement"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; \u003C\/b\u003E\u003Cspan style=\"font-size: large;\"\u003EIn this post, we will see Java MySQL Insert Example using Prepared Statement.\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; In previous post \u003Ca href=\"https:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-insert-data-into-mysql-database.html\" target=\"_blank\"\u003Ehttps:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-insert-data-into-mysql-database.html\u003C\/a\u003E, we have seen how to insert records (rows) into MySQL database. Here, we will see how to use PreparedStatement.\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003EFor details, watch following video:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\n  \n  \u003Ciframe width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/S6mJpp5Dg7c\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen\u003E\u003C\/iframe\u003E\n  \n  \n  \u003C\/span\u003E\u003C\/div\u003E\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EWatch on YouTube:\u0026nbsp;\u003Ca href=\"https:\/\/www.youtube.com\/watch?v=S6mJpp5Dg7c\" target=\"_blank\"\u003Ehttps:\/\/www.youtube.com\/watch?v=S6mJpp5Dg7c\u003C\/a\u003E\u003C\/b\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EWhat is the need of Prepared Statement?:\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; Sometimes we need to implement same query multiple times e.g. insert query to add multiple records into table. In this situation, only data get changed while the syntax for SQL query remains same. Here, unnecessarily we compile the same query multiple times. To avoid this, we have to use PreparedStatement.\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/span\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EWhat is \u003C\/span\u003E\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EPreparedStatement?\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; PreparedStatement is an Interface. Stament interface is extended in PreparedStament interface. \u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\n \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; Here \u003Cb\u003Esdldb\u003C\/b\u003E is the database name. User name is \u003Cb\u003Esdl\u003C\/b\u003E and password is \u003Cb\u003Esdl123\u003C\/b\u003E. This program is for inserting records (rows) into MySQL database table \u003Cb\u003Estudent\u003C\/b\u003E.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp; \u003C\/span\u003E\u003C\/div\u003E\n\u003Ca name='more'\u003E\u003C\/a\u003E\u003Cb style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003EProgram (JdbcInsertPS.java):\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Ctd\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;import java.sql.*;\u003Cbr \/\u003E\u003Cbr \/\u003Eclass JdbcInsertPS\u003Cbr \/\u003E{\u003Cbr \/\u003Epublic static void main(String args[]) throws Exception\u003Cbr \/\u003E{\u003Cbr \/\u003EClass.forName(\"com.mysql.jdbc.Driver\");\u003Cbr \/\u003EConnection con=DriverManager.getConnection(\"jdbc:mysql:\/\/localhost:3306\/sdldb\",\"sdl\",\"sdl123\");\u003Cbr \/\u003EPreparedStatement st=con.prepareStatement(\"insert into student values(?,?,?,?)\");\u003Cbr \/\u003Est.setInt(1,2301);\u003Cbr \/\u003Est.setString(2,\"SE\");\u003Cbr \/\u003Est.setString(3,\"COEP\");\u003Cbr \/\u003Est.setString(4,\"Pune\");\u003Cbr \/\u003E\u003Cbr \/\u003Eint i=st.executeUpdate();\u003Cbr \/\u003E\u003Cbr \/\u003Est.setInt(1,3301);\u003Cbr \/\u003Est.setString(2,\"TE\");\u003Cbr \/\u003Est.setString(3,\"SGGS\");\u003Cbr \/\u003Est.setString(4,\"Nanded\");\u003Cbr \/\u003E\u003Cbr \/\u003Eint j=st.executeUpdate();\u003Cbr \/\u003E\u003Cbr \/\u003EResultSet rs=st.executeQuery(\"select * from student\");\u003Cbr \/\u003Ewhile(rs.next())\u003Cbr \/\u003E{\u003Cbr \/\u003ESystem.out.print(rs.getString(1)+\" \");\u003Cbr \/\u003ESystem.out.print(rs.getString(2)+\" \");\u003Cbr \/\u003ESystem.out.print(rs.getString(3)+\" \");\u003Cbr \/\u003ESystem.out.print(rs.getString(4)+\" \");\u003Cbr \/\u003E\u003Cbr \/\u003ESystem.out.println(\"\\n\");\u003Cbr \/\u003E}\u003Cbr \/\u003E\u003Cbr \/\u003Ers.close();\u003Cbr \/\u003Est.close();\u003Cbr \/\u003Econ.close();\u003Cbr \/\u003E}\u003Cbr \/\u003E}\u003C\/span\u003E\u003C\/td\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv dir=\"ltr\" style=\"orphans: auto; text-align: left; text-indent: 0px; widows: 1;\" trbidi=\"on\"\u003E\n\u003Cdiv style=\"-webkit-text-stroke-width: 0px; color: black; font-family: \u0026quot;Times New Roman\u0026quot;; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px;\"\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Ctd\u003E\u003Cspan style=\"font-size: large;\"\u003Eparag@parag-Inspiron-N4010:~\/Desktop\/programs\/jdbc$ javac JdbcInsertPS.java \u003Cbr \/\u003Eparag@parag-Inspiron-N4010:~\/Desktop\/programs\/jdbc$ java JdbcInsertPS\u003Cbr \/\u003E1221 SE PICT Pune \u003Cbr \/\u003E\u003Cbr \/\u003E3221 TE VJTI Mumbai \u003Cbr \/\u003E\u003Cbr \/\u003E1201 se vjti mumbai \u003Cbr \/\u003E\u003Cbr \/\u003E3201 te coep Pune \u003Cbr \/\u003E\u003Cbr \/\u003E4201 be wce Sangli \u003Cbr \/\u003E\u003Cbr \/\u003E2301 SE COEP Pune \u003Cbr \/\u003E\u003Cbr \/\u003E3301 TE SGGS Nanded \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003C\/td\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003Cdiv\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"font-family: \u0026quot;times new roman\u0026quot;; font-size: large;\"\u003ECheck jdbc code for fetching data from database in this post:\u0026nbsp;\u003C\/span\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-retrieve-data-from-mysql-database.html\" style=\"font-family: \u0026quot;Times New Roman\u0026quot;; font-size: x-large;\" target=\"_blank\"\u003Ehttp:\/\/www.comrevo.com\/2017\/07\/jdbc-code-to-retrieve-data-from-mysql-database.html\u003C\/a\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003Cdiv style=\"text-align: center;\"\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Ccenter\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Cth\u003E\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2016\/09\/database.html\" target=\"_blank\"\u003ECheck Other Posts on Database\u003C\/a\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003C\/th\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003C\/center\u003E\n\u003C\/div\u003E\n\u003Cdiv style=\"margin: 0px;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/9192667777190529616\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/java-mysql-insert-example-using-prepared-statement.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/9192667777190529616"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/9192667777190529616"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/java-mysql-insert-example-using-prepared-statement.html","title":"Java MySQL Insert Example using Prepared Statement"}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https:\/\/img.youtube.com\/vi\/S6mJpp5Dg7c\/default.jpg","height":"72","width":"72"},"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-913600556879440043.post-7747742382264790720"},"published":{"$t":"2019-07-16T14:11:00.000+05:30"},"updated":{"$t":"2019-07-16T14:18:05.815+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Database"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Mysql"},{"scheme":"http://www.blogger.com/atom/ns#","term":"SQL"}],"title":{"type":"text","$t":"Solution for Mysql error: access denied for user 'root'@'localhost' "},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; In this post, we will see solution for the mysql error \u003Cb\u003Eaccess denied for user 'root'@'localhost'\u003C\/b\u003E\u003C\/span\u003E.\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Ca name='more'\u003E\u003C\/a\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; After installing Mysql in linux (In Ubuntu, by running command sudo apt-get install mysql-server), when we open mysql by running following command\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Emysql -u root -p\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; We may get error \u003Cb\u003Emysql access denied for user 'root'@'localhost'\u003C\/b\u003E.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; There are many solutions available on net. Best solution I found is as follows:\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003ERun following command in terminal:\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003Esudo mysql\u003C\/span\u003E\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/b\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';\u003C\/b\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; It works for me. Hope it will helpful for you. It changes mysql root password to \u003Cb\u003Eroot\u003C\/b\u003E.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003EThanks a lot.\u003C\/span\u003E\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/7747742382264790720\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/mysql-access-denied-for-user-root-at-localhost.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/7747742382264790720"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/7747742382264790720"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/2019\/07\/mysql-access-denied-for-user-root-at-localhost.html","title":"Solution for Mysql error: access denied for user 'root'@'localhost' "}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-913600556879440043.post-8428938104244973470"},"published":{"$t":"2017-01-03T16:01:00.004+05:30"},"updated":{"$t":"2017-08-31T09:25:59.690+05:30"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Java"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Mysql"},{"scheme":"http://www.blogger.com/atom/ns#","term":"SQL"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Website Designing"}],"title":{"type":"text","$t":"How to insert and retrieve image from mysql database in jsp"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; In this post, we will see how to insert and retrieve image from mysql database in jsp.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; Here, frontend and backend programs are in JSP while database used is Mysql. Database name is \"test\", Database user name is also \"test\" and password is \"123\". Table name in which I have inserted image here, is \"biodata\". Table's configuration is shown in following screenshot:\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003C\/span\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cbr \/\u003E\n\u003Ca name='more'\u003E\u003C\/a\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003C\/span\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cbr \/\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003C\/div\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003Ca href=\"https:\/\/4.bp.blogspot.com\/-T7JvskHckKU\/WGt6N7ggGqI\/AAAAAAAADMk\/YGE-0HnuEwkHXffVkANhQM8YR_sROVK1ACLcB\/s1600\/biodata%2Bimage.jpeg\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cimg border=\"0\" height=\"201\" src=\"https:\/\/4.bp.blogspot.com\/-T7JvskHckKU\/WGt6N7ggGqI\/AAAAAAAADMk\/YGE-0HnuEwkHXffVkANhQM8YR_sROVK1ACLcB\/s640\/biodata%2Bimage.jpeg\" width=\"640\" \/\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cb\u003Euploadimage.jsp\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"background: lightgreen;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ page language=\"java\" contentType=\"text\/html; charset=ISO-8859-1\"\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; pageEncoding=\"ISO-8859-1\"%\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\"\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;html\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=ISO-8859-1\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;title\u0026gt;Image Upload to MySQL Database Demo\u0026lt;\/title\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;body\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp;\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;h1\u0026gt;Image Upload to MySQL Database Demo\u0026lt;\/h1\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;form method=\"post\" action=\"uploadimagebackend.jsp\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;table border=\"0\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;First Name: \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"firstname\" size=\"50\"\/\u0026gt;\u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;Last Name: \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"lastname\" size=\"50\"\/\u0026gt;\u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;Path of Image on Disk: \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"photo\" size=\"50\"\/\u0026gt;\u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td colspan=\"2\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;input type=\"submit\" value=\"Submit\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/table\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/form\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp;\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/body\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003C\/span\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/html\u0026gt;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003Ca href=\"https:\/\/1.bp.blogspot.com\/-oM57mNe1qP4\/WGt8IcavGjI\/AAAAAAAADMw\/8z7R88w79b0CUWEKIxv5rMtPQkJX1A6AgCLcB\/s1600\/uploadimage.jpeg\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cimg border=\"0\" src=\"https:\/\/1.bp.blogspot.com\/-oM57mNe1qP4\/WGt8IcavGjI\/AAAAAAAADMw\/8z7R88w79b0CUWEKIxv5rMtPQkJX1A6AgCLcB\/s1600\/uploadimage.jpeg\" \/\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\u003C\/span\u003E\n\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u003Cb\u003Euploadimagebackend.jsp\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"background: lightgreen;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;%@ page import=\"java.io.*,java.util.*,java.sql.*\"%\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ page import=\"javax.servlet.http.*,javax.servlet.*\" %\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ taglib uri=\"http:\/\/java.sun.com\/jsp\/jstl\/core\" prefix=\"c\"%\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ taglib uri=\"http:\/\/java.sun.com\/jsp\/jstl\/sql\" prefix=\"sql\"%\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;html\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;body\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;div style=\"background-color:SlateGray\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;h1\u0026gt;Image Upload to MySQL Database Demo\u0026lt;\/h1\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/div\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;%\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EString firstname = request.getParameter(\"firstname\");\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EString lastname = request.getParameter(\"lastname\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EString myphoto = request.getParameter(\"photo\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EConnection con=null;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EResultSet rs=null;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EPreparedStatement psmt=null;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EFileInputStream fis;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EString url=\"jdbc:mysql:\/\/localhost:3306\/test\";\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Etry{\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Econ=DriverManager.getConnection(url,\"test\",\"123\");\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EFile image=new File(myphoto);\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Epsmt=con.prepareStatement(\"insert into biodata(firstname, lastname, photo)\"+\"values(?,?,?)\");\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Epsmt.setString(1,firstname);\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Epsmt.setString(2,lastname);\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Efis=new FileInputStream(image);\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Epsmt.setBinaryStream(3, (InputStream)fis, (int)(image.length()));\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Eint s = psmt.executeUpdate();\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Eif(s\u0026gt;0) {\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E%\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;b\u0026gt;\u0026lt;font color=\"Blue\"\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;% out.println(\"Image Uploaded successfully!!!\"); %\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;\/font\u0026gt;\u0026lt;\/b\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;%\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E}\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Eelse\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eout.println(\"Failed to upload image.\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Econ.close();\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Epsmt.close();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E}\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Ecatch(Exception ex)\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eout.println(\"Error in connection : \"+ex);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E%\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;\/body\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/html\u0026gt;\u0026nbsp;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003Ca href=\"https:\/\/1.bp.blogspot.com\/-5GxfASIU40k\/WGt8pCog2sI\/AAAAAAAADM4\/T8ol-Gup_3ExCz5QyTVsPcg5Qxjjx-vBwCLcB\/s1600\/uploadimagebackend.jpeg\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cimg border=\"0\" src=\"https:\/\/1.bp.blogspot.com\/-5GxfASIU40k\/WGt8pCog2sI\/AAAAAAAADM4\/T8ol-Gup_3ExCz5QyTVsPcg5Qxjjx-vBwCLcB\/s1600\/uploadimagebackend.jpeg\" \/\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u003Cb\u003Edisplayimage.jsp\u003C\/b\u003E\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"background: lightgreen;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ page language=\"java\" contentType=\"text\/html; charset=ISO-8859-1\"\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; pageEncoding=\"ISO-8859-1\"%\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\"\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;html\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=ISO-8859-1\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;title\u0026gt;Image Upload to MySQL Database Demo\u0026lt;\/title\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;body\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp;\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;form method=\"post\" action=\"displayimagebackend.jsp\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;table border=\"0\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;First Name: \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"firstname\" size=\"50\"\/\u0026gt;\u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;Last Name: \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"lastname\" size=\"50\"\/\u0026gt;\u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;td colspan=\"2\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;input type=\"submit\" value=\"Show Image\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/td\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/tr\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/table\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026lt;\/form\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026nbsp; \u0026nbsp;\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/body\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/html\u0026gt;\u0026nbsp;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003C\/div\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003C\/div\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003Ca href=\"https:\/\/4.bp.blogspot.com\/-bPJG_6bqqPw\/WGuCIhPGuwI\/AAAAAAAADNc\/CVsNN9xSj-Q69UbKnZBB8ZckUjyPib2gwCLcB\/s1600\/displayimage.jpeg\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cimg border=\"0\" src=\"https:\/\/4.bp.blogspot.com\/-bPJG_6bqqPw\/WGuCIhPGuwI\/AAAAAAAADNc\/CVsNN9xSj-Q69UbKnZBB8ZckUjyPib2gwCLcB\/s1600\/displayimage.jpeg\" \/\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\u003C\/span\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003Edisplayimagebackend.jsp\u003C\/b\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"background: lightgreen;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;%@ page import=\"java.io.*,java.util.*,java.sql.*\"%\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ page import=\"javax.servlet.http.*,javax.servlet.*\" %\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ taglib uri=\"http:\/\/java.sun.com\/jsp\/jstl\/core\" prefix=\"c\"%\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;%@ taglib uri=\"http:\/\/java.sun.com\/jsp\/jstl\/sql\" prefix=\"sql\"%\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;html\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/head\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;body\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;div style=\"background-color:SlateGray\"\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/div\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;%\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EString firstname = request.getParameter(\"firstname\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EString lastname = request.getParameter(\"lastname\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003EBlob image = null;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EConnection con = null;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ebyte[] imgData = null ;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EStatement stmt = null;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EResultSet rs = null;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Etry\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EClass.forName(\"com.mysql.jdbc.Driver\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Econ = DriverManager.getConnection(\"jdbc:mysql:\/\/localhost:3306\/test\",\"test\",\"123\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Estmt = con.createStatement();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ers = stmt.executeQuery(\"select photo from biodata where firstname=\"+\"'\"+firstname+\"'\"+\" \u0026amp;\u0026amp; \"+\"lastname=\"+\"'\"+lastname+\"'\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Eif (rs.next())\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eimage = rs.getBlob(1);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EimgData = image.getBytes(1,(int)image.length());\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Eelse\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eout.println(\"Image not found.\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ereturn;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\/\/ display the image\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Eresponse.setContentType(\"image\/gif\");\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003EOutputStream o = response.getOutputStream();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eo.write(imgData);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eo.flush();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eo.close();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E}\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Ecatch (Exception e)\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eout.println(\"Unable To Display image\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Eout.println(\"Image Display Error=\" + e.getMessage());\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ereturn;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Efinally\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Etry\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ers.close();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Estmt.close();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Econ.close();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003Ecatch (SQLException e)\u0026nbsp;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003Ee.printStackTrace();\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E}\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E}\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E%\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: medium;\"\u003E\u0026lt;\/body\u0026gt;\u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u0026lt;\/html\u0026gt;\u0026nbsp;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cb\u003EOutput:\u003C\/b\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003E\n\u003Ca href=\"https:\/\/1.bp.blogspot.com\/-mh9jz0roztM\/WGt9fRqn0JI\/AAAAAAAADNE\/AJp8o1BaFPQ_Of5UAhE7iJHfKQQgGp2cACLcB\/s1600\/displayimagebackend.jpeg\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"\u003E\u003Cspan style=\"font-size: large;\"\u003E\u003Cimg border=\"0\" src=\"https:\/\/1.bp.blogspot.com\/-mh9jz0roztM\/WGt9fRqn0JI\/AAAAAAAADNE\/AJp8o1BaFPQ_Of5UAhE7iJHfKQQgGp2cACLcB\/s1600\/displayimagebackend.jpeg\" \/\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: center;\"\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cspan style=\"font-size: medium;\"\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2016\/08\/web-designing.html\" target=\"_blank\"\u003E\u003Cb\u003E\u003C\/b\u003E\u003C\/a\u003E\u003C\/span\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003Cbr \/\u003E\n\u003Ccenter\u003E\n\u003Ctable border=\"1\"\u003E\u003Ctbody\u003E\n\u003Ctr\u003E\u003Cth\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2016\/08\/web-designing.html\" target=\"_blank\"\u003E\u003Cspan style=\"font-size: large;\"\u003ECheck Other Posts on Web Designing\u003C\/span\u003E\u003C\/a\u003E\u003C\/th\u003E\u003C\/tr\u003E\n\u003C\/tbody\u003E\u003C\/table\u003E\n\u003C\/center\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Ca href=\"http:\/\/www.comrevo.com\/2016\/08\/web-designing.html\" target=\"_blank\"\u003E\u003Cb\u003E\u003C\/b\u003E\u003C\/a\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cspan style=\"font-size: large;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comrevo.com\/feeds\/8428938104244973470\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comrevo.com\/2017\/01\/how-to-insert-and-retrieve-image-from-mysql-database-in-jsp.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/8428938104244973470"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/913600556879440043\/posts\/default\/8428938104244973470"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comrevo.com\/2017\/01\/how-to-insert-and-retrieve-image-from-mysql-database-in-jsp.html","title":"How to insert and retrieve image from mysql database in jsp"}],"author":[{"name":{"$t":"Parag Jambhulkar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/13991750622483538113"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https:\/\/4.bp.blogspot.com\/-T7JvskHckKU\/WGt6N7ggGqI\/AAAAAAAADMk\/YGE-0HnuEwkHXffVkANhQM8YR_sROVK1ACLcB\/s72-c\/biodata%2Bimage.jpeg","height":"72","width":"72"},"thr$total":{"$t":"0"}}]}});