JDBC ã«ã¯ PreparedStatement ã¯ã©ã¹ãç¨æããã¦ãã¦ãSQL æã®ä¸é¨ããã©ã¡ã¼ã¿åãããã¨ãã§ããã ãã©ã¡ã¼ã¿é¨åã®ã¨ã¹ã±ã¼ãå¦ç㯠JDBC ãã©ã¤ããè¡ã£ã¦ãããã®ã§ãSQL ã¤ã³ã¸ã§ã¯ã·ã§ã³å¯¾çã¨ãã¦æè¿ã§ã¯å¿
é ã«ãªãã¤ã¤ãããã®ã¯ã©ã¹ãããããlike æ¼ç®åã使ãå ´åã¯ãã¡ãã£ã¨æ³¨æãå¿
è¦ã ã Lv 1 ãããã§æ¤ç´¢ãã¦ã¿ãã¨ã失æä¾ã¨ãã¦ã²ã£ããã£ã¦ããã®ããã®ãã¿ã¼ã³ã Statement stmt = conn.prepareStatement("select * from items where name like '?%'"); stmt.setString(1, "hatena"); ResultSet rs = stmt.executeQuery();name ã "hatena" ã§å§ã¾ãè¡ãé¸æãããã¨ãã¦ããããã ãã©ãããã ã¨ä¾å¤ã
{{#tags}}- {{label}}
{{/tags}}