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)
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;
}
}
Comments
Leave a comment