Java prog#14.How to Insert/Save data from netbeans java into database Sqlite (MySql)

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • ★★★Top Online Courses From ProgrammingKnowledge ★★★
    Python Programming Course ➡️ bit.ly/2vsuMaS ⚫️ bit.ly/2GOaeQB
    Java Programming Course ➡️ bit.ly/2GEfQMf ⚫️ bit.ly/2Vvjy4a
    Bash Shell Scripting Course ➡️ bit.ly/2DBVF0C ⚫️ bit.ly/2UM06vF
    Linux Command Line Tutorials ➡️ bit.ly/2IXuil0 ⚫️ bit.ly/2IXukt8
    C Programming Course ➡️ bit.ly/2GQCiD1 ⚫️ bit.ly/2ZGN6ej
    C++ Programming Course ➡️ bit.ly/2V4oEVJ ⚫️ bit.ly/2XMvqMs
    PHP Programming Course ➡️ bit.ly/2XP71WH ⚫️ bit.ly/2vs3od6
    Android Development Course ➡️ bit.ly/2UHih5H ⚫️ bit.ly/2IMhVci
    C# Programming Course ➡️ bit.ly/2Vr7HEl ⚫️ bit.ly/2W6RXTU
    JavaFx Programming Course ➡️ bit.ly/2XMvZWA ⚫️ bit.ly/2V2CoAi
    NodeJs Programming Course ➡️ bit.ly/2GPg7gA ⚫️ bit.ly/2GQYTQ2
    Jenkins Course For Developers and DevOps ➡️ bit.ly/2Wd4l4W ⚫️ bit.ly/2J1B1ug
    Scala Programming Tutorial Course ➡️ bit.ly/2PysyA4 ⚫️ bit.ly/2PCaVj2
    Bootstrap Responsive Web Design Tutorial ➡️ bit.ly/2DFQ2yC ⚫️ bit.ly/2VoJWwH
    MongoDB Tutorial Course ➡️ bit.ly/2LaCJfP ⚫️ bit.ly/2WaI7Ap
    QT C++ GUI Tutorial For Beginners ➡️ bit.ly/2vwqHSZ
    ★★★ Online Courses to learn ★★★
    Get 2 FREE Months of Unlimited Classes from skillshare - skillshare.eqcm.net/r1KEj
    Data Science - bit.ly/2lD9h5L | bit.ly/2lI8wIl
    Machine Learning - bit.ly/2WGGQpb | bit.ly/2GghLXX
    Artificial Intelligence - bit.ly/2lYqaYx | bit.ly/2NmaPya
    MERN Stack E-Degree Program - bit.ly/2kx2NFe | bit.ly/2lWj4no
    DevOps E-degree - bit.ly/2k1PwUQ | bit.ly/2k8Ypfy
    Data Analytics with R - bit.ly/2lBKqz8 | bit.ly/2lAjos3
    AWS Certification Training - bit.ly/2kmLtTu | bit.ly/2lAkQL1
    Projects in Java - bit.ly/2kzn25d | bit.ly/2lBMffs
    Machine Learning With TensorFlow - bit.ly/2m1z3AF | bit.ly/2lBMhnA
    Angular 8 - Complete Essential Guide - bit.ly/2lYvYRP
    Kotlin Android Development Masterclass - bit.ly/2GcblsI
    Learn iOS Programming Building Advance Projects - bit.ly/2kyX7ue
    ★★★ Follow ★★★
    My Website - www.codebind.com
    DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
    netbeans java tutorial
    how to insert data from netbeans into database
    Insert information into a MySQL database - NetBeans - Java
    Insert Data Into Mysql Database Using Netbeans
    Insert Data Of Textfields In Database "netbeans"‎
    Insert Data Into Database Using Netbeans
    to insert, update and delete new data into mysql database using jbutton.
    How to insert data into database
    how to insert java.sql.data into database
    sql - Java Date - Insert into database
    How to Insert Data into a table in mysql database
    insert values in table,JDBC Insert Row
    JDBC program to insert data into mysql database from java netbeans
    iit Learn java netbeans
    java tutorial netbeans

