Answer to Question #235023 in Java | JSP | JSF for PUSA

Question #235023

To develop Java application and use Java Swing using below

requirements.


Tutora is an educational institute which provides education and

research to country. Currently their entire business process is

operated with books and emails. As a startup company your group has

been hired to automate the manual process of Tutora. The following

main business requirements has been discussed by the client. Implement

a java Swing Application to automate the business requirements.


Manage Examination issues (Add,Update,Remove) 


1
Expert's answer
2021-09-09T07:38:26-0400
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;


public class Student extends database {




    public Student(Context c) {
        super(c);
    }




    public boolean insert(String username,String email,String password,int path){
        SQLiteDatabase database = this.getWritableDatabase();
        ContentValues cv =  new ContentValues();
        cv.put("username",username);
        cv.put("email",email);
        cv.put("password",password);
        cv.put("image",path);
        if (database.insert("Student",null,cv) != -1){
            return true;
        }


        return  false;
    }




    public Cursor getStudent(String username){
        SQLiteDatabase database = this.getReadableDatabase();
        Cursor cur = database.rawQuery("select * from Student where username = ?", new String[]{username});
        cur.moveToFirst();
        return cur;
    }




    public boolean isExist(String username,String password){
        SQLiteDatabase database = this.getReadableDatabase();
        Cursor cur = database.rawQuery("select username,password from Student where username=? and password = ?",new String[]{username,password});
        if(cur.getCount() == 1){
            return  true;
        }
        return  false;
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS