Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Servlet and sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet and sql" Watch "Servlet and sql" New topic
Author

Servlet and sql

sello skhalo
Greenhorn

Joined: Sep 08, 2013
Posts: 9
Create a database named
MyCustomers, with the following
tables using
MySQL. Use the appropriate data types
and note that the underlined fields
denotes a field to be either a primary key or a foreign key Customers(CustomerID, Name,
Address, City) Orders(OrderID, CustomerID, Amount,
Date) Insert at least 5 records in each of the
tables appropriately. Include the
output for your database design and
the records for your tables.


Write a Java program to establish
a connection to the MyCustomers
database using the JDBC driver to
retrieve the entire Customers and
Orders
table. Use the Swing component TextArea to display the data and your
interface must use either menu items
or command buttons to trigger the
actions for retrieving the data.

Write a servlet program that searches
for a customer in the database you
designed in Question above. If the
customer is not in the database, add
the customer details to the database
and display the message “Customer is added to the database”. If the
customer is in the database, display
the
message “Already Existing Customer”
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

So what's your question?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sello skhalo
Greenhorn

Joined: Sep 08, 2013
Posts: 9
those are the questions,need to come up with the codings
will you please help me with them

Thank you
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

Sure, you can get lots of help here.

Please post your code and point out the problems you are having with it. Please be sure to UseCodeTags when you post code.
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

and don't try (and hope) to get someone doing exercises for you.


PM Me If You Want to get Urgent Help on Java Programming
sello skhalo
Greenhorn

Joined: Sep 08, 2013
Posts: 9
well am clues and dont knw where to start
how to start but as for the coding i can try them
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
The first step is to create a DB - that has nothing to do with Java, or any kind of coding. It involves installing MySQL, and familiarizing yourself with it as much as you need in order to create DB.

The next step is to create a Java program using JDBC and Swing. If you aren't familier with them (which you should be through the course you took for which this is apparently a problem set), ask your teacher for some introductory material, or links to same.

The last step is to write a servlet that also accesses the DB through JDBC. If you haven't done that before, download a servlet container such as Tomcat, and familiarize yourself with it. Again, introductory material should be available through your teacher, or he should be able to point you to it.


Ping & DNS - my free Android networking tools app
sello skhalo
Greenhorn

Joined: Sep 08, 2013
Posts: 9
ohk ive already installed the SQL
can anyone instruct me on how to create the database...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
MySQL has very extensive online documentation that describes all the necessary steps and decisions to be made.
 
 
subject: Servlet and sql