'How to add hive properties in java hive connections?

How to add hive properties in the java code. Below is the code I am using but it is not working.

private void connectToHiveAndRunQuery() {
    try {
        Class.forName(driverName);
        Connection con = DriverManager.getConnection(conName, "", "");
        stmt = con.createStatement();
        boolean resHivePropertyTest = stmt.execute("SET hive.auto.convert.join=false;");
    } catch (Exception e) {
        System.out.println("Error while connecting to hive.");
        e.printStackTrace();
    }
}

I need to set this property before running my SQL Hive query. Could you please guide?

boolean resHivePropertyTest = stmt.execute("SET hive.auto.convert.join = false;");


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source