public void saveOrder() throws Exception{
    orderSQL="INSERT INTO ORDERS(BUYER_NAME,";
    orderSQL += " SHIPPING_ADRESS, SHIPPING_ZIPCODE, SHIPPING_CITY)";
    orderSQL += " VALUES(?,?,?,?)";
    try{

	// load the driver and get a connection

	Class.forName("com.mysql.jdbc.Driver");
	con = DriverManager.getConnection(url);

	// turn off autocommit to handle transactions yourself

	con.setAutoCommit(false);
	orderPstmt = con.prepareStatement(orderSQL);
	orderPstmt.setString(1, buyerName);
	orderPstmt.setString(2, shippingAddress);
	orderPstmt.setString(3, shippingZipcode);
	orderPstmt.setString(4, shippingCity);
	orderPstmt.execute();

	// now handle all items in the cart

	saveOrderItems();
	sb.clear();
	con.commit();  // end the transaction
    }
    catch(Exception e){
	try{
	    con.rollback();    // failed, rollback the database
	}
	catch(Exception ee){}
	throw new Exception("Error saving Order", e);
    }
    finally{
	try {
	    rs.close();
	}
	catch(Exception e) {}       
	try {
	    stmt.close();
	}
	catch(Exception e) {}
	try{
	    orderPstmt.close();
	}
	catch(Exception e){}
	try{
	    orderItemPstmt.close();
	}
	catch(Exception e){}
	try{
	    con.close();
	}
	catch(Exception e){}
    }
  }