SlideShare a Scribd company logo
1 of 17
***************FINAL PROJECT*********************
package model;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class FinalProject {
/**
*
* @param conn
* @param mode
* @return
*/
public Exception performRequest(Connection conn, String
mode, String opCode){
PreparedStatement ps = null;
ResultSet rs = null;
Exception e = null;
//Defines a sort order
String sortOrder = "ASC";
if("2".equals(opCode)){
sortOrder = "DESC";
}
switch(mode){
case "1":
try {
String sql = "SELECT * FROM [User]";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "2":
try {
String sql = "SELECT * FROM [User] A"+
" Left Join Address As B on A.UserId = B.UserId"+
"Left Join Phone As C on C.UserId = A.UserId";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "3":
try {
String sql = "SELECT * FROM
[Order_Hdr] A"+
" Left Join [User] (FirstName), (LastName), (Email)
As B on A.UserId = B.UserId";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "4":
try {
String sql = "SELECT * FROM
[Order_Hdr] A"+
" Left Join [User] As B on A.UserId = B.UserId"
+" WHERE DeliveryDate < 11-
11-2016";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "5":
try {
String sql = "SELECT (Message) FROM
[System_Log] A"+
" Left Join [Company] As B on A.UserId =
B.UserId"+
"Left Join [Location] As C on C.UserId = A.UserId"
+"GROUP BY LogType"
+"ORDER BY (CompanyId,LocationId)";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "6":
try {
String sql = "SELECT (Message) FROM
[System_Log] A"+
" Left Join [Company] As B on A.UserId =
B.UserId"+
"Left Join [Location] As C on C.UserId = A.UserId"
+"WHERE (Region)= ENGLAND"
+"GROUP BY LogType"
+"ORDER BY (CompanyId,LocationId)";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "7":
try {
String sql = "SELECT * FROM
[Order_Dtl] A"+
" Left Join [Production_Dtl] As B on A.ProductId =
B.ProductId"
+" WHERE B.ProductionId =
null";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "8":
try{ String sql = "DELETE FROM [User] WHERE
Email= [email protected]";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "9":
try{ String sql = "SELECT (Email) FROM
[User] A"+
" Left Join Address As B on A.UserId =
B.UserId"+
"Left Join Phone As C on C.UserId =
A.UserId"
+ "UPDATE FROM [Address] WHERE Email=
[email protected]"
+"UPDATE FROM [Address]" +"WHERE
UserId=15"
+"UPDATE FROM [Address]" +"WHERE
UserId=15";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "10":
try {
String sql = "SELECT SUM (UnitsOnHand)
FROM [Production_Dtl] A"+
" Left Join [Company] As B on A.UserId =
B.UserId"+
"Left Join [Location] As C on C.LocationId =
B.LocationId"
+"WHERE (Region)= United States"
+"GROUP BY ProductId";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "11":
try {
String sql = "SELECT SUM (UnitsCost)
FROM [Production_Dtl] A"+
" Left Join [Company] As B"+
"Left Join [Product] As C on C.LocationId =
A.LocationId"
+"GROUP BY ProductId";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "12":
try {
String sql = "SELECT SUM (UnitsCost)
FROM [Production_Dtl] A"+
" Left Join [Company] As B"+
"Left Join [Product] As C on C.LocationId =
A.LocationId"
+"GROUP BY ProductDesc";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "13":
try {
String sql = "SELECT (CompanyDesc)
FROM [Company] A"+
" Join [Production_Dtl] As B "+
"Left Join [Production_Hdr] As C on C.ProductionId
= B.ProductionId"
+"WHERE (ProductionId)=null"
+"GROUP BY ProductId";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "14":
try {
String sql = "SELECT top 1 FROM
[Order_Hdr] A"+
" Join [User] As B "+
"Order by A.OrderQty Asc";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "15":
try {
String sql = "SELECT top 1 FROM
[Order_Hdr] A"+
" Join [User] As B "+
"Order by A.OrderQty Desc";
}
catch(Exception ex)
{
System.out.println(e.toString());
}
break;
case "16":
String sql = "SELECT * FROM [Product]
A"+
" Left Join [Production_Hdr] As B on A.Description =
B.Description"
+"Left Join [Production_Dtl] as C "
+"Left Join [Orders] as D "
+"Order By (C.UnitsOnHand,
C.UnitsCost) ";
break;
default:
e = new Exception ("Invalid mode. Mode: " +
mode);
};
return e;
}
public Exception performRequest(Connection conn, String
x) {
// TODO Auto-generated method stub
return null;
// TODO Auto-generated method stub
}
}

More Related Content

Similar to FINAL PROJECTpacka.docx

OverviewWe will be adding some validation to our Contact classes t.pdf
OverviewWe will be adding some validation to our Contact classes t.pdfOverviewWe will be adding some validation to our Contact classes t.pdf
OverviewWe will be adding some validation to our Contact classes t.pdffathimaoptical
 
I keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdfI keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdfherminaherman
 
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping ToolkitDevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping ToolkitDenis Voituron
 
c++ practical Digvajiya collage Rajnandgaon
c++ practical  Digvajiya collage Rajnandgaonc++ practical  Digvajiya collage Rajnandgaon
c++ practical Digvajiya collage Rajnandgaonyash production
 
Microsoft Ado
Microsoft AdoMicrosoft Ado
Microsoft Adooswchavez
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programsKaruppaiyaa123
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4Abed Bukhari
 
Ensure code quality with vs2012
Ensure code quality with vs2012Ensure code quality with vs2012
Ensure code quality with vs2012Sandeep Joshi
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cMoseStaton39
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cSilvaGraf83
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cSilvaGraf83
 
Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Tomasz Dziuda
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfaquadreammail
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab ManualAkhilaaReddy
 
please help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdfplease help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdfarishmarketing21
 
JDBC for CSQL Database
JDBC for CSQL DatabaseJDBC for CSQL Database
JDBC for CSQL Databasejitendral
 
2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticinoArnaud Bos
 

Similar to FINAL PROJECTpacka.docx (20)

OverviewWe will be adding some validation to our Contact classes t.pdf
OverviewWe will be adding some validation to our Contact classes t.pdfOverviewWe will be adding some validation to our Contact classes t.pdf
OverviewWe will be adding some validation to our Contact classes t.pdf
 
I keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdfI keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdf
 
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping ToolkitDevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
 
DataTypes.ppt
DataTypes.pptDataTypes.ppt
DataTypes.ppt
 
c++ practical Digvajiya collage Rajnandgaon
c++ practical  Digvajiya collage Rajnandgaonc++ practical  Digvajiya collage Rajnandgaon
c++ practical Digvajiya collage Rajnandgaon
 
Microsoft Ado
Microsoft AdoMicrosoft Ado
Microsoft Ado
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programs
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
Ensure code quality with vs2012
Ensure code quality with vs2012Ensure code quality with vs2012
Ensure code quality with vs2012
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
java-programming.pdf
java-programming.pdfjava-programming.pdf
java-programming.pdf
 
Introduction to ECMAScript 2015
Introduction to ECMAScript 2015Introduction to ECMAScript 2015
Introduction to ECMAScript 2015
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab Manual
 
please help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdfplease help with java questionsJAVA CODEplease check my code and.pdf
please help with java questionsJAVA CODEplease check my code and.pdf
 
JDBC for CSQL Database
JDBC for CSQL DatabaseJDBC for CSQL Database
JDBC for CSQL Database
 
2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino2019-10-05 - Untangled - Voxxed days ticino
2019-10-05 - Untangled - Voxxed days ticino
 

More from AKHIL969626

One of the most common used risk management tools is the Incident Re.docx
One of the most common used risk management tools is the Incident Re.docxOne of the most common used risk management tools is the Incident Re.docx
One of the most common used risk management tools is the Incident Re.docxAKHIL969626
 
One of the first anthropologists to examine religion in Africa was E.docx
One of the first anthropologists to examine religion in Africa was E.docxOne of the first anthropologists to examine religion in Africa was E.docx
One of the first anthropologists to examine religion in Africa was E.docxAKHIL969626
 
One of the most important concepts in clinical practice and group wo.docx
One of the most important concepts in clinical practice and group wo.docxOne of the most important concepts in clinical practice and group wo.docx
One of the most important concepts in clinical practice and group wo.docxAKHIL969626
 
One function of a leader is to provide the vision for the organizati.docx
One function of a leader is to provide the vision for the organizati.docxOne function of a leader is to provide the vision for the organizati.docx
One function of a leader is to provide the vision for the organizati.docxAKHIL969626
 
One could argue that old-fashioned attitudes regarding gender and t.docx
One could argue that old-fashioned attitudes regarding gender and t.docxOne could argue that old-fashioned attitudes regarding gender and t.docx
One could argue that old-fashioned attitudes regarding gender and t.docxAKHIL969626
 
One of the hallmarks of qualitative research is writing detailed obs.docx
One of the hallmarks of qualitative research is writing detailed obs.docxOne of the hallmarks of qualitative research is writing detailed obs.docx
One of the hallmarks of qualitative research is writing detailed obs.docxAKHIL969626
 
One of the three main tenants of information security is availabilit.docx
One of the three main tenants of information security is availabilit.docxOne of the three main tenants of information security is availabilit.docx
One of the three main tenants of information security is availabilit.docxAKHIL969626
 
One of the challenges in group problem solving is identifying the ac.docx
One of the challenges in group problem solving is identifying the ac.docxOne of the challenges in group problem solving is identifying the ac.docx
One of the challenges in group problem solving is identifying the ac.docxAKHIL969626
 
One is the personal plot that unfolds around the relationships betwe.docx
One is the personal plot that unfolds around the relationships betwe.docxOne is the personal plot that unfolds around the relationships betwe.docx
One is the personal plot that unfolds around the relationships betwe.docxAKHIL969626
 
One and half pagesimple, noplagarism Title page, abstr.docx
One and half pagesimple, noplagarism Title page, abstr.docxOne and half pagesimple, noplagarism Title page, abstr.docx
One and half pagesimple, noplagarism Title page, abstr.docxAKHIL969626
 
One 750 - word essay exploring an art historical issue presented in .docx
One 750 - word essay exploring an art historical issue presented in .docxOne 750 - word essay exploring an art historical issue presented in .docx
One 750 - word essay exploring an art historical issue presented in .docxAKHIL969626
 
One of the most interesting items in the communication realm of orga.docx
One of the most interesting items in the communication realm of orga.docxOne of the most interesting items in the communication realm of orga.docx
One of the most interesting items in the communication realm of orga.docxAKHIL969626
 
One of the most important filmmakers of the twentieth centur.docx
One of the most important filmmakers of the twentieth centur.docxOne of the most important filmmakers of the twentieth centur.docx
One of the most important filmmakers of the twentieth centur.docxAKHIL969626
 
One of the ways businesses provide secure access to their networ.docx
One of the ways businesses provide secure access to their networ.docxOne of the ways businesses provide secure access to their networ.docx
One of the ways businesses provide secure access to their networ.docxAKHIL969626
 
On Stretching Time (250 Words)The given paradigms by which we.docx
On Stretching Time (250 Words)The given paradigms by which we.docxOn Stretching Time (250 Words)The given paradigms by which we.docx
On Stretching Time (250 Words)The given paradigms by which we.docxAKHIL969626
 
On the evening news, social media and even in conversation, do you f.docx
On the evening news, social media and even in conversation, do you f.docxOn the evening news, social media and even in conversation, do you f.docx
On the evening news, social media and even in conversation, do you f.docxAKHIL969626
 
On p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docx
On p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docxOn p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docx
On p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docxAKHIL969626
 
On 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docx
On 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docxOn 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docx
On 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docxAKHIL969626
 
On September 11, 2001 the U.S. changed forever. While the U.S. had s.docx
On September 11, 2001 the U.S. changed forever. While the U.S. had s.docxOn September 11, 2001 the U.S. changed forever. While the U.S. had s.docx
On September 11, 2001 the U.S. changed forever. While the U.S. had s.docxAKHIL969626
 
On January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docx
On January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docxOn January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docx
On January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docxAKHIL969626
 

More from AKHIL969626 (20)

One of the most common used risk management tools is the Incident Re.docx
One of the most common used risk management tools is the Incident Re.docxOne of the most common used risk management tools is the Incident Re.docx
One of the most common used risk management tools is the Incident Re.docx
 
One of the first anthropologists to examine religion in Africa was E.docx
One of the first anthropologists to examine religion in Africa was E.docxOne of the first anthropologists to examine religion in Africa was E.docx
One of the first anthropologists to examine religion in Africa was E.docx
 
One of the most important concepts in clinical practice and group wo.docx
One of the most important concepts in clinical practice and group wo.docxOne of the most important concepts in clinical practice and group wo.docx
One of the most important concepts in clinical practice and group wo.docx
 
One function of a leader is to provide the vision for the organizati.docx
One function of a leader is to provide the vision for the organizati.docxOne function of a leader is to provide the vision for the organizati.docx
One function of a leader is to provide the vision for the organizati.docx
 
One could argue that old-fashioned attitudes regarding gender and t.docx
One could argue that old-fashioned attitudes regarding gender and t.docxOne could argue that old-fashioned attitudes regarding gender and t.docx
One could argue that old-fashioned attitudes regarding gender and t.docx
 
One of the hallmarks of qualitative research is writing detailed obs.docx
One of the hallmarks of qualitative research is writing detailed obs.docxOne of the hallmarks of qualitative research is writing detailed obs.docx
One of the hallmarks of qualitative research is writing detailed obs.docx
 
One of the three main tenants of information security is availabilit.docx
One of the three main tenants of information security is availabilit.docxOne of the three main tenants of information security is availabilit.docx
One of the three main tenants of information security is availabilit.docx
 
One of the challenges in group problem solving is identifying the ac.docx
One of the challenges in group problem solving is identifying the ac.docxOne of the challenges in group problem solving is identifying the ac.docx
One of the challenges in group problem solving is identifying the ac.docx
 
One is the personal plot that unfolds around the relationships betwe.docx
One is the personal plot that unfolds around the relationships betwe.docxOne is the personal plot that unfolds around the relationships betwe.docx
One is the personal plot that unfolds around the relationships betwe.docx
 
One and half pagesimple, noplagarism Title page, abstr.docx
One and half pagesimple, noplagarism Title page, abstr.docxOne and half pagesimple, noplagarism Title page, abstr.docx
One and half pagesimple, noplagarism Title page, abstr.docx
 
One 750 - word essay exploring an art historical issue presented in .docx
One 750 - word essay exploring an art historical issue presented in .docxOne 750 - word essay exploring an art historical issue presented in .docx
One 750 - word essay exploring an art historical issue presented in .docx
 
One of the most interesting items in the communication realm of orga.docx
One of the most interesting items in the communication realm of orga.docxOne of the most interesting items in the communication realm of orga.docx
One of the most interesting items in the communication realm of orga.docx
 
One of the most important filmmakers of the twentieth centur.docx
One of the most important filmmakers of the twentieth centur.docxOne of the most important filmmakers of the twentieth centur.docx
One of the most important filmmakers of the twentieth centur.docx
 
One of the ways businesses provide secure access to their networ.docx
One of the ways businesses provide secure access to their networ.docxOne of the ways businesses provide secure access to their networ.docx
One of the ways businesses provide secure access to their networ.docx
 
On Stretching Time (250 Words)The given paradigms by which we.docx
On Stretching Time (250 Words)The given paradigms by which we.docxOn Stretching Time (250 Words)The given paradigms by which we.docx
On Stretching Time (250 Words)The given paradigms by which we.docx
 
On the evening news, social media and even in conversation, do you f.docx
On the evening news, social media and even in conversation, do you f.docxOn the evening news, social media and even in conversation, do you f.docx
On the evening news, social media and even in conversation, do you f.docx
 
On p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docx
On p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docxOn p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docx
On p. 98-99 of Music and Capitalism, Tim Taylor writes, The.docx
 
On 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docx
On 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docxOn 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docx
On 1 January 2016, the 17 Sustainable Development Goals (SDGs) o.docx
 
On September 11, 2001 the U.S. changed forever. While the U.S. had s.docx
On September 11, 2001 the U.S. changed forever. While the U.S. had s.docxOn September 11, 2001 the U.S. changed forever. While the U.S. had s.docx
On September 11, 2001 the U.S. changed forever. While the U.S. had s.docx
 
On January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docx
On January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docxOn January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docx
On January 28, 1986, the Space Shuttle Challenger was destroyed  upo.docx
 

Recently uploaded

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 

FINAL PROJECTpacka.docx

  • 1. ***************FINAL PROJECT********************* package model; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class FinalProject { /** * * @param conn
  • 2. * @param mode * @return */ public Exception performRequest(Connection conn, String mode, String opCode){ PreparedStatement ps = null; ResultSet rs = null; Exception e = null; //Defines a sort order String sortOrder = "ASC"; if("2".equals(opCode)){ sortOrder = "DESC"; } switch(mode){ case "1": try {
  • 3. String sql = "SELECT * FROM [User]"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "2": try { String sql = "SELECT * FROM [User] A"+ " Left Join Address As B on A.UserId = B.UserId"+
  • 4. "Left Join Phone As C on C.UserId = A.UserId"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "3": try { String sql = "SELECT * FROM [Order_Hdr] A"+ " Left Join [User] (FirstName), (LastName), (Email) As B on A.UserId = B.UserId"; }
  • 5. catch(Exception ex) { System.out.println(e.toString()); } break; case "4": try { String sql = "SELECT * FROM [Order_Hdr] A"+ " Left Join [User] As B on A.UserId = B.UserId" +" WHERE DeliveryDate < 11- 11-2016"; }
  • 6. catch(Exception ex) { System.out.println(e.toString()); } break; case "5": try { String sql = "SELECT (Message) FROM [System_Log] A"+ " Left Join [Company] As B on A.UserId = B.UserId"+ "Left Join [Location] As C on C.UserId = A.UserId" +"GROUP BY LogType" +"ORDER BY (CompanyId,LocationId)"; } catch(Exception ex) {
  • 7. System.out.println(e.toString()); } break; case "6": try { String sql = "SELECT (Message) FROM [System_Log] A"+ " Left Join [Company] As B on A.UserId = B.UserId"+ "Left Join [Location] As C on C.UserId = A.UserId" +"WHERE (Region)= ENGLAND" +"GROUP BY LogType" +"ORDER BY (CompanyId,LocationId)"; } catch(Exception ex) { System.out.println(e.toString());
  • 8. } break; case "7": try { String sql = "SELECT * FROM [Order_Dtl] A"+ " Left Join [Production_Dtl] As B on A.ProductId = B.ProductId" +" WHERE B.ProductionId = null"; } catch(Exception ex) { System.out.println(e.toString()); }
  • 9. break; case "8": try{ String sql = "DELETE FROM [User] WHERE Email= [email protected]"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "9": try{ String sql = "SELECT (Email) FROM [User] A"+ " Left Join Address As B on A.UserId = B.UserId"+ "Left Join Phone As C on C.UserId =
  • 10. A.UserId" + "UPDATE FROM [Address] WHERE Email= [email protected]" +"UPDATE FROM [Address]" +"WHERE UserId=15" +"UPDATE FROM [Address]" +"WHERE UserId=15"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "10": try {
  • 11. String sql = "SELECT SUM (UnitsOnHand) FROM [Production_Dtl] A"+ " Left Join [Company] As B on A.UserId = B.UserId"+ "Left Join [Location] As C on C.LocationId = B.LocationId" +"WHERE (Region)= United States" +"GROUP BY ProductId"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "11": try { String sql = "SELECT SUM (UnitsCost) FROM [Production_Dtl] A"+
  • 12. " Left Join [Company] As B"+ "Left Join [Product] As C on C.LocationId = A.LocationId" +"GROUP BY ProductId"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "12": try { String sql = "SELECT SUM (UnitsCost) FROM [Production_Dtl] A"+ " Left Join [Company] As B"+ "Left Join [Product] As C on C.LocationId = A.LocationId"
  • 13. +"GROUP BY ProductDesc"; } catch(Exception ex) { System.out.println(e.toString()); } break; case "13": try { String sql = "SELECT (CompanyDesc) FROM [Company] A"+ " Join [Production_Dtl] As B "+ "Left Join [Production_Hdr] As C on C.ProductionId = B.ProductionId" +"WHERE (ProductionId)=null" +"GROUP BY ProductId";
  • 14. } catch(Exception ex) { System.out.println(e.toString()); } break; case "14": try { String sql = "SELECT top 1 FROM [Order_Hdr] A"+ " Join [User] As B "+ "Order by A.OrderQty Asc"; } catch(Exception ex) { System.out.println(e.toString());
  • 15. } break; case "15": try { String sql = "SELECT top 1 FROM [Order_Hdr] A"+ " Join [User] As B "+ "Order by A.OrderQty Desc"; } catch(Exception ex) { System.out.println(e.toString()); }
  • 16. break; case "16": String sql = "SELECT * FROM [Product] A"+ " Left Join [Production_Hdr] As B on A.Description = B.Description" +"Left Join [Production_Dtl] as C " +"Left Join [Orders] as D " +"Order By (C.UnitsOnHand, C.UnitsCost) "; break; default: e = new Exception ("Invalid mode. Mode: " + mode); }; return e; } public Exception performRequest(Connection conn, String x) {
  • 17. // TODO Auto-generated method stub return null; // TODO Auto-generated method stub } }