java - ORA-00933: SQL command not properly ended in scriptlet -


I have this code which is in a script to connect to the Oracle 11g database. It sits in an ASP and returns data from the database (Please note about this fact, the scripts are used and the MVC pattern has been ignored, I can not do anything about it) when I I try to connect to the database and run a query This error java.sql.SQLSyntaxErrorException: ORA-00933: SQL command did not end correctly. Can someone please review the code and see what I am doing wrong? Many thanks

driver myDriver = new oracle.jdbc.driver.OracleDriver (); DriverManager.registerDriver (myDriver); Connection Conn = Null; Statement statement = null; Result result result = null; String DBURL = "jdbc: oracle: thin: @localhost: 1521: aaa"; String dbc = "user"; String DBPASSWORD = "password"; Stringbuffer sql = new stringbuffer (); Sql.append ("Select 'A', (* *) from the queue where preference

There are rows that require spaces, for example:

  sql.append ("union"); Calculate (*) with Sql.append ("Select 'ii', iiquue);  

The result will be: unionselect 'ii', counting from iiqueue (*)

Thal will generate an ORA 00933


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -