Issue Details (XML | Word | Printable)

Key: NUCRDBMS-432
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Unassigned
Reporter: Yang ZHONG
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Compile user-defined literals as JDBC parameters for queries

Created: 14/Jul/10 05:38 PM   Updated: 09/Apr/15 08:17 AM   Resolved: 08/Apr/15 07:09 PM
Component/s: Queries
Affects Version/s: 2.1.1
Fix Version/s: None

Environment: Java 5, Linux

Datastore: IBM DB2


 Description  « Hide
Literals in queries could have been compiled/generated as "?"(Prepared Parameter). Here's the demo.

Modify $JAVA_HOME/jre/lib/logging.properties:
2-1. add "DataNucleus.Datastore.Native.level=FINE"
2-2. Assure "java.util.logging.ConsoleHandler.level" at least "FINE"

Run the attached Test Case from
HTTP://WWW.DataNucleus.org/servlet/jira/browse/NUCRDBMS-430

See
SELECT 'org.datanucleus.test.Bool' AS NUCLEUS_TYPE,A0.BOOL,A0.BOOL_ID FROM BOOL A0 WHERE 'Y' = A0.BOOL
which could have been
SELECT 'org.datanucleus.test.Bool' AS NUCLEUS_TYPE,A0.BOOL,A0.BOOL_ID FROM BOOL A0 WHERE ? = A0.BOOL

Andy Jefferson added a comment - 15/Jul/10 07:34 AM
As already pointed out, users should make their literals as parameters if they want it to be a parameter. Far more important things to be doing

Andy Jefferson made changes - 15/Jul/10 07:34 AM
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]
Andy Jefferson added a comment - 04/Oct/10 02:52 PM
Change title to something meaningful

Andy Jefferson made changes - 04/Oct/10 02:52 PM
Summary Prepared Statement for query Compile user-defined literals as JDBC parameters for queries
Andy Jefferson added a comment - 08/Apr/15 07:09 PM
I still don't see the point in this when a user has the ability to put literals in as query parameters (a better way of doing things also, so their query is then more cacheable). Consequently "won't fix"

Andy Jefferson made changes - 08/Apr/15 07:09 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Andy Jefferson made changes - 09/Apr/15 08:17 AM
Status Resolved [ 5 ] Closed [ 6 ]