Question: So what I want to do is "Update the 'usertype' column in the 'user' table `WHERE` the email(/user) value is obtained from the textbox"

```
JButton GrantButton = new JButton("Grant Seller Access");
GrantButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent arg0) {
        try {
            String update_query = "UPDATE user SET usertype = 'seller' WHERE email = " & GrantField.getText()";"
            //Here is where the error is stated on eclipse

            PreparedStatement pSt = connect.prepareStatement(update_query);
            pSt.setString(1, GrantField.getText());

            pSt.execute();

            JOptionPane.showMessageDialog(null, "The Request has been approved");

        } catch (Exception e) {                            
            e.printStackTrace();
        }           
    }
});  

```

> 
> Is it possible to do this?
> 
> 
> 

Any help will be appreciated.

Answer: 
I'm going to attempt to answer your question with what I think you want. 

First, I think you need to use the [JavaScript button group](http://getbootstrap.com/javascript/#buttons-checkbox-radio) from Bootstrap in order to get the behavior you want. You can change them to [vertical](http://getbootstrap.com/components/#btn-groups-vertical), but you will have to manually add overriding style to put spaces between them.

Do you actually want the radios still showing or not? If not, this code might suffice (minus the CSS to change color of active state and increase spacing between buttons)

**Rails html.erb**

```
  <div class="field form-group">
    <%= f.label :answer_id %><br>
    <div class="btn-group-vertical" data-toggle="buttons">
      <%= f.label :answer_id, class: "btn btn-primary active" do %>
        <%= f.radio_button :answer_id, 5, checked: true %>
        Arf! Love them.
      <% end %>
      <%= f.label :answer_id, class: "btn btn-primary" do %>
        <%= f.radio_button :answer_id, 6 %>
        They're okay.
      <% end %>
      <%= f.label :answer_id, class: "btn btn-primary" do %>
        <%= f.radio_button :answer_id, 7 %>
        Bah humbug.
      <% end %>
    </div>
  </div>

```

**Compiled html**

```
  <div class="field form-group">
    <label for="user_response_answer_id">Answer</label><br>
    <div class="btn-group-vertical" data-toggle="buttons">
      <label class="btn btn-primary active" for="user_response_answer_id">
        <input type="radio" value="5" checked="checked" name="user_response[answer_id]" id="user_response_answer_id_5" />
        Arf! Love them.
</label>      <label class="btn btn-primary" for="user_response_answer_id">
        <input type="radio" value="6" name="user_response[answer_id]" id="user_response_answer_id_6" />
        They're okay.
</label>      <label class="btn btn-primary" for="user_response_answer_id">
        <input type="radio" value="7" name="user_response[answer_id]" id="user_response_answer_id_7" />
        Bah humbug.
</label>    </div>
  </div>

```

I don't have enough reputation points to post a screenshot! If you like my answer, I think I will have enough and then I can edit this to include the screenshot.

*I apologize if there are any typos - I was using an existing app where the table is Locations and the field was distance, so if you see "location" or "distance" anywhere, just substitute "user\_response" and "answer\_id"*
This may be helpful for you 

```
<body>
<div class='answer-body form-group' >
    <input type="radio"  value="5" name="user_response[answer_id]" id="user_response_answer_id_5" />
    <label class="btn btn-primary" data-toggle="button" id="btn1" onclick="func(this.previousSibling.previousSibling.id, this.id)" for="user_response_answer_id_5">Arf! Love them.</label>
</div>

<div class='answer-body form-group' >
    <input type="radio" value="6" name="user_response[answer_id]" id="user_response_answer_id_6" />
    <label class="btn btn-primary" data-toggle="button" id="btn2" onclick="func(this.previousSibling.previousSibling.id, this.id)" for="user_response_answer_id_6">They&#39;re okay</label>
</div>

<div class='answer-body form-group' >
    <input type="radio" value="7" name="user_response[answer_id]" id="user_response_answer_id_7" />
    <label class="btn btn-primary" data-toggle="button" id="btn3" onclick="func(this.previousSibling.previousSibling.id, this.id)" for="user_response_answer_id_7">Bah humbug</label>
</div>
<script>
     function func(sender, obj)
    {

      document.getElementById(sender).checked=true;
      document.getElementById(obj).style.background='#5cb85c';

    }
    </script>
  </body>

```