<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: DbFit 1.1 released: DB2 and Derby support and native queries</title>
	<atom:link href="http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/</link>
	<description>Building software that matters</description>
	<lastBuildDate>Thu, 02 Feb 2012 07:12:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: gojko</title>
		<link>http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/comment-page-1/#comment-35803</link>
		<dc:creator>gojko</dc:creator>
		<pubDate>Tue, 14 Oct 2008 22:22:13 +0000</pubDate>
		<guid isPermaLink="false">http://gojko.net/?p=294#comment-35803</guid>
		<description>You can instantiate the appropriate type of DbEnvironment and pass your connection into it, then set the DefaultEnvironment to that DbEnvironment. The connection fields should be public/settable from outside. if not for that particular environment, let me know and i&#039;ll modify the source.</description>
		<content:encoded><![CDATA[<p>You can instantiate the appropriate type of DbEnvironment and pass your connection into it, then set the DefaultEnvironment to that DbEnvironment. The connection fields should be public/settable from outside. if not for that particular environment, let me know and i&#8217;ll modify the source.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: easternWahoo</title>
		<link>http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/comment-page-1/#comment-35798</link>
		<dc:creator>easternWahoo</dc:creator>
		<pubDate>Tue, 14 Oct 2008 20:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://gojko.net/?p=294#comment-35798</guid>
		<description>Hi,

I&#039;m new to DBfit, and to Fitnesse, so bear with me here... How can I make DbFit use a connection which I supply?  I want Spring to configure and supply a &quot;dataSource&quot;, and let DbFit use it to setup and rollback data. The dbfit pdf implies this can be done, but I don&#039;t see how, unless it means creating my own implementation of the DBEnvironment, and giving that to the DbEnvironmentFactory. 


In the DbFit pdf, it states, &quot;In standalone mode, the connection properties are stored in the public DefaultEnvironment singleton field inside dbfit.DbEnvironmentFactory. You can initialise it from your own fixtures if you want to pass an existing database connection (to make sure that your .NET tests are using the same transaction &quot; as DbFit fixtures).&quot;

What am I missing?

Thanks for your help!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m new to DBfit, and to Fitnesse, so bear with me here&#8230; How can I make DbFit use a connection which I supply?  I want Spring to configure and supply a &#8220;dataSource&#8221;, and let DbFit use it to setup and rollback data. The dbfit pdf implies this can be done, but I don&#8217;t see how, unless it means creating my own implementation of the DBEnvironment, and giving that to the DbEnvironmentFactory. </p>
<p>In the DbFit pdf, it states, &#8220;In standalone mode, the connection properties are stored in the public DefaultEnvironment singleton field inside dbfit.DbEnvironmentFactory. You can initialise it from your own fixtures if you want to pass an existing database connection (to make sure that your .NET tests are using the same transaction &#8221; as DbFit fixtures).&#8221;</p>
<p>What am I missing?</p>
<p>Thanks for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AC</title>
		<link>http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/comment-page-1/#comment-32935</link>
		<dc:creator>AC</dc:creator>
		<pubDate>Tue, 26 Aug 2008 11:32:54 +0000</pubDate>
		<guid isPermaLink="false">http://gojko.net/?p=294#comment-32935</guid>
		<description>A suggestion: maybe create a way to initialize the connection from a classpath file besides the current connectUsingFile().

Because I needed something like that, I&#039;ve already added this in my AS400Environment:

  /**
   * Connects to the database using a file from the classpath.
   * 
   * @param filePath The path to the properties file, starting from a location in the classpath.
   * 
   * @throws SQLException if connecting fails.
   * @throws IOException if something went wrong while parsing the properties file.
   */
  public void connectUsingClasspathFile(final String filePath)
      throws SQLException, IOException {
    DbConnectionProperties dbp = DbConnectionProperties.CreateFromString(getLinesFromClasspathFile(filePath));
    if (dbp.FullConnectionString != null) {
      connect(dbp.FullConnectionString);
    } else if (dbp.DbName != null) {
      connect(dbp.Service, dbp.Username, dbp.Password, dbp.DbName);
    } else {
      connect(dbp.Service, dbp.Username, dbp.Password);
    }
  }

  /**
   * Gets a list of lines from the properties file located in the classpath at the given location.
   * 
   * @param filePath The path to the properties file, starting from a location in the classpath.
   * @return A list of lines from the properties file, to be used by 
   * {@link DbConnectionProperties#CreateFromString(List)}
   * 
   * @throws IOException if something went wrong while parsing the properties file.
   */
  private List getLinesFromClasspathFile(final String filePath) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(this.getClass().getResourceAsStream(filePath)));
    List lines = new ArrayList();
    String line;
    while ((line = br.readLine()) != null) {
      lines.add(line);
    }
    return lines;
  }

