I need your help urgently of which I get you more guean pigs you need who may evetual pay if you are good enough at moment if do good I will connect you with students at one of the university up north who may pay for sevices if you want too! REPLYS CAN BE SENT TO zululand@hotmail.co.uk
The following code is missing 3 METHODS of which I need help urgently with they in between the lines
======================================================================
}
//====================================================================
public static void entryMatchResults(Scanner input)
{
//want a method to insert new record in five fields namely
//"integer,string,string,string, integer, integer" type of entries.
}
//=====================================================================
public static void displayMatchresult(Scanner input)
{
//wanted a method to select from a data base one item occupying five fields
//"integer,string,string,string, integer, integer" type of entries.
}
//=====================================================================
public static void calculationMatchCost(Scanner input)
{
// method to pick a price from data base by means of passing one variable e.g MatchID
//and multiple it with a given quantity as input of choice
}//=====================================================================
======================================================================
package matchBeans;
import java.util.*;
import java.sql.*;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
public class Results
{
public static Scanner input;
private static Object scanner;
public static void main(String[] args)
{
input = new Scanner(System.in);
displayMenu(input);
}
public static void displayMenu(Scanner input)
{
int intOption = 0;
System.out.println("\n\tPLEASE SELECT OPTION:");
System.out.println("\n\t1.Enter Match Details");
System.out.println("\t2.Display Match Results");
System.out.println("\t3.Display Seson Results To Date");
System.out.println("\t4.Calculate Cost Of Match Ticket/Type");
System.out.println("\t5.Quit Program");
try
{
if(intOption < 1 || intOption > 5)
{
System.out.println("\nEnter An Option:");
intOption = input.nextInt();
}
}
catch(InputMismatchException e)
{
System.out.println("Wrong Data type Entered.");
displayMenu(input);
}
switch(intOption)
{
case 1: entryMatchResults(input); break;
case 2: displayMatchresult(input); break;
case 3: displaySeasonResults(input); break;
case 4: calculationMatchCost(input); break;
case 5: Quit(input); break;
default: System.out.println("No such option!"); break;
}
}
//============================================================================================
public static void entryMatchResults(Scanner input)
{
//want a method to insert new record in five fields namely
//"integer,string,string,string, integer, integer" type of entries.
}
//=============================================================================================
public static void displayMatchresult(Scanner input)
{
//wanted a method to select from a data base one item occupying five fields
//"integer,string,string,string, integer, integer" type of entries.
}
//==============================================================================================
public static void calculationMatchCost(Scanner input)
{
// method to pick a price from data base by means of passing one variable e.g MatchID
//and multiple it with a given quantity as input of choice
}
//=============================================================================================
public static void displaySeasonResults(Scanner input)
{
Connection connection;
Statement statement;
ResultSet results;
JFrame frame;
JTable table;
JScrollPane scroller;
final String[] HEADING =
{"matchID.","opponents","homrOraway","clubScore","opponentsScore"};
Vector<String> heads;
Vector<Object> row;
Vector<Vector<Object>> rows;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = DriverManager.getConnection("jdbc:odbc:ClubData","","");
statement = connection.createStatement();
results = statement.executeQuery("SELECT * FROM Results");
heads = new Vector<String>();
for (int i=0; i<HEADING.length; i++)
{
heads.add(HEADING[i]);
}
rows = new Vector<Vector<Object>>();
try {
while (results.next())
{
row = new Vector<Object>();
row.add(results.getInt(1));
row.add(results.getString(2));
row.add(results.getString(3));
row.add(results.getInt(4));
row.add(results.getInt(5));
rows.add(row);
}
} catch (SQLException e) {
e.printStackTrace();
}
frame = new JFrame();
frame.setSize(600,300);
table = new JTable(rows,heads);
scroller = new JScrollPane(table);
frame.add(scroller);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
catch(ClassNotFoundException cnfEx)
{
System.out.println("* Unable to load driver! * ");
System.exit(1);
} catch (SQLException e) {
e.printStackTrace();
}
}
public static void Quit(Scanner input)
{
System.out.println("\nYou have selected option 5 to terminate the program.");
System.out.println("\nProgram terminated.");
input.close();
System.exit(0);
}
}