<?xml version="1.0" encoding="UTF-8"?>











<rss version="2.0" xmlns:jf="http://www.jivesoftware.com/xmlns/jiveforums/rss">



<channel>
    <title>Support Forums: Message List - PreparedStatement using LIKE clause</title>
    <link>http://www.theserverside.com</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    
        <generator>Jive Forums Silver 5.5.30 (www.jivesoftware.com)</generator>
    
    <pubDate>Thu, 20 Jun 2013 04:51:44 -0400</pubDate>


    <item>

        <title>PreparedStatement using LIKE clause</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[<p>Hi,</p>...]]></description>
        

        <pubDate>Wed, 15 Dec 2010 19:55:28 -0500</pubDate>

        

        <jf:creationDate>Wed, 15 Dec 2010 19:55:28 -0500</jf:creationDate>
        <jf:modificationDate>Wed, 15 Dec 2010 19:55:28 -0500</jf:modificationDate>
        <jf:date>Dec 15, 2010</jf:date>
        <jf:author>Omar Valerio</jf:author>
        <jf:replyCount>0</jf:replyCount>
    </item>


    <item>

        <title>here is the answer</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[% is used as a wildcard in every SQL implementation I have seen. I believe its in the ANSI SQL Standard. <br><br>so when you do your do the following<br><br>String whereValue = '%myVal%'<br><br>pstmt.setString(1,whereValue);<br><br><br>only do the %...]]></description>
        

        <pubDate>Sun, 10 Apr 2005 18:24:06 -0400</pubDate>

        

        <jf:creationDate>Sun, 10 Apr 2005 18:24:06 -0400</jf:creationDate>
        <jf:modificationDate>Sun, 10 Apr 2005 18:24:06 -0400</jf:modificationDate>
        <jf:date>Apr 10, 2005</jf:date>
        <jf:author>Ryan Gaffuri</jf:author>
        <jf:replyCount>0</jf:replyCount>
    </item>


    <item>

        <title>PreparedStatement using LIKE clause</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[I guess the prepared statement doesn't work for the clauses of type &quot;like&quot; or &quot;in&quot;.<br><br>I got bitted by &quot;in&quot; for sure and I suspect it is case for &quot;like&quot; too.<br><br>ex:  select * from employee where employee_id...]]></description>
        

        <pubDate>Fri, 08 Apr 2005 14:37:33 -0400</pubDate>

        

        <jf:creationDate>Fri, 08 Apr 2005 14:37:33 -0400</jf:creationDate>
        <jf:modificationDate>Fri, 08 Apr 2005 14:37:33 -0400</jf:modificationDate>
        <jf:date>Apr 8, 2005</jf:date>
        <jf:author>satya katta</jf:author>
        <jf:replyCount>1</jf:replyCount>
    </item>


    <item>

        <title>Still no success</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[It seems that not even this is working... <br><br>ps = conn.prepareStatement(&quot;SELECT * FROM table WHERE fieldName LIKE ?&quot;);<br>ps.setString(1, &quot;Fubar&quot;);<br><br>Might I have some weird config problem? Running Java 1.4.2 on Win XP with...]]></description>
        

        <pubDate>Fri, 08 Apr 2005 06:31:39 -0400</pubDate>

        

        <jf:creationDate>Fri, 08 Apr 2005 06:31:39 -0400</jf:creationDate>
        <jf:modificationDate>Fri, 08 Apr 2005 06:31:39 -0400</jf:modificationDate>
        <jf:date>Apr 8, 2005</jf:date>
        <jf:author>G�ran Golcher</jf:author>
        <jf:replyCount>0</jf:replyCount>
    </item>


    <item>

        <title>RE: PreparedStatement using LIKE clause</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[String sql = &quot;SELECT * FROM table WHERE field LIKE ?;<br>PreparedStatement ps = conn.prepareStatement(sql);<br>ps.setString(1, &quot;A%\&quot;&quot;);]]></description>
        

        <pubDate>Thu, 07 Apr 2005 23:05:39 -0400</pubDate>

        

        <jf:creationDate>Thu, 07 Apr 2005 23:05:39 -0400</jf:creationDate>
        <jf:modificationDate>Thu, 07 Apr 2005 23:05:39 -0400</jf:modificationDate>
        <jf:date>Apr 7, 2005</jf:date>
        <jf:author>Petr Musil</jf:author>
        <jf:replyCount>1</jf:replyCount>
    </item>


    <item>

        <title>PreparedStatement using LIKE clause</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[Sorry Udayan, that doesn't change the result. Besides, not having to add the extra ' before and after the [var] is my main reason for using ps.setString.]]></description>
        

        <pubDate>Thu, 07 Apr 2005 10:34:31 -0400</pubDate>

        

        <jf:creationDate>Thu, 07 Apr 2005 10:34:31 -0400</jf:creationDate>
        <jf:modificationDate>Thu, 07 Apr 2005 10:34:31 -0400</jf:modificationDate>
        <jf:date>Apr 7, 2005</jf:date>
        <jf:author>G�ran Golcher</jf:author>
        <jf:replyCount>0</jf:replyCount>
    </item>


    <item>

        <title>PreparedStatement using LIKE clause</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[ps.setString(1, &quot;'&quot; + var + &quot;'&quot;);]]></description>
        

        <pubDate>Thu, 07 Apr 2005 10:23:20 -0400</pubDate>

        

        <jf:creationDate>Thu, 07 Apr 2005 10:23:20 -0400</jf:creationDate>
        <jf:modificationDate>Thu, 07 Apr 2005 10:23:20 -0400</jf:modificationDate>
        <jf:date>Apr 7, 2005</jf:date>
        <jf:author>patel123</jf:author>
        <jf:replyCount>1</jf:replyCount>
    </item>


    <item>

        <title>PreparedStatement using LIKE clause</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=33182</link>

        

        
            <description><![CDATA[I have a working connection and the following works<br>String sql = &quot;SELECT * FROM table WHERE field LIKE 'A%'&quot;;<br>PreparedStatement ps = conn.prepareStatement(sql);<br>ResultSet rs = ps.executeQuery();<br><br>I do however want to be able to...]]></description>
        

        <pubDate>Thu, 07 Apr 2005 09:21:30 -0400</pubDate>

        

        <jf:creationDate>Thu, 07 Apr 2005 09:21:30 -0400</jf:creationDate>
        <jf:modificationDate>Thu, 07 Apr 2005 09:21:30 -0400</jf:modificationDate>
        <jf:date>Apr 7, 2005</jf:date>
        <jf:author>G�ran Golcher</jf:author>
        <jf:replyCount>7</jf:replyCount>
    </item>



</channel>
</rss>