You can probably move getLinesFromClasspathFile() to DbConnectionProperties.

Thank you.</description>
		<content:encoded><![CDATA[<p>A suggestion: maybe create a way to initialize the connection from a classpath file besides the current connectUsingFile().</p>
<p>Because I needed something like that, I&#8217;ve already added this in my AS400Environment:</p>
<p>  /**<br />
   * Connects to the database using a file from the classpath.<br />
   *<br />
   * @param filePath The path to the properties file, starting from a location in the classpath.<br />
   *<br />
   * @throws SQLException if connecting fails.<br />
   * @throws IOException if something went wrong while parsing the properties file.<br />
   */<br />
  public void connectUsingClasspathFile(final String filePath)<br />
      throws SQLException, IOException {<br />
    DbConnectionProperties dbp = DbConnectionProperties.CreateFromString(getLinesFromClasspathFile(filePath));<br />
    if (dbp.FullConnectionString != null) {<br />
      connect(dbp.FullConnectionString);<br />
    } else if (dbp.DbName != null) {<br />
      connect(dbp.Service, dbp.Username, dbp.Password, dbp.DbName);<br />
    } else {<br />
      connect(dbp.Service, dbp.Username, dbp.Password);<br />
    }<br />
  }</p>
<p>  /**<br />
   * Gets a list of lines from the properties file located in the classpath at the given location.<br />
   *<br />
   * @param filePath The path to the properties file, starting from a location in the classpath.<br />
   * @return A list of lines from the properties file, to be used by<br />
   * {@link DbConnectionProperties#CreateFromString(List)}<br />
   *<br />
   * @throws IOException if something went wrong while parsing the properties file.<br />
   */<br />
  private List getLinesFromClasspathFile(final String filePath) throws IOException {<br />
    BufferedReader br = new BufferedReader(new InputStreamReader(this.getClass().getResourceAsStream(filePath)));<br />
    List lines = new ArrayList();<br />
    String line;<br />
    while ((line = br.readLine()) != null) {<br />
      lines.add(line);<br />
    }<br />
    return lines;<br />
  }</p>
<p>You can probably move getLinesFromClasspathFile() to DbConnectionProperties.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gojko</title>
		<link>http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/comment-page-1/#comment-32930</link>
		<dc:creator>gojko</dc:creator>
		<pubDate>Tue, 26 Aug 2008 10:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://gojko.net/?p=294#comment-32930</guid>
		<description>I&#039;ve already logged a complaint to fitnesse developers about interpretTables. if that&#039;s fixed it will be easy to go back to dofixture.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve already logged a complaint to fitnesse developers about interpretTables. if that&#8217;s fixed it will be easy to go back to dofixture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AC</title>
		<link>http://gojko.net/2008/08/22/dbfit-11-released-db2-and-derby-support-and-native-queries/comment-page-1/#comment-32925</link>
		<dc:creator>AC</dc:creator>
		<pubDate>Tue, 26 Aug 2008 09:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://gojko.net/?p=294#comment-32925</guid>
		<description>Another question: do you think there&#039;s something to be done about DatabaseTest not being a DoFixture anymore? Maybe the fitlibrary developers will agree to make interpretTables() a non-final method back again. 

There&#039;s a handy setSystemUnderTest() method in DoFixture which allows practically to hand over the flow to another fixture. Now I can&#039;t use it anymore...</description>
		<content:encoded><![CDATA[<p>Another question: do you think there&#8217;s something to be done about DatabaseTest not being a DoFixture anymore? Maybe the fitlibrary developers will agree to make interpretTables() a non-final method back again. </p>
<p>There&#8217;s a handy setSystemUnderTest() method in DoFixture which allows practically to hand over the flow to another fixture. Now I can&#8217;t use it anymore&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

