<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to JDBC</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/JDBC/</link><description>Recent changes to JDBC</description><atom:link href="https://sourceforge.net/p/postgres-xc/xc-wiki/JDBC/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 27 Jun 2014 02:32:26 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/postgres-xc/xc-wiki/JDBC/feed" rel="self" type="application/rss+xml"/><item><title>JDBC modified by cbx</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/JDBC/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -59,6 +59,7 @@

     $ cat &amp;gt; build.local.properties &amp;lt;EOF
     binarytransfer=false
+    forcebinary=false
     server=_Coordinator Address_
     port=_Coordinator Port_
     EOF
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cbx</dc:creator><pubDate>Fri, 27 Jun 2014 02:32:26 -0000</pubDate><guid>https://sourceforge.net96cabdac9d49ded3e693d4064b61fc7448abf8bc</guid></item><item><title>JDBC modified by cbx</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/JDBC/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -34,7 +34,7 @@

   * You are already deployed a Postgres-XC cluster 
     * The cluster grants user _test_ to access database _test_. (pg_hba) 
-  * You have already installed 
+  * You have already installed Java VM, Java Compiler, Ant and JUnit 

 #### Prepare database

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cbx</dc:creator><pubDate>Fri, 27 Jun 2014 02:32:26 -0000</pubDate><guid>https://sourceforge.net85b432de921cd3b805bf328abb58eddd51ee20c5</guid></item><item><title>JDBC modified by cbx</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/JDBC/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#using-jdbc"&gt;Using JDBC&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#how-to-use"&gt;How to use&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#limitations"&gt;Limitations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#testing-jdbc"&gt;Testing JDBC&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#description"&gt;Description&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#how-to-test"&gt;How to test&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#preconditions"&gt;Preconditions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prepare-database"&gt;Prepare database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#build-a-driver-and-tests"&gt;Build a driver and tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#configure"&gt;Configure&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="using-jdbc"&gt;Using JDBC&lt;/h2&gt;
&lt;h3 id="how-to-use"&gt;How to use&lt;/h3&gt;
&lt;p&gt;You can connect to Postgres-XC from Java programs using PostgreSQL JDBC Driver just like PostgreSQL. &lt;/p&gt;
&lt;p&gt;It is available from the next link. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://jdbc.postgresql.org/index.html" rel="nofollow"&gt;http://jdbc.postgresql.org/index.html&lt;/a&gt; &lt;/p&gt;
&lt;h3 id="limitations"&gt;Limitations&lt;/h3&gt;
&lt;p&gt;Violating following rules will cause some exceptions. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Operations not compatible with Postgres-XC limitations will fail. &lt;/li&gt;
&lt;li&gt;You must not set connection parameter "binaryTransfer" to true. &lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="testing-jdbc"&gt;Testing JDBC&lt;/h2&gt;
&lt;h3 id="description"&gt;Description&lt;/h3&gt;
&lt;p&gt;Some of pgjdbc's official test will fail by the Postgres-XC limitations. &lt;/p&gt;
&lt;p&gt;We adjusted it for compatibility test on Postgres-XC with JDBC. We describe how you can test using it. &lt;/p&gt;
&lt;h3 id="how-to-test"&gt;How to test&lt;/h3&gt;
&lt;h4 id="preconditions"&gt;Preconditions&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;You are already deployed a Postgres-XC cluster &lt;ul&gt;
&lt;li&gt;The cluster grants user &lt;em&gt;test&lt;/em&gt; to access database &lt;em&gt;test&lt;/em&gt;. (pg_hba) &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You have already installed &lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="prepare-database"&gt;Prepare database&lt;/h4&gt;
&lt;p&gt;Create user and database for the test. You have other user and database for the test, you can skip this. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;pgxc_ctl&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt; &lt;span class="n"&gt;Createuser&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;
&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;pgxc_ctl&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt; &lt;span class="n"&gt;Createdb&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;U&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="build-a-driver-and-tests"&gt;Build a driver and tests&lt;/h4&gt;
&lt;p&gt;$TEST_HOME declares path to test. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//git.code.sf.net/p/postgres-xc/pgjdbc-xc $TEST_HOME/pgjdbc-xc&lt;/span&gt;
&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;TEST_HOME&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pgjdbc&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;xc&lt;/span&gt;
&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;ant&lt;/span&gt; &lt;span class="n"&gt;testjar&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="configure"&gt;Configure&lt;/h4&gt;
&lt;p&gt;Please replace &lt;em&gt;Coordinator Address&lt;/em&gt; to your coordinator's IP address, &lt;em&gt;Coordinator Port&lt;/em&gt; to port number your coordinator is listening. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;properties&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;EOF&lt;/span&gt;
&lt;span class="n"&gt;binarytransfer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;
&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;_Coordinator&lt;/span&gt; &lt;span class="n"&gt;Address_&lt;/span&gt;
&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;_Coordinator&lt;/span&gt; &lt;span class="n"&gt;Port_&lt;/span&gt;
&lt;span class="n"&gt;EOF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want to use other &lt;em&gt;user&lt;/em&gt; and &lt;em&gt;database&lt;/em&gt;, append them to your build.local.properties. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;properties&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cbx</dc:creator><pubDate>Fri, 27 Jun 2014 02:32:26 -0000</pubDate><guid>https://sourceforge.net4be47d49d8e2557d117cb5df12459e525add8ccf</guid></item></channel></rss>