Registration with image upload Java Jdbc(Download Source code) | Part 4
3K views
Apr 8, 2025
Registration with image upload Java Jdbc(Download Source code) | Part 4 Learn how to upload an image using Java and JDBC in just seconds! In this tutorial, we'll show you a step-by-step guide on how to upload an image to a database using Java and JDBC. Whether you're a beginner or an experienced developer, this video is perfect for anyone looking to learn how to upload images quickly and efficiently. We'll cover the necessary code and provide explanations to help you understand the process. By the end of this video, you'll be able to upload images in no time!.prodive free source codes. #javaswing#javaproject
View Video Transcript
0:00
hi friends welcome to torning channel
0:02
last class we have completed the things
0:05
of this okay browse bar okay how to work
0:08
with the browse button uh let me
0:10
continue the rest of the part now what
0:13
you're going to do is I'm going to add
0:14
the record to the database okay so first
0:16
I'm going to create the database so go
0:18
to the Zam open on the Zam server click
0:22
Start click
0:23
Start click at me
0:34
this is your admin dashboard now I'm
0:36
going to create
0:38
new this one I going to name it
0:41
as
0:47
uh o s OA this is a just
0:53
company okay I just give the name OS
0:56
this a database I upated inside the
0:59
database what are the 1 2 3 4 5
1:04
6 seven column you have to created along
1:06
with eight columns along with the ID you
1:09
have create as eight
1:11
columns this one should be the
1:23
registration first one is ID
1:30
primary
1:32
key second is
1:35
a first
1:44
name last
1:52
name gender
2:01
mail or femail after that we have to get
2:05
the
2:11
Department address
2:16
Department
2:22
address Department
2:32
salary
2:39
photo
2:42
right these are the column these are the
2:45
respective data okay so we have to we
2:48
are going to create this one click save
2:52
button it has been created successfully
2:54
you will be able to see it has been
2:56
created
2:57
successfully MyQ
3:00
perfect we have done the perfect job
3:02
right now so what you're going to do is
3:05
now I'm going to go
3:07
to uh you
3:19
see okay now what I'm going to do this
3:22
I'm going to go to do the save bar Save
3:25
Part okay before that I'm going to uh
3:29
this project the project we have to add
3:31
the
3:33
MySQL uh Library so that is
3:35
importantance of if you are not install
3:37
the MySQL jar file you want in order to
3:42
connect our uh Zam this is our s mySQL
3:47
database along with my net beans we need
3:50
a driver that now I'm going to type
3:54
myql
3:58
jar click on on
4:02
this select the operating system we get
4:05
platform independent okay select as
4:08
platform independent this you have
4:11
download okay you have select the
4:13
operating system which you need if you
4:14
are Mac User you can select as a m okay
4:17
so here okay so here platform simply
4:20
select platform inde it will be support
4:22
everything okay platform independ that
4:25
means whatever oper system it will be
4:27
supported you can whether you can use it
4:30
uh Linux or Mac or anything okay it will
4:36
uh supported put the
4:38
special user you can go along with this
4:42
so I'm going to go along with this one
4:44
myl connector so I have click no TXS
4:47
okay you C just click no TXS and you
4:50
click no no TS and just start my if you
4:52
click on this link you down download has
4:55
been begin so I already installed the I
4:58
already downloaded so I'm WR import
5:00
select the library file folder add jar
5:03
folder select this one my SQL connector
5:07
open it's open successfully here now I
5:11
will be able to connect so I'm going to
5:13
go to the
5:15
source so first I'm going what you're
5:17
going to do is implement the name space
5:20
so import name import Java
5:24
dot
5:27
SQL Dot
5:31
now if you write the SQL all you will be
5:35
able
5:35
to write all the classes based on SQL
5:39
okay so you have to write this
5:41
connection this is a class which is
5:43
deide on the
5:47
SQL we have to prepare
5:56
statement PD this all reside on that
6:02
okay now I'm going to establish the
6:04
connection so this is the connection
6:06
this all the things I will give you this
6:09
codes
6:19
simply right
6:27
here you can see here
6:30
here we have write here simply
6:38
system
6:49
out
6:54
prer here you have write this one ex
6:59
here whatever your error you got it here
7:02
okay so here this is a connection method
7:04
I have read Connection open and close it
7:07
so here the inside the try and catch if
7:09
the error will be occur while the cing
7:14
the catch will be getting the catch will
7:17
be saying what kind of error you are
7:19
getting on the try that's the purpose of
7:21
your writing the try and get very easily
7:25
identify that in order to easily
7:26
identify the error okay so where the
7:28
error is coming from the database path
7:31
or driver there are so many things okay
7:34
after the user credential and everything
7:36
so so here what I did here string driver
7:41
so my this is a new way to implement the
7:43
driver of my my driver you have register
7:46
using com MySQL CJ jdbc
7:50
driver the URL path where you have Rec
7:53
in
7:54
your uh database my database reside on
7:57
the Zam is a database so you have to PA
8:00
this is the port where my database is
8:02
running uh
8:05
3306 my database name which is a you
8:08
mention the name of the database which
8:09
is a OS this a name okay so this is a
8:13
part after that the user credential when
8:15
you install the MySQL the if you install
8:18
the Zam server default without changing
8:20
the username and password default
8:21
username and password root is a username
8:23
default username password is black this
8:25
a user credential of MySQL okay so this
8:30
is this is a very important stuff you
8:31
have to remember okay this is very
8:33
important stuff this is when you
8:35
register the driver after that you have
8:37
to select the path where your database
8:39
is resided after that you have to tell
8:41
them the username and password of the
8:43
DAT uh your
8:45
database okay after that you have a
8:48
class phone
8:49
name what is the this is the driver you
8:52
have to assign this driver this driver
8:53
you have given here class. name here you
8:56
have registered after you have given the
8:58
path driver manager get connection this
9:01
is the URL your part decided this is the
9:03
user username and password after this
9:06
all that
9:07
correct the message is coming database
9:10
connected successfully let's run and
9:13
check okay you go to the console and
9:17
check okay it's not coming because this
9:20
is a Constructor you have this one you
9:21
have copy this you call inside the
9:24
Constructor of the class we how to find
9:27
the Constructor the same name of the
9:29
class the method name should be there
9:31
it's called as Constructor when the
9:34
class is running the Constructor is
9:36
running first okay so you have write
9:39
this
9:40
this okay the same name of the class the
9:43
method name should be same it's called
9:45
as
9:47
construct here the databas is connect
9:50
you can get the message of databas is
9:51
connect now your programming is running
9:53
successful keep in your thank you for
9:56
watching I'll be get touch with in my
9:57
next video tutorial than
#Java (Programming Language)