Komentáře • 131

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  Před 12 lety

    I think u have directly seen this video.....please first 4 videos in which i have shown how to make a connection with the database e.g sql ...pst=conn........is the connection statement so u first need to establish connection with database ......please see first 4 videos and if any doubt then ask me................

  • @vitalcode4187
    @vitalcode4187 Před 12 lety

    you explain things simply and it helps us to understand the concepts quiet easily...Thanks for all your effort...keep it up Sir,,,

  • @viplavist
    @viplavist Před 7 lety

    thank you very much! Its because of your channel i created my netbeans project

  • @portugalgamermanel3404
    @portugalgamermanel3404 Před 9 lety +1

    thank you so mutch... just what i was looking for... ;)

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  Před 12 lety

    can u show me ur code .are u using arrey.......your trying to access an array index that is outside the bounds of its size.

  • @kamalkant5324
    @kamalkant5324 Před 9 lety +2

    When i am inserting data into my table it is showing exception that (sql query does not return result).... please help me solving this

  • @MinulWimalagunaratne
    @MinulWimalagunaratne Před 9 lety +17

    pst =conn.prepareStatement(sql);
    do i have to import anything for this line to work?

  • @frank3589
    @frank3589 Před 11 lety +1

    I ran into this problem doing some testing. You problem is when you set your Strings, with the indexes you are using.

  • @mellanoche
    @mellanoche Před 6 lety

    I'm trying to figure out where the connectivity is, you know, where do I used the JDBC .

  • @1229shakirali
    @1229shakirali Před 12 lety

    Allot of Thanks brother for this reply. i will always subscribe your channel. thanks again.

  • @TheMefimefi
    @TheMefimefi Před 10 lety

    Hey I have this error: cannot find symbol - method setString(int,java.lang.String)
    Do I need a library or something?
    Could you help me pleeeease?

  • @777rakshith
    @777rakshith Před 12 lety

    Thanks it helps me lot...

  • @samehsamo2537
    @samehsamo2537 Před 10 lety

    thank you very much for your help .

  • @ManiKandan-xz6xe
    @ManiKandan-xz6xe Před 11 lety

    Hello sir..i realy like your all the videos. its whery use full for me. pls tell me how to JText box OnClick event to remove default data

  • @adb8885
    @adb8885 Před 12 lety

    ok thnk u!!! this really help me!!!

  • @fitian2733
    @fitian2733 Před 7 lety

    Hi, im trying to save my data in the table but each time i close the window i loos the data and i have to rewrite the data again! Is there any way to save the data with out connect my project to sqlite? All what i want is to save into my pc?

  • @2202aremir
    @2202aremir Před 8 lety

    hello, can you help me?, My lecturer asked a project about online quiz application, which is users need to download the contents (questions) before use it, and click done after finish, if the internet problem occur, the answer can still be sent but need to wait until the internet is ready, admin check the result at the end. I don't want to use html since troubles occur when internet down.

  • @kumuduchathuranga3799
    @kumuduchathuranga3799 Před 11 lety

    it's cooooooooool..thanks.it was really helped

  • @emeliesamuel8141
    @emeliesamuel8141 Před 10 lety +7

    at 04:28, you wrote "pst=conn...." what do they refer to?

  • @olumisspidergirl3141
    @olumisspidergirl3141 Před 7 lety

    hello!! i just want to ask if i need to save data without connecting with mysql..can i do that.. is yes..i hope u will update your new video.
    thanks for this video it help me to cover my assignment..

  • @remarkleal1963
    @remarkleal1963 Před 6 lety

    hello! i have an error when i clicked save button its Show "java.lang.NullPointerExeption" can you help me to fix this. thank you.

  • @jeanmichel6031
    @jeanmichel6031 Před 11 lety

    I would like to thank you for What your are doing we really appreciate you Tuts.
    I also would like to ask you something.
    "I have three tables in my DataBase, and I have a jcombobox of 3 Items( Name, Age, job).
    I want to update each table if each respective Items is selected."
    example: if I select in the Combobox Name may only name's Table should be updated.

  • @MadhuBhargava007
    @MadhuBhargava007 Před 10 lety

    you can use dispose() method to close the window!

  • @RahulChauhan-pp3yt
    @RahulChauhan-pp3yt Před 5 lety

    which database s/w u used dor saving data

  • @rajramakantgupta883
    @rajramakantgupta883 Před 5 lety

    did you use main method in this program my code doesn't work because of main method is missing

  • @mrsciencetv2526
    @mrsciencetv2526 Před 11 lety

    thanks your work is very very good
    please help me when i run the program displays :Query does not return results

  • @BikashDebnath
    @BikashDebnath Před 8 lety

    Hi, Your videos are really helpful. I have some doubts here. I see that insert records shows up in my JTable, but doesn't show up in the Sqlite database. How is that possible.

    • @mosesegboh
      @mosesegboh Před 7 lety

      you haven't connected your jtable to your database then.have you installed mysqlite on your system?

  • @boatengsamuel9414
    @boatengsamuel9414 Před 5 lety

    Good evening Sir .Pls can u do a video on how to delete multiple rows from a jtable database from SQLite

  • @bayusatriakusuma8707
    @bayusatriakusuma8707 Před 9 lety +1

    I get erro of this :
    java.sql.sqlexception sqlite does not support stored procedures
    How to fix this.???

  • @ngnews24-tv13
    @ngnews24-tv13 Před 9 lety

    Hello, could you please advice me on this. I am trying to design a GUI that will be able to update and retrieve filtered information from my SQL server connected to a network.
    I would be glad if you can recommend a specific video for me because I am a little bit confused on which would be best (Ecclipse or netbeans). Please kindly pardon me if the question is a little trivial because I am very new to Java programming and this is my very first project.

  • @cylircastro7522
    @cylircastro7522 Před 11 lety

    Do you have this in GUI? or Java Swing?

  • @mateennmansoori7863
    @mateennmansoori7863 Před 7 lety +1

    what is the pst and Conn where u declare this variable or object in this tutorila plzz reply...

  • @cyn0suretarun
    @cyn0suretarun Před 12 lety

    how to can i store string array or vector to database , and how can i retrieve those data from database can you please help me...
    for ex. from Jlist i am selecting multiple string, suppose (here 4 different string) and how to store those 4 string in to database.

  • @tasin5541
    @tasin5541 Před 7 lety

    can i use this for javafx too?

  • @MrNickReplay
    @MrNickReplay Před 10 lety +4

    For the line:
    pst=conn.prepareStatement(sql);
    I am getting cannot find symbol
    Do I need to import packages & if so which ones? (I tried import java.sql.*; but that didn't help)
    Thanks for this vid :)

    • @MrNickReplay
      @MrNickReplay Před 10 lety

      or do I need to declare the variable pst somewhere?

    • @jelalstuinson2310
      @jelalstuinson2310 Před 10 lety +1

      Nick Kirby you have to declare it PreparedStatement pst = null; on the public class you have on your code

    • @decoeleut
      @decoeleut Před 10 lety

      Jelal Stuinson what do you mean by that? i have this: PreparedStatement pst=conn.prepareStatement(sql);
      it gives me shit for that "sql" there. any ideas? thanks a lot

    • @GamingDNA
      @GamingDNA Před 8 lety

      +André Eleuterio String sql= ("//SQL QUERY//");

    • @atikislam8151
      @atikislam8151 Před 7 lety

      it works...thanx :)

  • @lasgaahadjer9722
    @lasgaahadjer9722 Před 10 lety

    Please how i can use the function Update_table ?!

  • @dewanziaulkarim1891
    @dewanziaulkarim1891 Před 11 lety

    java.sql.SQLException:[SQLITE_MISMATCH] Dtata Type mismatch(datatype mismatch)
    when i click on save....then this error comes....what should i do now? :\
    please help

  • @trisetyadarmawan902
    @trisetyadarmawan902 Před 8 lety

    Thanks :)

  • @eazzap3252
    @eazzap3252 Před 5 lety

    I am getting this error :- java.lang.nullpointerexception ,How should I fix this.

  • @mewan4006
    @mewan4006 Před 9 lety

    Please help me to resolve this "java.sql Exception:Query does not return result"

  • @Hydraxon3200
    @Hydraxon3200 Před 12 lety

    Can you help me please? ;( When i click on Save button i get the error java.lang.ArrayIndexOutOfBoundsException: 5

  • @rexrider3438
    @rexrider3438 Před 11 lety

    SIR can you show us how to add,edit,delete with a auto increment in database????

  • @tashatashv4036
    @tashatashv4036 Před 7 lety +2

    im getting a java.lang.NullPointerException, waht should i do with this

    • @mosesegboh
      @mosesegboh Před 7 lety

      it means you database is not connected to your form.you need to create a java.connect class,specify your connection there,and declare the variables n functions in your form to get rid of this error.I could send you the code if you want.

    • @hazwanirodzi8816
      @hazwanirodzi8816 Před 7 lety

      can you send me the code at hazwanirr@gmail.com? thank you.

    • @GreatwoodhotelsOwerri
      @GreatwoodhotelsOwerri Před 7 lety

      hello hazwani, watch the video from 1 to 5.he generated the code within these videos.i could send you the code but u will still need to customize it to suite ur environment.

    • @tasnimprome5119
      @tasnimprome5119 Před 7 lety

      can you please send me the code its very urgent....
      tasnim40@diit.info

    • @chilling2023
      @chilling2023 Před 5 lety

      @@mosesegboh me too marcricolimhernandez@gmail.com

  • @CeqMat
    @CeqMat Před 8 lety +3

    pst and conn problem...how to fix

    • @mosesegboh
      @mosesegboh Před 7 lety

      have you declared you java.connect class?

  • @rajeshvelraj8438
    @rajeshvelraj8438 Před 9 lety

    it's good can you tel me the jdbc connection statement in this video

  • @adb8885
    @adb8885 Před 12 lety

    hi, i am trying to this, but dnt know y PST = con is being underlined red. can u help me. thnx

  • @osamaproduction5189
    @osamaproduction5189 Před 7 lety

    " java.sql.SQLException: Constraint failed " .. I'm getting this error .. help please

  • @sultanali6411
    @sultanali6411 Před 11 lety

    sir, When i tried save button i show an exception which is "Query does not return results"
    pls help me

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  Před 12 lety

    HI , 1229shakirali just watch the next vedio .......If any doubt then ask me

  • @mdshofiq8658
    @mdshofiq8658 Před 8 lety

    how i can solve error in this line "conn"???
    pst=conn.prepareStatement(sql);

    • @mosesegboh
      @mosesegboh Před 7 lety

      have you declared the variable "conn" in your program?

  • @bhalachandrapatil
    @bhalachandrapatil Před 6 lety

    where you declares the conn and pst ?? in mysql connection ?? Connection conn & statement pst ??

  • @sam-zp6vq
    @sam-zp6vq Před 8 lety

    Please show the us that , how can you set date and time ?

  • @shreekulkalyankar7286
    @shreekulkalyankar7286 Před 10 lety

    I am getting java.sql.SQLException: query does not return results. I also established connection and followed all the steps in previous videos but I cannot get rid of this error please help me ragarding this

    • @shreekulkalyankar7286
      @shreekulkalyankar7286 Před 10 lety +1

      I got the solution for my problem, I was using executeQuery function intstead of Execute() one.

    • @dzagIT
      @dzagIT Před 9 lety

      Shree-kul Kalyan-kar I had same problem :)

  • @MrHumilityOfficial
    @MrHumilityOfficial Před 7 lety

    pst.setString does not work, it says not found

  • @iladila859
    @iladila859 Před 7 lety

    if i use phpmyadmin, is it the same way as in the video??

    • @mosesegboh
      @mosesegboh Před 7 lety

      yes it will,just a little difference in the connection code

  • @judithrantho6157
    @judithrantho6157 Před 8 lety

    on the codes where does "pst" come from? cause i tried to do this program and it gave me errors

    • @mosesegboh
      @mosesegboh Před 7 lety

      pst is is a variable for prepared statement he declared in the beginning of the program.I think its an sql stuff.If you follow the video carefully you will see where it was declared at the creation of the class before the constructor.If you are still having issues you can contact me i will help you out.

    • @mosesegboh
      @mosesegboh Před 7 lety

      have you made the java.connect class?

    • @mosesegboh
      @mosesegboh Před 7 lety

      am happy i could help.take care now

  • @1229shakirali
    @1229shakirali Před 12 lety

    Dear how to open another form by click a jButton ?

  • @wahyuditsai9890
    @wahyuditsai9890 Před 11 lety

    Let me know the video before this , i could not find it..pls..
    what pst mean ?

  • @solutiontseries1324
    @solutiontseries1324 Před 5 lety

    org.sqlite.Stmt cannot be cast to com.mysql.jdbc.PreparedStatement
    how to solve this error

    • @solutiontseries1324
      @solutiontseries1324 Před 5 lety

      org.sqlite.PrepStmt cannot be cast to com.mysql.jdbc.PreparedStatement
      and like this error

  • @DJJavaJ
    @DJJavaJ Před 11 lety

    java.sql.SQLException: [Microsoft][ODBC Microsoft Acces Driver] Syntax error in INSERT statement. I USE MICROSOFT ACCESS what's wrong i followed your code. but when i click save this shows up

  • @excuse98
    @excuse98 Před 11 lety

    what if the user input a number in surname? how can i trapped it?

  • @tOfiqrafiqtofiqrafiq
    @tOfiqrafiqtofiqrafiq Před 8 lety

    how to get only one column in jtable like only name all records ? help me

    • @mosesegboh
      @mosesegboh Před 7 lety

      edit it from your sql statement,instead of using select "'*",you should use select "name" in your sql statment. hope you understand

  • @HemantKumar-gg4ve
    @HemantKumar-gg4ve Před 10 lety

    got an error "
    java.lang.NullPointerException".....
    help me ......thanks in advance

  • @thebrightcyclops8133
    @thebrightcyclops8133 Před 7 lety

    i did get your code but still can you give me the all of the codes you inserted inside please

  • @kazznation_
    @kazznation_ Před 9 lety

    how about no duplicate id or username?

  • @audermuhammad8156
    @audermuhammad8156 Před 7 lety

    hello my brother ,, can you help me for insert multiple row from netbeans to database . thank you for answer

    • @mosesegboh
      @mosesegboh Před 7 lety

      you can do that,all you need to do is duplicate your handling code and make some necessary changes

    • @audermuhammad8156
      @audermuhammad8156 Před 7 lety

      thnak you for answered
      so I qustioned for tell me how to insert multiple row , im cannot this changes your tell me
      can you help me by create video ,, thnak you , thank you very much
      sorry if my languge has an error

  • @evandrorodriguesdeandrade4379

    Zial Zia, The Problem is occurring in the insertion because the key is auto increment for this solution then use this code below into your action with the name of your variables.
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    try {
    String sql = "Insert into Empoyeeinfo (name,surname,age)"
    + " values (?,?,?);";
    pst = conn.prepareStatement(sql);
    //pst.setString(1, jTextField1.getText());
    pst.setString(1, jTextField2.getText());
    pst.setString(2, jTextField3.getText());
    pst.setString(3, jTextField4.getText());
    pst.execute();
    JOptionPane.showMessageDialog(null, "SALVO COM SUCESSO");
    } catch (Exception ex) {
    JOptionPane.showMessageDialog(null, ex);
    }
    Update_table();
    }

    • @levkolevkolevko
      @levkolevkolevko Před 9 lety +1

      Evandro Rodrigues de Andrade thank you, your comment very helpful for me)

    • @atikislam8151
      @atikislam8151 Před 7 lety

      Thanx it works :)

    • @MonoarBinahmed
      @MonoarBinahmed Před 6 lety

      Thank you, but now show pop up "database locked"

  • @mayankstar364
    @mayankstar364 Před 4 lety

    I guess you've not provided the URL of database

  • @Hydraxon3200
    @Hydraxon3200 Před 12 lety

    The problem disappeared after i restarted the program.But i have a new one java.sql.SQLException: Unrecognized token. Can you give me your e-mail, so i can explain a bit more abaut my problem to you and post you my project?

  • @hometreatment4653
    @hometreatment4653 Před 7 lety

    please any one tell me
    what is pst and conn?

  • @miladsp2
    @miladsp2 Před 12 lety

    How can you remove data from the database sqlite with Netbeans java?

  • @suriya7491
    @suriya7491 Před 11 lety

    ERROR: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
    this is the error when i click register button to insert the data into database

  • @ABHISHEKDODLA
    @ABHISHEKDODLA Před 11 lety

    java.sql.SQLException:unable to open database file this is the error please help me

  • @renzyfermin2190
    @renzyfermin2190 Před 3 lety

    Where the pst came from?

  • @bitten4life
    @bitten4life Před 9 lety

    why are the values (?,?) ?

  • @KayoleKnight
    @KayoleKnight Před 8 lety

    query doesnt return result where could i be wrong

    • @mosesegboh
      @mosesegboh Před 7 lety

      check the syntax of your query very well,there is something you are missing.I encountered that same problem but solved it

  • @raynillewai
    @raynillewai Před 10 lety

    got an error " java.lang.NullPointerException"

    • @NeelKamaldeveloper
      @NeelKamaldeveloper Před 10 lety

      Hi,
      you are getting this Null Pointer exception ,because u must be closing the connection before all use.
      and as far as i know u might be using finally block to close the connection.
      But this is not the right way..
      close the connection " WHEN U HAVE ALL DONE WITH UR CONNECTIONS".
      Remove it from finally block ,and set it in the last(i.e all the condition u have given) condition (i.e last if block) .

  • @newlookak47
    @newlookak47 Před 8 lety

    you need a table first isnt it?
    Can I have the code to create the table

    • @mosesegboh
      @mosesegboh Před 7 lety

      you can create a table by dragging and dropping a table item from the palette under swing controls.then for you to connect the able to the database,you will need to create a java.connect class first of all and write necessary code before can connect your table to the database.

    • @brentjuliangayola7414
      @brentjuliangayola7414 Před 7 lety

      anand kokatnur indiano

  • @imededdinelakhal3515
    @imededdinelakhal3515 Před 11 lety

    plz i want the code of méthode Update_table thx

  • @toohamoto9861
    @toohamoto9861 Před 7 lety

    sql exception sqlite readonly

  • @Pendragon501
    @Pendragon501 Před 6 lety

    Omg this video is all over the place. It makes me motion sick.

  • @jeanrodrigues6249
    @jeanrodrigues6249 Před 2 lety

    Close

  • @jeanrodrigues6249
    @jeanrodrigues6249 Před 2 lety

    Se

  • @karangupta4630
    @karangupta4630 Před 9 lety

    video was not helpful....