![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Dec 2005
Posts: 40
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Sexy Programmer
|
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! |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Dec 2005
Posts: 40
Rep Power: 0
![]() |
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? |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Take a look at web application framework like Spring, Tapestry or RIFE.
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Dec 2005
Posts: 40
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#6 |
|
Programmer
Join Date: Dec 2005
Posts: 40
Rep Power: 0
![]() |
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? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|