Create a flight database:
kahase in hindi means - from Where,i.e. source of flight
kahatak in hindi means - till where i.e. destination of flight
create table flights_test(flightno varchar(10), carrier
varchar(30), kahase varchar(30), kahatak varchar(30));
insert into flights_test values('JL-120','JET
AIRWAYS', 'MUMBAI', 'JAIPUR');
insert into flights_test values('KL-
102','KINGFISHER', 'DELHI', 'MUMBAI');
insert into flights_test values('AI-
229','INDIAN', 'KOLKATA', 'DELHI');
insert into flights_test values('SP-
109','SPICEJET', 'CHENNAI', 'MUMBAI');
insert into flights_test values('GO-120','GO
AIR', 'MUMBAI', 'BANGALORE');
kahase in hindi means - from Where,i.e. source of flight
kahatak in hindi means - till where i.e. destination of flight
Entity corresponding to database :
package entity;
public class Flight {
private String flightNo;
private String carrier;
private String from;
private String to;
public String getFlightNo() {
return flightNo;
}
public void setFlightNo(String flightNo) {
this.flightNo = flightNo;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String topackage entity;) { this.to = to; } }
public class Flight {
private String flightNo;
private String carrier;
private String from;
private String to;
public String getFlightNo() {
return flightNo;
}
public void setFlightNo(String flightNo) {
this.flightNo = flightNo;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
}
This database and pojo is used by following posts, eg. -
- Using jdbc-template to create data access layer
- Mapping the resultset to object or class
- The Spring Jdbc Template for database access - Tutorial
No comments:
Post a Comment