• Monday , 16 October 2017

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

Code Canyon



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

3d Ocean

Related Posts

28 Comments

  1. Silent ass
    October 8, 2017 at 19:30

    it shows an error saying "employee cannot resolved to a type".. what am doing wrong?

  2. Patrick Enriquez
    October 8, 2017 at 19:30

    pls don't get mad sir but where can i find that demo.properties file? i skipped through here because my program has gui

  3. jerome garcia
    October 8, 2017 at 19:30

    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…

  4. Nikita Chizhik
    October 8, 2017 at 19:30

    thanks. nice explanation.

  5. Dz Explorer
    October 8, 2017 at 19:30

    Hi , can you explain me " Lastname+="%" "commande please ?

  6. Krizza Padilla
    October 8, 2017 at 19:30

    okay i'll try that. i have this kind of project where in i have to make a library system. and this can help a lot. thanks

  7. Krizza Padilla
    October 8, 2017 at 19:30

    i get an error which is index parameter

  8. Dawid Popiołkiewicz
    October 8, 2017 at 19:30

    Hi, I Have problem with one method: convertRowToEmployee(myRs);
    I dont know where I can find it…
    Somebody can explain it ?

  9. ThePersBoy
    October 8, 2017 at 19:30

    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.

  10. rsentrepreneur
    October 8, 2017 at 19:30

    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.

  11. Parth Mehta
    October 8, 2017 at 19:30

    Hi. I can not get the code from the link given. Can you please share?

  12. Kamdem Kakengne
    October 8, 2017 at 19:30

    Hi! How do the methods convertRowtoEmployee() and close() works. Thank you

  13. tomek200152
    October 8, 2017 at 19:30

    Hey i would like ask you about "lastName+="%"; everything works but i don't understand only this one line could you tell me how it work?

  14. joy chowdhury
    October 8, 2017 at 19:30

    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

  15. William Go
    October 8, 2017 at 19:30

    Hi Chad, why do we make use of the Properties object if we can define the values directly as string values? Thanks.

  16. Sadnan Saquif
    October 8, 2017 at 19:30

    Hey thanks a lot for the videos. Also if I am using JavaFX instead of Swing is there a lot of difference in the way we would implement it?

  17. luv2code
    October 8, 2017 at 19:30

    @Anime Adam: I didn't use JPA because I wanted to keep the example simple.

  18. Amine ESS
    October 8, 2017 at 19:30

    Great Job but i would like to ask you why you did not use JPA to get access to the database ?

  19. Gud Jac
    October 8, 2017 at 19:30

    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?

  20. Tlotliso Monaheng
    October 8, 2017 at 19:30

    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

  21. luv2code
    October 8, 2017 at 19:30

    @MarvinSantiago: I don't have any videos on Oracle triggers. But here are some docs for Triggers Functions with Oracle.

    http://blog.mclaughlinsoftware.com/java-programming/java-trigger-sample/

    http://docs.oracle.com/html/B10108_01/jdgwork.htm

    Let me know if you need anything else.

  22. Marvin Santiago
    October 8, 2017 at 19:30

    Hi do you have a tutorial on how to add Triggers Functions and Exceptions to a Java thats connected to an Oracle Database ? thank you in advance

  23. Suraj Wankhade
    October 8, 2017 at 19:30

    Create DAO

  24. SELENE REYES
    October 8, 2017 at 19:30

    THANKYOU!!!

  25. Rakib Al Hasan
    October 8, 2017 at 19:30

    hello, i tried to access your website to download this source code. but i can't reach.
    how can i get your source code can you tell me please.
    thank you.

  26. Ricardo Araújo
    October 8, 2017 at 19:30

    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?

  27. green hat
    October 8, 2017 at 19:30

    how to make that folder below lib and what to do with that

  28. Nikita Filimonov
    October 8, 2017 at 19:30

    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 Comment

You must be logged in to post a comment.