Java JDBC Tutorial – Part 12.2: Connect Java Swing GUI to a MySQL Database – Create the DAO




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


28 responses to “Java JDBC Tutorial – Part 12.2: Connect Java Swing GUI to a MySQL Database – Create the DAO”

  1. Hi, thankyou verymuch for this clear tutorial.
    however, i got some error in Getting all Employee method and search account method saying : "The type List is not generic; it cannot be parameterized with argument <Employee>

    how can i fix this…?

    Thank in advance…

  2. Sir sorry to bother u again, we are trying to learn (DAO) without GUI but in console only ( simple ), but we can't find real good sources to learn from. Do you have such a sources in your channel? or any other sources out of your channel?
    thx.

  3. very nice tutorial , i also subscribed. I have problem my database uses hashed password and salt. How do authorize user (i have member table with entity name, hashed_password and hashed_salt) if it is not plain text passwod? I can't find any tutorial hope you can help me.

  4. When I Run Your Code on my eclipse, in the following lines, error shows…
    as:

    code : public List < Employee > getAllEmp() throws Exception {
    List<Employee> list = new ArrayList();

    error shows: ” The type List is not generic.it cant be parameterized with arguments

    code:public List<Employee> searchEmp(String lastName) throws Exception {

    List<Employee> list = new ArrayList();
    error shows : as same as before..

    what should i do now?

    TIA

  5. Hi, why did you use BigDecimal for salary? And for example if create a program similar to this, like a game or sth and if it's downloadable online or it can be installed on several computers.. So a specific user has a specific login and password, therefore it can be either an admin or a regular user, but whenever the user clicks a button to begin a search or login, the program has to send a query to the database and deep in the code it uses login and pass of my DB, so basically everyone has an access to it and the question is how can I protect it properly?

  6. Beautiful Display of a level of profound insight so high it got me watching numerous times. Only, or perhaps not only (lol), i kept watching it because after i create my DAO i get these SQL Exception errors 

    —-> Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mydb
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at StudentDAO.<init>(StudentDAO.java:28)
    at StudentDAO.main(StudentDAO.java:116)<——–

    my driver is appropriately set up, embedded into the right build path, but i am still getting hell's flames! What must i do??? Save us one from Krypton, or at least please save me! haha

  7. hello, i'm developing a university project and instead of getting my data from a database, I will work with a web service, but still i need to perform the crud. Do you think it is a good idea still use DAO in this case?

  8. Thank you very much for these great tutorials.

    May I ask you a question? 
    I am beginner in jdbc as in sql,
     I need to scan two databases which includes some tables. 

    And after,   need to create a Database with one table( Did it)

     and then, fill in this table all info about previous two dbs, namely: the name of db, name of relations, Field name, an indication if the attribute is part of the primary key  and so on.

    Should I use a ResultSetMetaData or write Constructor and do this task as you did in this tutorial?

    Many Tanks.
    BEST Regards.

Leave a Reply