Select the Oracle java - ORA-00905: not found keyword
<p>I'm trying to run a connection test in the bank and extract some information , apena s to study it, but I'm bumping into the following error:</p>

<pre><code>    Exception in thread "main" java.sql.SQLException: ORA-00905: 
not found keyword

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
        at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
        at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
        at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1272)
        at Principal.Principal.main(Principal.java:46)
</code></pre>

<p>when I run the code with a simple select , such as <code>select * from plan;</code> it works perfectly.</p>

<p>How can I fix this error code and there is a simpler way to perform a select in oracle database or this code is enough?</p>

<p>I want to run the query shows all the column values ​​1 ( ICCID ) , on the island.</p>

<p><a href="https://i.stack.imgur.com/XTAqm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XTAqm.jpg" alt="ORA-00905: palavra-chave não encontrada"></a></p>

<pre><code>package Principal;
import java.sql.*;


public class Principal {

         public static void main(String[] args) throws Exception {

                   Connection conexao = ObterConexao();

                   Statement statement = conexao.createStatement();


                   String query = "SELECT a.rp_package_value AS ICCID, "
                           + "c.rrs_resource_value AS IMSI, "
                           + "  ( "
                                + "  CASE "
                                   + " WHEN (SUBSTR (c.rrs_resource_value, 6, 1) = SUBSTR (a.rp_package_value, 9, 1)) "
                                    + "AND (SUBSTR (c.rrs_resource_value, 6, 2) &lt;&gt; '00') -- valida se o HLR existe "
                                    + "THEN 'Valid' "
                                    + "ELSE 'Invalid' "
                                  + "END ) AS IMSI_CHECK , "
                                  + "rrs_resource_sts Status, rp_package_sts "
                                + "FROM mtaapp20.rm_packages a, "
                                  + "mtaapp20.rm_package_content b, "
                                  + "mtaapp20.rm_resource_stock c "
                                + "WHERE a.rp_package_value IN "
                                  + "(SELECT RRS_RESOURCE_VALUE "
                                  + "FROM mtaapp20.rm_resource_stock c "
                                  + "WHERE c.rrs_resource_tp_id = 6 "
                                  + "AND c.rrs_resource_pool = 30 "
                                  + "--AND a.rp_package_value like '89955053110002178148' "
                                  + "AND SUBSTR (RRS_RESOURCE_VALUE, 9, 2) like '%1%'  "
                                  + "AND c.rrs_resource_sts = 'ASSIGNED' "
                                  + ") "
                                + "AND a.rp_package_id = b.rpc_package_id "
                                + "AND c.rrs_resource_sts = a.rp_package_sts "
                                + "AND b.rpc_component_tp_id = 5 "
                                + "AND b.rpc_component_vl_id = c.rrs_id "
                                + "ORDER BY a.sys_creation_date DESC " ;





                   ResultSet resultSet = statement.executeQuery(query);


                   if (resultSet.next()) {

                            System.out.println(resultSet.getObject(2));

                   }

         }


         private static Connection ObterConexao() {

                   Connection conexao = null;


                   try {

                            Class.forName("oracle.jdbc.driver.OracleDriver");

                            conexao = DriverManager.getConnection(

                                               "jdbc:oracle:thin:@BRUX:1521:T00WM11", "user", "password");

                   } catch (ClassNotFoundException e) {

                            e.printStackTrace();

                   } catch (SQLException e) {

                            e.printStackTrace();

                   }


                   return conexao;

         }

}
</code></pre>