I don't use it anymore, but boy am I happy because it finally got multiline strings (text blocks). Writing a raw SQL will be so much easier and readable.
When I hear "raw sql query" the first question that pops in my mind is sql injection. How do you handle it? I am not saying there shouldn't be sql in the code, I was surprised of the 'raw" part
There are two options, the sql query is static and doesn't change. Or it's a prepared statement and they use bind parameters correctly. Either way, I'm not sure why raw sql immediately means sql injection to you.
That's raw SQL. But still uses prepared statement. SQL injection was never really a 'thing' in the Java world (unless you really don't know about it obviously) because even the earliest versions had prepared statements.
The other guy made good points: static queries and argument bindings.
There’s another that many people don’t consider depending on their line of work. Sql injection doesn’t always matter. If you’re making a web facing user portal, then yes it matters. If you’re making a dev tool for sys admins, it doesn’t because they already have the rights to nuke a DB
50
u/[deleted] Sep 15 '20
I don't use it anymore, but boy am I happy because it finally got multiline strings (text blocks). Writing a raw SQL will be so much easier and readable.