nadeem akhtar

Greenhorn
+ Follow
since Oct 17, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nadeem akhtar

Ulf Dittmer wrote:JEE (J2EE is an outdated name for it) is not an application, it is a framework for building applications. Any particular application built with it can have any number of layers/tiers. A common separation is the 3-tier approach: a view layer, a business layer, and a data layer (or persistence or integration layer).



please explain about this topic
why do we partition a web based application into layers?
which layers are produced as a result of this partion?
14 years ago
which technology is used in JAVA to support following layers?

1. presentation layer
2. Business layer
3. Data layer
14 years ago
why is J2EE said to be multi-tiered application?
import java.sql.*;

public class Assignment{

public static void main ( String args[]){

try{

Class.forName("jdbc.odbc.JdbcOdbcDriver");

String url = "jdbc:odbc:bankDSN";

Connection con= null;

con= DriverManager.getConnection(url,"","");


String sql = "SELECT * FROM Account";

PreparedStatement pStmt= con.prepateStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);



ResultSet rs = pStmt.executeQuery();

ResultSetMetaData rsmd = rs.getMetaData( );

int numColumns = rsmd.getColumnCount();

String cName;

for(int i =1; i<numColumns;i++)

{
cName = rsmd.getColumnName(i);
System.out.println(cName);
System.out.println("\t");

}

System.out.println(" ");
int AccountNo,AccountBal;
String ActHolderName,ActType;
while(rs.next( ))
{

AccountNo = rs.getInt(1);
ActHolderName= rs.getString(2);
ActType= rs.getString(3);
AccountBal= rs.getInt(4);


System.out.println(AccountNo);
System.out.println("\t");


System.out.println(ActHolderName);
System.out.println("\t");


System.out.println(ActType);
System.out.println("\t");


System.out.println(AccountBal);
System.out.println("\t");
System.out.println(" ");
}

con.close();
}catch(Exception sqlEx){
System.out.println(sqlEx);
}

}
}


//PLEASE CORRECT THE ERROR AND I WANT TO SEE QUERY RESULT IN SIMPLE GUI WINDOW. PLASE GIVE ME THE SOME HINT

import java.sql.*;

public class Assignment{

public static void main ( String args[]){

try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

String url = "jdbc:odbc:bankDSN";

Connection con= null;

con= DriverManager.getConnection(url,"","");


String sql = "SELECT * FROM Account";

PreparedStatement pStmt= con.prepateStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);



ResultSet rs = pStmt.executeQuery();

ResultSetMetaData rsmd = rs.getMetaData( );

int numColumns = rsmd.getColumnCount();

String cName;

for(int i =1; i<numColumns;i++)

{
cName = rsmd.getColumnName(i);
System.out.println(cName);
System.out.println("\t");

}

System.out.println(" ");
int AccountNo,AccountBal;
String ActHolderName,ActType;
while(rs.next( ))
{

AccountNo = rs.getInt(1);
ActHolderName= rs.getString(2);
ActType= rs.getString(3);
AccountBal= rs.getInt(4);


System.out.println(AccountNo);
System.out.println("\t");


System.out.println(ActHolderName);
System.out.println("\t");


System.out.println(ActType);
System.out.println("\t");


System.out.println(AccountBal);
System.out.println("\t");
System.out.println(" ");
}

con.close();
}catch(Exception sqlEx){
System.out.println(sqlEx);
}

}
}


Bear Bibeault wrote:Sounds like a homework project. What have you developed so far? What parts have you stuck?



i m just begner, please help me

Develop a simple GUI based database driven application for Bank system.

Core Requirements:

• Developing a simple GUI based database driven application
• Creating a database in MS Access
• Creating a system DSN
• Connecting to database
• Querying data from database through SQL statements


Detailed Description:

You are required to use MS Access to create a database named Bank and add a table named Account into this database.

The Account table must have following fields:

1. Account Number
2. Account Holder Name
3. Account Type
4. Account Balance

You must enter 10 records within Account table of Bank database.

Create a system DSN (Data Source Name) named bankDSN and use this DSN in a program to connect to this database.

