• DocumentCode
    415762
  • Title

    Static checking of dynamically generated queries in database applications

  • Author

    Gould, Carl ; Su, Zhendong ; Devanbu, Premkumar

  • Author_Institution
    Dept. of Comput. Sci., California Univ., Davis, CA, USA
  • fYear
    2004
  • fDate
    23-28 May 2004
  • Firstpage
    645
  • Lastpage
    654
  • Abstract
    Many data-intensive applications dynamically construct queries in response to client requests and execute them. Java servlets, e.g., can create string representations of SQL queries and then send the queries, using JDBC, to a database server for execution. The servlet programmer enjoys static checking via Java´s strong type system. However, the Java type system does little to check for possible errors in the dynamically generated SQL query strings. Thus, a type error in a generated selection query (e.g., comparing a string attribute with an integer) can result in an SQL runtime exception. Currently, such defects must be rooted out through careful testing, or (worse) might be found by customers at runtime. In this paper, we present a sound, static, program analysis technique to verify the correctness of dynamically generated query strings. We describe our analysis technique and provide soundness results for our static analysis algorithm. We also describe the details of a prototype tool based on the algorithm and present several illustrative defects found in senior software-engineering student-team projects, online tutorial examples, and a real-world purchase order system written by one of the authors.
  • Keywords
    Java; SQL; program diagnostics; query processing; Java servlet; SQL query strings; database querying; database server; program analysis; selection query; software engineering; static checking; Algorithm design and analysis; Application software; Computer science; Databases; Java; Programming profession; Runtime; Software prototyping; Testing; Web services;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Engineering, 2004. ICSE 2004. Proceedings. 26th International Conference on
  • ISSN
    0270-5257
  • Print_ISBN
    0-7695-2163-0
  • Type

    conf

  • DOI
    10.1109/ICSE.2004.1317486
  • Filename
    1317486