Java

Credit and Debit Calculation using Java Mysql

This tutorial will teach you Credit and Debit Calculation using Java Mysql.Account details are retrieving from the database. it will be calculating the total amount of Debit and Credit when enter the relavent account holder name on the textfield and click find button.

Paste the code inside the ok button

 try {
  Connection con;
  PreparedStatement pst;
     
     
  String name = txtname.getText();
     
  Class.forName("com.mysql.jdbc.Driver");
  con = DriverManager.getConnection("jdbc:mysql://localhost/wholesaleshop", "root","");

  String sql="select sum(debit), sum(credit) from report  "
     + "where name ='"+ name +"'and debit >0";
    
  Statement st=con.createStatement();
  ResultSet set=st.executeQuery(sql);
  if(set.next())
  {
    txtcredit.setText(set.getString(1));
    txtdebit.setText(set.getString(2));
         }
  }
                catch (Exception ex) 
               {
    ex.printStackTrace();
        }

I have attached the video tutorial below it will help you  to do this  step by step.


 

admin

Recent Posts

Chat with Claude AI Free – Your Super-Smart AI Buddy

It's like having a super-smart buddy that is always there to help you write stories,…

4 days ago

Best Festivals UK 2025 [Free Guide Included]

The UK is known for its rich history, diverse culture, and most of all  its…

7 days ago

Bank Holidays 2025 UK – Plan Your Perfect Long Weekends

Do you have a plan for your next holiday? Being aware of the Bank Holidays within the…

7 days ago

Master Cursor AI Full Guide for Students & Creators

The world is rapidly changing of software development AI-assisted tools for coding have become the main focus. As…

1 week ago

Google Gemini AI Free AI Tool for Students & Creators

Google Gemini AI is among the top talked about developments. What exactly is it? What…

1 week ago

Top 5 Reasons You Should Use Grubby AI Humanizer in 2025

As the need for AI content undetectable humanization software skyrockets with more and more AI…

2 weeks ago