Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 78978 invoked from network); 1 Feb 2011 17:23:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 17:23:29 -0000 Received: (qmail 99267 invoked by uid 500); 1 Feb 2011 17:23:29 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 99065 invoked by uid 500); 1 Feb 2011 17:23:27 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 99053 invoked by uid 99); 1 Feb 2011 17:23:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 17:23:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nirmal070125@gmail.com designates 209.85.215.44 as permitted sender) Received: from [209.85.215.44] (HELO mail-ew0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 17:23:19 +0000 Received: by ewy8 with SMTP id 8so3605191ewy.31 for ; Tue, 01 Feb 2011 09:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=X+ceN755kHl7V3hxcrbB4oJuSNfUzfe+1BKbIpvrmrw=; b=lAEwDpPY+S9JhLPJom1/41NjMHiOSiMDOVeIaOOgCADRIdWdXm58gAnZ/JLMF3t5q0 52jxO14ZkrXraO3HBv3T52TrzkXy6HT54bm7Wr1+It3qdYAkjz8RejUvvJFBsRfOoG36 Yu7qEYdQCJjystY6QcwXitHOn9SfS96NfVlM8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=U9UOfV4Jo7EapwnlU0cSVMpjpq+uNOuuOLNxbhjxQgYOGgmzvRsDIg21n/K7iDGwUM NMrbSEQmAS95FRTZ7eSzm10EDGkz0NKC9qi3FzLJhTnbefVsU7zG2kfzB0GzKSFo3OBQ JLVHql9s5O3jGVl9HwlJstFuPbrv+RtRQEucM= MIME-Version: 1.0 Received: by 10.14.127.200 with SMTP id d48mr493067eei.23.1296580977036; Tue, 01 Feb 2011 09:22:57 -0800 (PST) Received: by 10.14.52.12 with HTTP; Tue, 1 Feb 2011 09:22:57 -0800 (PST) In-Reply-To: <90624642.3003.1296580349885.JavaMail.tomcat@hel.zones.apache.org> References: <11618647.184591290124273613.JavaMail.jira@thor> <90624642.3003.1296580349885.JavaMail.tomcat@hel.zones.apache.org> Date: Tue, 1 Feb 2011 22:52:57 +0530 Message-ID: Subject: Re: [jira] Commented: (DERBY-4907) EmbeddedXADataSource with ;create=true attribute set in setDatabaseName fails with java.sql.SQLException: Database not available From: Nirmal Fernando To: derby-dev@db.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Welcome to Derby! On Tue, Feb 1, 2011 at 10:42 PM, Siddharth Srivastava (JIRA) wrote: > > =A0 =A0[ https://issues.apache.org/jira/browse/DERBY-4907?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D12989283#comment-12989283 ] > > Siddharth Srivastava commented on DERBY-4907: > --------------------------------------------- > > What coding and naming conventions need to be followed for Derby ? Is the= re any documentation related to the same. > This contains some: http://wiki.apache.org/db-derby/DerbyContributorCheckli= st >> EmbeddedXADataSource with ;create=3Dtrue attribute set in setDatabaseNam= e fails with java.sql.SQLException: Database not available >> ------------------------------------------------------------------------= -------------------------------------------------------- >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Key: DERBY-4907 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 URL: https://issues.apache.org/jira/brow= se/DERBY-4907 >> =A0 =A0 =A0 =A0 =A0 =A0 Project: Derby >> =A0 =A0 =A0 =A0 =A0Issue Type: Bug >> =A0 =A0 =A0 =A0 =A0Components: JDBC >> =A0 =A0Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.= 0, 10.6.2.1 >> =A0 =A0 =A0 =A0 =A0 =A0Reporter: Kathey Marsden >> =A0 =A0 =A0 =A0 =A0 =A0Assignee: Siddharth Srivastava >> =A0 =A0 =A0 =A0 =A0 =A0Priority: Minor >> >> Setting the ;create=3Dtrue attribute in setDatabaseName with EmbededXADa= taSource and EmbeddedXADataSource40 =A0fails with >> $ java TestDerbyCreate >> Exception in thread "main" java.sql.SQLException: Database not available >> =A0 =A0 =A0 =A0 at org.apache.derby.jdbc.EmbeddedXADataSource.setupResou= rceAdapter(Embe >> dedXADataSource.java:175) >> =A0 =A0 =A0 =A0 at org.apache.derby.jdbc.EmbeddedXADataSource.getXAConne= ction(EmbeddedX >> DataSource.java:101) >> =A0 =A0 =A0 =A0 at TestDerbyCreate.main(TestDerbyCreate.java:18) >> >> using the create attributie in databaseName works fine with EmbeddedData= Source. >> Using setCreateDatabase("create") with EmbeddedXADataSource is a good wo= rk around and I think generally preferable. >> import java.sql.*; >> import javax.sql.*; >> public class TestDerbyCreate >> { >> =A0 =A0 public static void main(String[] args) throws Throwable >> =A0 =A0 { >> =A0 =A0 =A0 =A0 org.apache.derby.jdbc.EmbeddedXADataSource ds =3D >> =A0 =A0 =A0 =A0 =A0 =A0 new >> org.apache.derby.jdbc.EmbeddedXADataSource(); >> =A0 =A0 =A0 =A0 ds.setDatabaseName("TestDB;create=3Dtrue"); >> =A0 =A0 =A0 =A0 ds.setUser("dbuser1"); >> =A0 =A0 =A0 =A0 ds.setPassword("dbpwd1"); >> =A0 =A0 =A0 PooledConnection pooledConn =3D ds.getXAConnection(); >> =A0 =A0 =A0 =A0 Connection conn =3D pooledConn.getConnection(); >> =A0 =A0 =A0 =A0 System.out.println("Database product: " + >> conn.getMetaData().getDatabaseProductName()); >> =A0 =A0 =A0 =A0 System.out.println("Database version: " + >> conn.getMetaData().getDatabaseProductVersion()); >> =A0 =A0 =A0 =A0 System.out.println("Driver name: =A0 =A0 =A0" + >> conn.getMetaData().getDriverName()); >> =A0 =A0 =A0 =A0 System.out.println("Driver version: =A0 " + >> conn.getMetaData().getDriverVersion()); >> =A0 =A0 =A0 =A0 System.out.println("JDBC driver major ve > > -- > This message is automatically generated by JIRA. > - > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > --=20 Best Regards, Nirmal C.S.Nirmal J. Fernando Department of Computer Science & Engineering, Faculty of Engineering, University of Moratuwa, Sri Lanka. Blog:=A0http://nirmalfdo.blogspot.com/