Abstract
It is conventional for Java developers to access database engines through standard JDBC API which requires passing SQL queries in plain Java strings. This is referred to as embedding of SQL queries into Java. The strings are not checked at compile time, and errors in the queries (e.g. syntax errors or misspelled names) are usually detected only by testing. In this paper we describe a tool which statically analyzes SQL queries embedded into Java programs. It combines a sound syntactic analyzer with a testing facility which generates small tests to detect errors in individual queries and runs them on an actual database engine. The tool is implemented as a plug-in for Eclipse IDE and allows for interactive use in real-life projects.
This work was partially supported by the Estonian Science Foundation grant #8421, as well as the Software Technology and Applications Competence Center (STACC), and the European Regional Development Fund through the Estonian Center of Excellence in Computer Science, EXCS.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
SeamlessSQL (2008), http://www.bugfreesql.com/
Optim pureQuery Runtime (2009), http://www-01.ibm.com/software/data/optim/purequery-runtime/
Bison parser generator (2010), http://www.gnu.org/software/bison/
Eclipse IDE (2010), http://www.eclipse.org
IntelliJ IDEA (2010), http://www.jetbrains.com/idea/
Christensen, A.S., Møller, A., Schwartzbach, M.I.: Precise analysis of string expressions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 1–18. Springer, Heidelberg (2003)
Doh, K.G., Kim, H., Schmidt, D.A.: Abstract parsing: Static analysis of dynamically generated string output using LR-parsing technology. In: Palsberg, J., Su, Z. (eds.) Static Analysis. LNCS, vol. 5673, pp. 256–272. Springer, Heidelberg (2009)
Klein, G.: JFlex Scanner Generator (2009), http://www.jflex.org
Kong, S., Choi, W., Yi, K.: Abstract parsing for two-staged languages with concatenation. In: Proceedings of the Eighth International Conference on Generative Programming and Component Engineering, GPCE 2009, pp. 109–116. ACM, New York (2009)
Thiemann, P.: Grammar-based analysis of string expressions. In: Proceedings of the 2005 ACM SIGPLAN International Workshop on Types in languages Design and Implementation, TLDI 2005, pp. 59–70. ACM, New York (2005)
Tomita, M.: Generalized L.R. Parsing. Kluwer Academic Publishers, Norwell (1991)
Wassermann, G., Gould, C., Su, Z., Devanbu, P.: Static checking of dynamically generated queries in database applications. ACM Trans. Softw. Eng. Methodol. 16(4), 14 (2007)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Annamaa, A., Breslav, A., Kabanov, J., Vene, V. (2010). An Interactive Tool for Analyzing Embedded SQL Queries. In: Ueda, K. (eds) Programming Languages and Systems. APLAS 2010. Lecture Notes in Computer Science, vol 6461. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-17164-2_10
Download citation
DOI: https://doi.org/10.1007/978-3-642-17164-2_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-17163-5
Online ISBN: 978-3-642-17164-2
eBook Packages: Computer ScienceComputer Science (R0)