Write a program which will have following functionalities:

1) A method which will have the functionality to connect to database.

2) A method which will retrieve all the records of user from database and display on GUI window. The top header of GUI window must have columns name of table Account. The column names displayed on GUI must be same as columns name within table of database. You have to use ResultSetMetaData object for this purpose. You cannot use hard coded values to display columns name.

 The above method will connect to this database and query all the records from the “Account” table using SQL statement and display them on GUI application.
 You can use Grid Layout to display the records from database to GUI application.
 You must use ResultSetMetaData to display exact name of columns of database table on the top of GUI application. Marks will be deducted in case of not using ResultSetMetaData.
Problem Statement:

You are required to develop a simple GUI (Graphical user interface) application for the registration of students in an institution. The program should be able to store the student data into a text file and when the user starts up the application again then previously stored data of student must also be saved into text file. The program should be able to handle events such as ActionEvent and ItemEvent.



The class Student must have following attributes:

• Student Id
• Student name
• Student father’s name
• Student age
• Phone number
• Study Program


The output of the GUI may be as given below:

The GUI must have labels, text boxes, combo box and buttons as shown in the figure below. The title of application must be displayed within center at the top of application.

14 years ago
Problem Statement:

You are required to develop a simple GUI (Graphical user interface) application for the registration of students in an institution. The program should be able to store the student data into a text file and when the user starts up the application again then previously stored data of student must also be saved into text file. The program should be able to handle events such as ActionEvent and ItemEvent.



The class Student must have following attributes:

• Student Id
• Student name
• Student father’s name
• Student age
• Phone number
• Study Program


The output of the GUI may be as given below:

The GUI must have labels, text boxes, combo box and buttons as shown in the figure below. The title of application must be displayed within center at the top of application.

14 years ago
Problem Statement

Write the code to implement the concept of inheritance for Vehicles. You are required to implement inheritance between classes. You have to write four classes in java i.e. one super class, two sub classes and one driver class.

Vehicle is the super class whereas Bus and Truck are sub classes of Vehicle class. Transport is a driver class which contains main method.


Detailed description:


Detailed description of Vehicle (Super class):

The class Vehicle must have following attributes:

1. Vehicle model
2. Registration number
3. Vehicle speed (km/hour)
4. Fuel capacity (liters)
5. Fuel consumption (kilo meters/liter)

The Vehicle class must have following methods:

1. Parameterized constructor that will initialize all the data members with the given values.
2. Getters and Setters for each data member that will get and set the values of data members of class.
3. A method fuelNeeded() that will take distance (in kilo meter) as an argument. It will calculate the amount of fuel needed for the given distance and will return the value of fuel needed for given distance. You can use the attributes ‘Fuel consumption’ defined within above Vehicle class to determine the fuel needed for the given distance. You are required to implement this functionality by yourself.
4. A method distanceCovered() that will take time (in hours) as an argument. It will calculate the distance for the given time and speed and returns the value of distance. The formula to calculate speed is given as speed = distance/time. You can use this formula to calculate the distance.
5. A display() method that will display all the information of a vehicle.


Detailed description of Truck (Sub class):

The class Truck must have following attribute:
Cargo weight limit (Kilo grams)

The above class must have following methods:

1. Parameterized constructor that will initialize all data members with the given values.
2. Getters and setters for each data member that will get and set the values of data members of class.
3. It must also override the display() method of Vehicle class and must call display() method of super class within overridden method.


Detailed description of Bus (Sub class):

The class Bus must have following attribute:
No of passengers


The above class must have following methods:

1. Parameterized constructor that will initialize all the data members with given values.
2. Getters and setters that will get and set the value of each data member of class.
3. It must also override the display() method of Vehicle class and must call display method of super class within overridden method.

Create a class Transport which contains the main method. Perform the following within main method:

• Create an instance of class Truck and initialize all the data members with proper values.
• Create an instance of class Bus and initialize all the data members with proper values.
• Now, call fuelNeeded(), distanceCovered() and display() methods using objects of these classes.
14 years ago