Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: can anyone help me to fix the error in the program???

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default can anyone help me to fix the error in the program???

    import java.sql.*;
    public class ss
    {
    public static void main(String args[])
    {
    try
    {
    //int n=0,p=0,s;
    int SBP,DBP,CHOL,AGE,WAIST,BMI;
    //DataInputStream ob=new DataInputStream(System.in);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbcdbc:ddd");
    Statement st = con.createStatement();
    String query = "SELECT CHOL,BMI,AGE,SBP,DBP,WAIST FROM hyp";
    ResultSet rs=st.executeQuery(query);

    while(rs.next())
    {
    //int CHOL=rs.getInt(1);
    //int BMI=rs.getInt(2);
    //int SBP=rs.getInt(3);
    //int DBP=rs.getInt(4);
    //int WAIST=rs.getInt(5);
    if(((SBP>=90&&SBP<=119)&&(DBP<=60&&DBP<=79))||(CHO L<=200)||(AGE<=45)||(BMI>=18&&BMI<=25)||(WAIST>=35 ))
    {
    System.out.println("Normal");
    }
    else if(((SBP>=120&&SBP<=139)&&(DBP>=80&&DBP<=89))||(BM I>=25&&BMI<=30)||(CHOL>=200&&CHOL<=239))
    {
    System.out.println("Stage1");
    }
    else
    {
    System.out.println("Hypertension");
    }
    }
    }
    catch(Exception e)
    {
    System.out.println("error:");
    }
    }
    }


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: can anyone help me to fix the error in the program???

    You need to tell us what errors you might be seeing, else how can we know how to help you? Also please read up on using [code] [/code] tags so your code retains its formatting and is readable.

    --- Update ---

    Heck, you've already asked the same question and never replied to answers and replies given. Please don't waste our time this way. Locking this duplicate post.

Similar Threads

  1. can anyone help me to fix the error in the program???
    By divi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 24th, 2013, 02:49 PM
  2. Cant fix this error... Help!
    By Hypermegazord in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 1st, 2012, 01:06 PM
  3. Need Help, Not sure how to fix basic error!
    By ChicoTheMan94 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 15th, 2012, 01:41 PM
  4. Simply error; can't quite fix it.
    By JRabbit in forum Android Development
    Replies: 1
    Last Post: March 19th, 2012, 06:46 PM
  5. Replies: 6
    Last Post: October 5th, 2011, 07:21 AM