Java and JDBC tutorial #3: Insert record

preview_player
Показать описание
If you have any question, leave it in comment section below.

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

I don't understand your question? Can you explain?

OverG
Автор

Did you try by downloading project from GitHub (you have a link in the description)? Altough, I suspect only on one cause: You are not assigning any value to firstName variable. If you pass Person instance into insert method by previously creating Person instance like this: Person person = new Person("John", "Smith"); then your error is probably in body of constructor in Person class. Check whether this.firstName = firstName; exists.

OverG
Автор

I need a question, for each table i need create a dao, daoimpl and entity?? if that the same sequence of the MVC methodology??? your videos are great!!

franciscocuerno
Автор

I have a question, Do we really need to surround every line of code witch try/catch/finally or are we doing this the outdated way and there is simpler way ? :d

tornikeshelia
Автор

tutorial.. but m getting this kind of


WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Table 'person' already exists
at Method)
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at com.company.App.main
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

insert into person(fname, lname)values(?, ?)

charu