2080 8

BIT401 ยท 2080 ยท 5 marks

How prepared statements differs from statements? Explain use of prepared statements with example.

How prepared statements differs from statements? Explain use of prepared statements with example. [5]

Advanced Java ProgrammingChapter 5: Database Connectivity with JDBCDifferences between Statement and PreparedStatement

Aspect Statement Prepared Statement -------------------------------------- Compilation SQL query compiled every time it executes SQL query pre-compiled once, reused multiple times Performance Slower for repeated queries Faster for repeated queries SQL Injection Vulnerable to SQL injection attacks...