Same column names in JOIN getting "column not found" error in ResultSet

Based on your error message I assume that you are using MySQL with the latest connector.

You can utilize the positional queries if necessary, this is using the number on which position on which the element could be find for example:

rs2.getString(1);

(Yes the numbering starts at 1...) It should be equivalent to this (of course without the capitalization problem):

rs2.getString("Sname");

This way you have to know the position only, but if you look at case sensitivity in the database/driver is pretty much the question of settings. To get around most of the problems I write my queries in capital if possible and without a backtick `.

To explore your ResultSet object try the following:

Statement statement = ...;
String queryString = "SELECT s.name sname,s.city scity,f.name fname, f.city fcity, su.name suname, su.city sucity "
        +" FROM `order_details` ot "
        +" INNER JOIN `order` o ON ot.odr_id = o.odr_id "
        +" INNER JOIN `product` p ON ot.pro_id = p.id "
        +" INNER JOIN `firm` f ON o.firm_id = f.id "
        +" INNER JOIN `shipp` s ON o.shipp_id = s.id "
        +" INNER JOIN `supplier` su ON o.sup_id = su.id ";
ResultSet resultSet = statement.executeQuery(queryString);
ResultSetMetaData metaData = resultSet.getMetaData();
int colCount = metaData.getColumnCount();
if (resultSet.next()) {
    for (int i = 1; i <= colCount; i++) {
        System.out.println("Col(" + i + ") '" + metaData.getColumnName(i) + "' value:" + resultSet.getString(i));
    }
}else{
   System.out.println("No row found.");
}

This snippet will print first results the columns and values which are returned by the driver you are using.