NEED TO LEARN JAVA? – 5 FREE JAVA VIDEO COURSES – CLICK HERE – https://goo.gl/7i95F8 — View more videos on my “Java JDBC Tutorial” Playlist: …
Original source
NEED TO LEARN JAVA? – 5 FREE JAVA VIDEO COURSES – CLICK HERE – https://goo.gl/7i95F8 — View more videos on my “Java JDBC Tutorial” Playlist: …
Original source
32 responses to “Java JDBC Tutorial – Part 2: Insert Data into a MySQL Database”
very great video but please sir i am a little confused here i am wonderng if i have to create a connection each time i wwant to update, delete , add and read value?
thankyou
Hi, i have couple of questions?
1. where to load driver because without loading driver don't know how it's working? like: using class.forName(" ");
2.without closing jdbc objects it will work but it will give poor performance, so you haven't closed the jdbc objects, please tell me about this in details, please…thank you
Hello Sr How are you? Thanks for helping Do you have a tutorial as JDBC how to work with JSP file?
awesome! very helpful.
Hi!
Question: let's say I want to make several insertions into different tables. Do I need to close connection between these insertions, or only at the end of it all?
Error: Could not find or load main class com.mysql.jdbc.DocsConnectionPropsHelper.
Hi Sir, I must say that your videos are damn helpful for every student thank you so much for your kind help. sir I have a problem in my project, its not connecting with the database it show,(java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)
java.lang.NullPointerException) . what is the user name and password I don't know please help me asap to resolve this , its very important for me… @luv2code
Hey, did you know your videos are used by schools? They're really helpful, much better than what my actual teacher is trying to teach me as well. Thank you for the very elaborate but also very thorough and clear videos on how to use this. Also really appreciate the dedication you seem to have to responding to questions by your viewers. Very admirable.
Also HU represent!
im getting this error please help
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/demo","root","root;");
Tue Apr 18 10:36:18 SGT 2017 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.
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
I use textfields and button for my registration form or in short i have gui for inserting data in my database anyone have code for that?
mkay?
My problem
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.
where does the id come from … you did not insert id with the values
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
Sir this exception is showing..what should i do?
@luv2code
what if the user wants it own data to get inserted.
like in output he can entered the desired input and that data gets inserted
don't we need to close the connection?that is myConn.close
sir do you how to make connection to database using web.xml only?
Hello sir, Could you please give me an example about how it would work if I had a foreign key? I have a postgres BD and I'm trying to do it with JDBC ,but got stucked trying to do it… Congrats for the initiative… 😉
how do i put the put the driver to access the database with java on the same classpath using notepad++
hi chad,
i have 2 questions.
1. what doin these try{} catch(){} functions? and the 2. for what is this exc.printStackTrace();???
This helps so much! Thank you!
You sir, made it really easy! Awesome narration! Thanks and cheers! 🙂
Hi sir , what should I put on user and password in the connection part ?
Your videos helped me a lot . Thanks sir
It's really helpful to me sir. The tutorial is comprehensible and simple. Thank you for this. Keep up.
I think we don't need to download Connector/J since it's already included in the MySQL Workbench installation. Am I right?
How do you automatically insert ID? I made the same app and have to do thing like this:
String sql = "insert into shop" + "(Name, Adress, Phone, ID_Shop)" + "values('xxx', 'xxx', '111111111', '6')";
Something like this doesn't work:
String sql = "insert into shop" + "(Name, Adress, Phone)" + "values('xxx', 'xxx', '111111111')";
I guess it's about default value of ID. But how and where can I set it?
Anyway, thanks for your lessons, they are great and very useful 🙂
How do I create a table in the database if I have data in a LinkedHashMap? I am not sure how the keys/ids are assigned?
sir i am using geany in my laptop we are programming mysql but we are acceptable to use only JOptioPAne what should i do?? pls help
awesome tutorials … loved ur explainations.. 🙂
Hello. Im using Python to make a program and I want to connect to MYSQL. I have installed MySQL 5.7 but when I try to connect it with Python it says this error: SSL connection required but not supported by server.
can i make this with scanner to input the data in console ?
I've added the driver but im getting this error what should i do?
java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
at com.mysql.jdbc.StatementImpl.checkForDml(StatementImpl.java:465)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1325)
at ariandb.ariandb.main(ariandb.java:19)
Good Lesson, Thank you. B