Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8324119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:56:37+00:00 2026-06-08T23:56:37+00:00

This is code for get current date information is getting from database. It is

  • 0

This is code for get current date information is getting from database. It is working successfully.

public class RetailerWs {
  public int data(){
    int count=0;

    //count++;

    try{
      Class.forName("com.mysql.jdbc.Driver");
      Connection con = DriverManager
         .getConnection("jdbc:mysql://localhost:3306/pro","root","");

      PreparedStatement statement =  con
         .prepareStatement("select * from orders where status='Q' AND date=CURDATE()");
      ResultSet result = statement.executeQuery();

      while(result.next()) {
        // Do something with the row returned.
        count++; //if the first col is a count.
      }     
    }
    catch (Exception exc) {
      System.out.println(exc.getMessage());
    }


    return count;
  }
}

my doubt is how is get current month details from database...how to do that…please help me.

dis is my database:

enter image description here

Here i wish to need output is if i run the above application means it is displayed the count value.if i wish to need output is the current month details.for eg:i get the current date information means the check the query and display count value is 2..it is worked successfully.here i wrote the query is

select * from orders where status='Q' AND date=CURDATE()".

it is successfully worked.same thing how is write the query for status=Q for current month…so now i wish to display the output is 2.but i can’t unable to do dis.so please help me.how is to do.how can i change my code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:56:39+00:00Added an answer on June 8, 2026 at 11:56 pm

    try function MONTH() of mysql
    here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code where I'm trying to get the current date and format
I can get current date of iphone via this code as NSDate *currentDate =
This code will get us all the properties of a class: Dim myPropertyInfo As
I have this code to get the default constructor: Public Function f(ByVal t As
i have this code to get the search resutls from the api: querygoogle.php: <?php
After using this code to get my link to show me 3 database entrys
I'm trying to output the current date and time using this code: $theDate =
I'm trying to get this weekend in php. I get the current date by
I've been using this code to try and get data from the google weather
What I'm doing with this code is checking the database for a date that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.