JSquash: source code analysis of embedded database applications for determining SQL statements

  • Authors:
  • Dietmar Seipel;Andreas M. Boehm;Markus Fröhlich

  • Affiliations:
  • University of Würzburg, Department of Computer Science, Würzburg, Germany;University of Würzburg, Department of Computer Science, Würzburg, Germany;University of Würzburg, Department of Computer Science, Würzburg, Germany

  • Venue:
  • INAP'09 Proceedings of the 18th international conference on Applications of declarative programming and knowledge management
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, we analyse Java source code of embedded database applications by means of static code analysis. If the underlying database schema of such an application is subject to refactoring or database tuning, then the SQL statements in the embedding Java program need to be adapted correspondingly. This should be done mostly automatically, since changing software manually is error-prone and time consuming. For determining the SQL statements that access the database, we can either look at the database logfile, an audit file, or at the Java source code itself. Here, we show how to derive the strings of dynamic SQL statements directly from the Java source code. We do this without using a debugger or a virtual machine technique; instead, we trace the values of variables that contribute to a query string backwards to predict the values of contributing program variables as precisely as possible. We use PROLOG's declarative features and its backtracking mechanism for code analysis, refactoring, and tuning.