Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 17th, 2006, 8:01 AM   #1
BungalowBill
Programmer
 
Join Date: Dec 2005
Posts: 40
Rep Power: 0 BungalowBill is on a distinguished road
An eclipse project

I want to use eclipse to make a simple order form.

I want to make some forms using html or jsp, then have some java code to connect to an existing java database.

I want the form to only display whats in the database, and when a customer clicks an order button, i want the database quantity information to be updated.

I'd also like a section for the customer to enter details, which are then added to a database.

Does anyone have any resources that could be useful?

thanks.
BungalowBill is offline   Reply With Quote
Old Apr 17th, 2006, 9:32 AM   #2
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Well, how much HTML, Java, and JSP do you know? Eclipse won't be able to do it for you, it's only a IDE which you write the project. I would look up databasing with JSP and how to connect it with Java. The JSP and HTML should be easy. Maybe this would help:

http://www.javaworld.com/javaworld/j...ssj-forms.html

I know it just shows you how to make a simple form but expand your mind and use your knowledge to customize that form.
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Apr 19th, 2006, 3:42 AM   #3
BungalowBill
Programmer
 
Join Date: Dec 2005
Posts: 40
Rep Power: 0 BungalowBill is on a distinguished road
Thanks, but i want the radio buttons to be populated by looking to see whats in the database.

Any clue of where i could find something like that?
BungalowBill is offline   Reply With Quote
Old Apr 19th, 2006, 6:06 AM   #4
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Take a look at web application framework like Spring, Tapestry or RIFE.
Arevos is offline   Reply With Quote
Old Apr 19th, 2006, 9:16 AM   #5
BungalowBill
Programmer
 
Join Date: Dec 2005
Posts: 40
Rep Power: 0 BungalowBill is on a distinguished road
Thanks but i want to use eclipse. Im almost there. I've managed to make a few pages, with a consistent menu system on each page to link them together.

Plus i've managed to populate all the radiobutton lists from the DB.

So all thats left is for me to write the part that recognises the selections they've made with the radio buttons and to subtract this order from the quantity in the DB.

Does anyone have any code which would do that? OR any more resources?

thanks for all the help.
BungalowBill is offline   Reply With Quote
Old Apr 21st, 2006, 8:59 AM   #6
BungalowBill
Programmer
 
Join Date: Dec 2005
Posts: 40
Rep Power: 0 BungalowBill is on a distinguished road
I don't know if anyone is still bothered about this but i have a new problem. This piece of code doesn't seem to be doing what i want. What is happening here is that i've submitted the form and now this method has been called to insert the order details in a table with name 'Order'. instead what happens is that nothing goes into the database. I have an almost identical method called insertCustomer which inserts the customer details into a table called 'Customer Details' and that works fine, so the connection to the database must be okay.

public void insertOrder(int guitarID, int ampID, int CustID)throws ClassNotFoundException, InstantiationException, IllegalAccessException{
		DbBean db = new DbBean();
	
		try {
			db.connect();
			//int max = db.getMaxValue("Order", "ID");
			//increment by one to generate unique id
			//max = max+1;
			PreparedStatement inst = db.prepareStatement("INSERT INTO order VALUES(?,?,?)");
			//inst.setInt(1,max);
			inst.setInt(1,guitarID);
			inst.setInt(2,ampID);
			inst.setInt(3,CustID);
			inst.executeUpdate();
			inst.close();
		
			// close the database connection
			db.close();
		} catch (SQLException e) {
			System.out.println(
				"SQLException from db: " + e.getMessage());
			e.printStackTrace();
		}
	}

i had to comment out the getMaxValue method. What that does it basically get the value from an ID column in the database at table 'Order' and make sure this new row's that im inserting ID is one more than that. But my database has autonumber in that column so it shouldn't make a difference. Every time i run it with it included i get this message:-

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException



So im forced to run it without the getMaxValue Method. Do you think this has something to do with the problem?
BungalowBill is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:34 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC