Java JDBC Tutorial – Part 2: Insert Data into a MySQL Database




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”

  1. 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

  2. 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

  3. 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!

  4. 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)

  5. 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.

  6. 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?

  7. 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?

  8. 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 🙂

  9. 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.

  10. 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)

Leave a Reply