<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Service2Max &#187; Coldfusion Archiv  &#8211; Blog für Programmierer und Software-Architekten</title>
	<atom:link href="http://blog.service2max.ch/category/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.service2max.ch</link>
	<description>Technik, die begeistert</description>
	<lastBuildDate>Sat, 14 May 2011 16:47:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MS-SQL 2008 Volltextsuche mit Stopwörtern und Coldfusion 8</title>
		<link>http://blog.service2max.ch/ms-sql-2008-volltextsuche-stopwoerter-coldfusion-8/</link>
		<comments>http://blog.service2max.ch/ms-sql-2008-volltextsuche-stopwoerter-coldfusion-8/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 15:00:00 +0000</pubDate>
		<dc:creator>Patrick Matsumura</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://blog.service2max.ch/?p=236</guid>
		<description><![CDATA[Heute stand ich vor dem Problem, dass ich eine Volltextsuche mit Coldfusion 8 auf einer MS-SQL 2008 Datenbank realisieren musste. Im ersten Moment dachte ich, dass darin kein Problem besteht. Spätestens als ich versuchte eine Volltextsuche inklusive Stopwort (Wörter wie in, um, und, mit, bei, uns, usw.) mit Coldfusions &#60;cfquery&#62; zu machen, stiess ich auf [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.service2max.ch%2Fms-sql-2008-volltextsuche-stopwoerter-coldfusion-8%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.service2max.ch%2Fms-sql-2008-volltextsuche-stopwoerter-coldfusion-8%2F&amp;source=service2max&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Heute stand ich vor dem Problem, dass ich eine Volltextsuche mit Coldfusion 8 auf einer MS-SQL 2008 Datenbank realisieren musste. Im ersten Moment dachte ich, dass darin kein Problem besteht. Spätestens als ich versuchte eine Volltextsuche inklusive Stopwort (Wörter wie in, um, und, mit, bei, uns, usw.) mit Coldfusions <strong>&lt;cfquery&gt;</strong> zu machen, stiess ich auf leere Resultsets. Das gleiche Query im QueryAnalizer oder im SQL Server Management Studio brachte mir die gewünschten Ergebnisse.</p>
<p>Das Problem ist, dass MS-SQL 2008 zwei Resultsets zurückliefert. Das erste ist leer bzw. es enthält die Information, dass der SQL-Server mindestens ein Füllwort gefunden hat und es darum ignoeriert und das zweite enthält das gewünschte Ergebnis der Suche. Nachdem Coldfusions DataDirect Treiber diese &#8220;Information&#8221; nicht verarbeiten kann, geht es einfach davon aus, dass das Ergbnis ein leeres Resultset ist. Mit diesem Wissen stand ich vor einem neuen Problem: Wie bekomme ich das zweite Resultset von der Abfrage?<span id="more-236"></span></p>
<h3>Lösung</h3>
<p>Die Lösung ist relativ einfach. Ich speichere zunächst mein Query mit Hilfe von &lt;cfsavecontent&gt; in eine Variable. Danach rufe ich die gespeicherte Prozedur (stored Procedure) &#8220;sp_executesql&#8221; auf und übergebe als Parameter mein zuvor gespeichertes Query.</p>
<p>Etwas Code hilft:</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfset mySearchString = &quot;Hund, Katze und Maus&quot; /&gt;
&lt;cfsavecontent variable=&quot;queryString&quot;&gt;
	&lt;cfoutput&gt;
SELECT * FROM CONTAINSTABLE(searchTable,searchColumn, '#mySearchString#', LANGUAGE 'GERMAN')
	&lt;/cfoutput&gt;
&lt;/cfsavecontent&gt;

&lt;cfstoredproc datasource=&quot;myDB&quot; procedure=&quot;sp_executesql&quot;&gt;

      &lt;cfprocparam  cfsqltype=&quot;CF_SQL_VARCHAR&quot; value=&quot;#queryString#&quot;&gt;
      &lt;cfprocresult name=&quot;VARIABLES.result1&quot; resultset=&quot;1&quot;&gt;
      &lt;cfprocresult name=&quot;VARIABLES.result2&quot; resultset=&quot;2&quot;&gt;

&lt;/cfstoredproc&gt;

&lt;cfdump var=&quot;#VARIABLES#&quot;&gt;
</pre>
<p>Wenn <strong>VARIABLES.result2</strong> gesetzt ist und das gewünschte Resultset enthält, dann wurde mit einem Stopwort gesucht. Ansonsten steht das Resultset in <strong>VARIABLES.result1</strong>.</p>
<p>Jetzt muss nur noch eine Sache geklärt werden: Wie macht man das Query resistent gegen SQL-Injection-Attacken? Ich habe da schon eine Idee. Diese werde ich aber erst nach erfolgreichem Testen hier anfügen, um nicht für unnötige Verwirrung zu sorgen.</p>
<p>Ideen? Verbesserungsvorschläge? Bitte einen Kommentar hinterlassen.</p>
<p>Danke und Gruss,<br />
Patrick</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.service2max.ch/ms-sql-2008-volltextsuche-stopwoerter-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session zerstören und löschen in Coldfusion 7/8</title>
		<link>http://blog.service2max.ch/session-zerstoeren-und-loschen-in-coldfusion/</link>
		<comments>http://blog.service2max.ch/session-zerstoeren-und-loschen-in-coldfusion/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 08:10:42 +0000</pubDate>
		<dc:creator>Patrick Matsumura</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Programmieren]]></category>

		<guid isPermaLink="false">http://blog.service2max.ch/?p=220</guid>
		<description><![CDATA[Damit eine Session in Coldfusion erfolgreich gelöscht wird, muss man zunächst das Session-Cookie löschen und danach die Session auf dem Server für ungültig erklären. Auf unseren Coldfusion8-Servern haben wir die Nutzung von JSESSIONID aktiviert. Folgender Code entfernt eine Session: Diese zwei Zeilen funktionieren mit Coldfusion 7 und 8. Ob es auf früheren oder späteren Versionen [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.service2max.ch%2Fsession-zerstoeren-und-loschen-in-coldfusion%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.service2max.ch%2Fsession-zerstoeren-und-loschen-in-coldfusion%2F&amp;source=service2max&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Damit eine Session in Coldfusion erfolgreich gelöscht wird, muss man zunächst das Session-Cookie löschen und danach die Session auf dem Server für ungültig erklären. Auf unseren Coldfusion8-Servern haben wir die Nutzung von JSESSIONID aktiviert.</p>
<p>Folgender Code entfernt eine Session:</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfcookie expires=&quot;now&quot; name=&quot;JSESSIONID&quot; value=&quot;&quot; /&gt;
&lt;cfset getPageContext().getSession().invalidate() /&gt;
</pre>
<p>Diese zwei Zeilen funktionieren mit Coldfusion 7 und 8. Ob es auf früheren oder späteren Versionen möglich ist, weiss ich nicht, da ich nicht testen kann.</p>
<p>Patrick</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.service2max.ch/session-zerstoeren-und-loschen-in-coldfusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching using disk: basic
Object Caching 505/554 objects using disk: basic

Served from: blog.service2max.ch @ 2012-02-07 22:27:38 -->
