▁statements ▁are ▁normally ▁executed ▁through ▁a ▁non - SQL ▁binary ▁protocol ▁for ▁efficiency ▁and ▁protection ▁from ▁SQL ▁injection , ▁but ▁with ▁some ▁DB MS s ▁such ▁as ▁MySQL ▁prepared ▁statements ▁are ▁also ▁available ▁using ▁a ▁SQL ▁syntax ▁for ▁debugging ▁purposes . ▁ ▁A ▁number ▁of ▁programming ▁languages ▁support ▁prepared ▁statements ▁in ▁their ▁standard ▁libraries ▁and ▁will ▁em ulate ▁them ▁on ▁the ▁client ▁side ▁even ▁if ▁the ▁underlying ▁DB MS ▁does ▁not ▁support ▁them , ▁including ▁Java ' s ▁J DBC , ▁Perl ' s ▁DB I , ▁PHP ' s ▁PDO ▁ ▁and ▁Python ' s ▁DB - API . ▁Client - side ▁em ulation ▁can ▁be ▁faster ▁for ▁queries ▁which ▁are ▁executed ▁only ▁once , ▁by ▁reducing ▁the ▁number ▁of ▁round ▁tri ps ▁to ▁the ▁server , ▁but ▁is ▁usually ▁slower ▁for ▁queries ▁executed ▁many ▁times . ▁It ▁res ists ▁SQL ▁injection ▁attacks ▁equally ▁effectively . ▁ ▁Many ▁types ▁of ▁SQL ▁injection ▁attacks ▁can ▁be ▁elimin ated ▁by ▁dis abling ▁liter als , ▁effectively ▁requiring ▁the ▁use ▁of ▁prepared ▁statements ; ▁ ▁only ▁H 2 ▁supports ▁this ▁feature . ▁ ▁Ex amples ▁ ▁Java ▁J DBC ▁ ▁This ▁example ▁uses ▁Java ▁and ▁J DBC : ▁ ▁import ▁com . mysql . jdbc . jdbc 2 . optional . M ys ql DataSource ; ▁import ▁java . sql . Connection ; ▁import ▁java . sql . Driver Manager ; ▁import ▁java . sql . P rep ared Statement ; ▁import ▁java . sql . Result Set ; ▁import ▁java . sql . SQL