& Ldquo; Static verification & rdquo; For SQL calls in Java / Eclipse?

存储架构 2017-12-26

Writing Java in Eclipse, I've recently been bitten by a few trivial bugs where my SQL syntax has been off (e.g., not properly quoting a constant). Are there any tools I could use to help myself catch these as I write them?

IDEA from Intellij 8.x has an SQL parser that can recognize such things (it connects to a datasource that can read your database, and understands that standard JDBC calls inside Java Code have SQL inside their strings and does the SQL syntax highlighting.

There is at least one
such pluging for Eclipse (very alpha) but I don't know of any that are even trying to do the highlighting inside the java file the way IDEA does.

In practice, though, unless you are doing direct JDBC interaction, the SQL inside java code has limited usage, as there is often some kind of class in-between, and then IDEA thinks its a plain String.

Hello, buddy!

责编内容by:Hello, buddy! (源链)。感谢您的支持!

您可能感兴趣的

java的专题之数组和集合类——List和ArrayList... 由于处理列表的数据非常常见,而使用数组并不是很好操作,所以java专门提供了一组api(类),来帮助开发人员来处理 集合数据 。 所有的集合类实现了collection 最常用的collection有 Set和List ,Set的实现类是 HashSet ,而List的实现类...
Python vs Java – Comparison between Java and Pytho... 1. Why do we need to compare Python vs Java? Now that we have compared the pros and cons of Python , we must compare it to one of the most widely...
EQ_SELF_USE_OBJEC... I am writing an equals method in which two names are considered equal if they have the same first, middle, and last names. However, I keep getting the...
SQL Code Smells SQL Code Smells Some time ago, Phil Factor wrote his booklet 'SQL Code Smells', collecting together a whole range of SQL Coding practices that coul...
Android – Proguard has not compiled with Jod... I used Joda time API in my android project, my project didn't compile when i export a signed apk, it showing the error "Proguard returned with error c...