5th sem java project
- !!!!!!!!!!!!!!!!!!!! Download files folders in the same format as the repo !!!!!!!!!!!!!!!!!!!!
- jcmpl CodeFile.java
- jrun CodeFile
Present in the quizlib package
- fields : List of fields
- table : matrix of all the rows below the heading
void runQuery(String query)
: Updates the field and table contents based on the String queryvoid resultDisplay()
: Display result tableArrayList< ArrayList<String> > getResult()
: returns the matrix of entire result table. The first row comprises the headers (field names)
import java.util.Collection;
import java.util.ArrayList;
import quizlib.QuizDB;
public class TestAPI
{
public static void main(String args[])
{
QuizDB qobj = new QuizDB();
qobj.runQuery("SELECT * FROM course");
System.out.println("Testing resultDisplay:");
qobj.resultDisplay();
System.out.println("\nTesting getResult:");
ArrayList<ArrayList<String>> result = qobj.getResult();
for(ArrayList<String> row : result)
{
for(String data : row)
System.out.print(data+"\t|\t");
System.out.println();
}
}
}
command_script.txt has important PGSQL queries that will be needed from time to time