I am developing a two-tier java application that basically displays mySQL database results in a JTable in a GUI. The mySQL queries are typed in by the user in a textArea and then an 'execute command' button is pressed and the mySQL results corresponding to that command simply appear in the JTable.

The problem I am running into is when I try to type in a query such as "SELECT * FROM bikes WHERE COST=10000;" everything works as expected and results are returned. However, if I type in "select * from bikes where cost=10000;", no results are returned and basically nothing happens, not even getting an error. I tried running 'toUpperCase()' on the query, which didn't fix the problem.

I was wondering what might be causing this problem? I am aware that mySQL is not case sensitive, so it should work even if my SELECT is lower case... 
The code below is a snippet of the area that might be causing the problem.

public void setQuery(String query) throws SQLException, IllegalStateException{
        if(!connectedToDatabase)
            throw new IllegalStateException("Not Connected to Database");


        String firstWord = query.substring(0, 6);
        if(firstWord.toUpperCase().equals("SELECT")){           
            resultSet = statement.executeQuery(query);
        }
        else if(firstWord.toUpperCase().equals("INSERT") || firstWord.toUpperCase().equals("DELETE") || firstWord.toUpperCase().equals("UPDATE")){
            statement2.executeUpdate(query);
        }

        metaData = resultSet.getMetaData();

        resultSet.last();
        numberOfRows = resultSet.getRow();
        fireTableStructureChanged();
    }



Question: how to Remove payment method, shipping information and shipping method
Answer: Amasty give a good idea.But if you want checkout all type of Product using checkout

Then follow below steps:

step1: make shipping same as billing address.

Step2:On Billing save action programmatically set free shipping as shipping method.

may like:

add below code which set shipping method on checkout after $this-&gt;getOnepage()-&gt;saveBilling($data, $customerAddressId);

$this-&gt;getOnepage()-&gt;getQuote()-&gt;getShippingAddress()-&gt;setShippingMethod($shippingMethod);
 $this-&gt;getOnepage()-&gt;getQuote()-&gt;collectTotals()-&gt;save();


Step3: Also on billing save action programmatically  save Zero Subtotal payment as  payment or any available payment gateway. exmaple:

$quote=$this-&gt;getOnepage()-&gt;getQuote()
        $paymentData = $this-&gt;_preparePaymentData($paymentData);
        if ($quote-&gt;isVirtual()) {
            $quote-&gt;getBillingAddress()-&gt;setPaymentMethod('free');
        } else {
            // check if shipping address is set
            if (is_null($quote-&gt;getShippingAddress()-&gt;getId())) {
               // error
            }
            $quote-&gt;getShippingAddress()-&gt;setPaymentMethod(
                isset($paymentData['method']) ? $paymentData['method'] : null
            );
        }

        if (!$quote-&gt;isVirtual() &amp;&amp; $quote-&gt;getShippingAddress()) {
            $quote-&gt;getShippingAddress()-&gt;setCollectShippingRates(true);
        }

        $total = $quote-&gt;getBaseSubtotal();
        try {
            $payment = $quote-&gt;getPayment();
            $payment-&gt;importData(array('method' =&gt; 'free'));
            $quote-&gt;setTotalsCollectedFlag(false)
                -&gt;collectTotals()
                -&gt;save();
        } catch (Mage_Core_Exception $e) {

        }


Step4: Goto review step using json return like:

try {

            // get section and redirect data
            $redirectUrl = $this-&gt;getOnepage()-&gt;getQuote()-&gt;getPayment()-&gt;getCheckoutRedirectUrl();
            if (empty($result['error']) &amp;&amp; !$redirectUrl) {
                $this-&gt;loadLayout('checkout_onepage_review');
                $result['goto_section'] = 'review';
                $result['update_section'] = array(
                    'name' =&gt; 'review',
                    'html' =&gt; $this-&gt;_getReviewHtml()
                );
            }
            if ($redirectUrl) {
                $result['redirect'] = $redirectUrl;
            }
        } catch (Mage_Payment_Exception $e) {
            if ($e-&gt;getFields()) {
                $result['fields'] = $e-&gt;getFields();
            }
            $result['error'] = $e-&gt;getMessage();
        } catch (Mage_Core_Exception $e) {
            $result['error'] = $e-&gt;getMessage();
        } catch (Exception $e) {
            Mage::logException($e);
            $result['error'] = $this-&gt;__('Unable to set Payment Method.');
        }
        $this-&gt;getResponse()-&gt;setBody(Mage::helper('core')-&gt;jsonEncode($result))