Question: I am trying to use two `TapGestures` on two labels, but it always shows the result of last one TapGesture. My code is as follows:

```
 [write_review_label addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(open_view:)]];
[map_image addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(open_view:)]];
write_review_label.tag = 1;
map_image.tag = 2;

-(void)open_view:(UITapGestureRecognizer *)recog1
{
NSLog( @"recog1.view.tag == %d",recog1.view.tag);
if (recog1.view.tag==2)
{
    [self performSegueWithIdentifier:@"mapsegue" sender:self];
}
else
    [self performSegueWithIdentifier:@"loginsegue" sender:self];
 }

```

Answer: 
This line should be

```
String sql="SELECT id,price FROM item WHERE item.name='item_name'";

```

like this

```
String sql="SELECT id,price FROM item WHERE item.name='"+item_name+"'";

```
try this code . 

```
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/myshop","root","mysql");
            PreparedStatement pt=con.prepareStatement("SELECT id,price FROM item WHERE item.name=?");
            pt.setString(1,"item_name");
          ResultSet rs;
           if(pt.execute())
           {
                rs=pt.getResultSet();
               JOptionPane.showMessageDialog(this, "succes","executed query",JOptionPane.PLAIN_MESSAGE);
          }
           else {
    System.err.println("select failed");
           }

        while(rs.next()){
    item_id=rs.getInt(1);
    item_price=rs.getInt(2);
    jTextField1.setText(""+item_price);//displaying product price in a jTextField1
    jTextField2.setText(""+item_id);//displaying product id in a jTextField2    

        }

```