You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Néstor Boscán <ne...@tcsapp.com.ve> on 2007/09/01 08:39:33 UTC

Using Derby with Java Web Start

Hi
 
I need to create a standalone Swing application with an embedded database
that can be downloaded to 500 workstation using Java Web Start. I have the
following questions:
 
1.- Can I use Derby downloading it using Java Web Start?
2.- What happens when I download a new version of Deby? Will it upgrade my
database files automatically without ANY user intervention?
 
Regards,
 
Néstor Boscán

Re: Using Derby with Java Web Start

Posted by Jørgen Løland <Jo...@Sun.COM>.
Hi Néstor

You could check the version of the database by using a call to 
DatabaseMetaData#getDatabaseProductVersion. Something like this:

java.util.Properties props = new Properties();
props.put("user", <username>);
props.put("password", <password>);

java.sql.Connection conn = 
java.sql.DriverManager.getConnection("jdbc:derby:mydb", props);

java.sql.DatabaseMetaData metadata = conn.getMetaData();
System.out.println("Derby Version:" + metadata.getDatabaseProductVersion());


Regards,
Jørgen Løland

Néstor Boscán wrote:
> Hi Alan
> 
> Thanks for the info. Do you know how to get the version of the database?. 
> 
> Regards,
> 
> Néstor Boscán 



-- 
Jørgen Løland

RE: Using Derby with Java Web Start

Posted by Néstor Boscán <ne...@tcsapp.com.ve>.
Hi Alan

Thanks for the info. Do you know how to get the version of the database?. 

Regards,

Néstor Boscán 

-----Mensaje original-----
De: Alan Burlison [mailto:Alan.Burlison@sun.com] 
Enviado el: Lunes, 03 de Septiembre de 2007 05:06 a.m.
Para: Derby Discussion
CC: 'Gustavo Acuña'; 'Andres Urriola'
Asunto: Re: Using Derby with Java Web Start

Néstor Boscán wrote:

> Thanks alot for the info. Now based on this info you sent me, you 
> think is possible to code the application so it will upgrade the 
> database without human intervention?. Has anybody tried this approach?

I think it's possible, yes.  You could connect, check the version and if it
is an old version, reconnect with the upgrade option.  I haven't done so
myself though.

--
Alan Burlison
--


Re: Using Derby with Java Web Start

Posted by Alan Burlison <Al...@sun.com>.
Néstor Boscán wrote:

> Thanks alot for the info. Now based on this info you sent me, you think is
> possible to code the application so it will upgrade the database without
> human intervention?. Has anybody tried this approach? 

I think it's possible, yes.  You could connect, check the version and if 
it is an old version, reconnect with the upgrade option.  I haven't done 
so myself though.

-- 
Alan Burlison
--

RE: Using Derby with Java Web Start

Posted by Néstor Boscán <ne...@tcsapp.com.ve>.
Hi Alan

Thanks alot for the info. Now based on this info you sent me, you think is
possible to code the application so it will upgrade the database without
human intervention?. Has anybody tried this approach? 

-----Mensaje original-----
De: Alan Burlison [mailto:Alan.Burlison@sun.com] 
Enviado el: Sábado, 01 de Septiembre de 2007 06:02 a.m.
Para: Derby Discussion
Asunto: Re: Using Derby with Java Web Start

Néstor Boscán wrote:

> I need to create a standalone Swing application with an embedded 
> database that can be downloaded to 500 workstation using Java Web 
> Start. I have the following questions:
>  
> 1.- Can I use Derby downloading it using Java Web Start?

Yes, just include the derby JAR file in your JNLP file:

   <resources>
     <j2se version="1.5+" java-vm-args="-Xms8m -Xmx32m"
      href="http://java.sun.com/products/autodl/j2se"/>
     <jar href="<MyApp.jar"/>
     <jar href="derby.jar"/>
   </resources>

> 2.- What happens when I download a new version of Deby? Will it 
> upgrade my database files automatically without ANY user intervention?

You might find the following links helpful:

http://db.apache.org/derby/docs/dev/devguide/cdevupgrades.html
http://wiki.apache.org/db-derby/MetadataUpgrade
http://db.apache.org/derby/papers/versionupgrade.html
http://davidvancouvering.blogspot.com/2007/08/how-to-upgrade-derbyjava-db-da
tabase.html

--
Alan Burlison
--


Re: Using Derby with Java Web Start

Posted by "Lance J. Andersen" <La...@Sun.COM>.

Alan Burlison wrote:
> Néstor Boscán wrote:
>
>> I need to create a standalone Swing application with an embedded 
>> database
>> that can be downloaded to 500 workstation using Java Web Start. I 
>> have the
>> following questions:
>>  
>> 1.- Can I use Derby downloading it using Java Web Start?
>
> Yes, just include the derby JAR file in your JNLP file:
>
>   <resources>
>     <j2se version="1.5+" java-vm-args="-Xms8m -Xmx32m"
>      href="http://java.sun.com/products/autodl/j2se"/>
>     <jar href="<MyApp.jar"/>
>     <jar href="derby.jar"/>
>   </resources>
>
You might find the following  blog useful WRT JPA and Derby with Java 
Web Start 
http://weblogs.java.net/blog/lancea/archive/2007/06/using_java_web.html

-lance
>> 2.- What happens when I download a new version of Deby? Will it 
>> upgrade my
>> database files automatically without ANY user intervention?
>
> You might find the following links helpful:
>
> http://db.apache.org/derby/docs/dev/devguide/cdevupgrades.html
> http://wiki.apache.org/db-derby/MetadataUpgrade
> http://db.apache.org/derby/papers/versionupgrade.html
> http://davidvancouvering.blogspot.com/2007/08/how-to-upgrade-derbyjava-db-database.html 
>
>

Re: Using Derby with Java Web Start

Posted by Alan Burlison <Al...@sun.com>.
Néstor Boscán wrote:

> I need to create a standalone Swing application with an embedded database
> that can be downloaded to 500 workstation using Java Web Start. I have the
> following questions:
>  
> 1.- Can I use Derby downloading it using Java Web Start?

Yes, just include the derby JAR file in your JNLP file:

   <resources>
     <j2se version="1.5+" java-vm-args="-Xms8m -Xmx32m"
      href="http://java.sun.com/products/autodl/j2se"/>
     <jar href="<MyApp.jar"/>
     <jar href="derby.jar"/>
   </resources>

> 2.- What happens when I download a new version of Deby? Will it upgrade my
> database files automatically without ANY user intervention?

You might find the following links helpful:

http://db.apache.org/derby/docs/dev/devguide/cdevupgrades.html
http://wiki.apache.org/db-derby/MetadataUpgrade
http://db.apache.org/derby/papers/versionupgrade.html
http://davidvancouvering.blogspot.com/2007/08/how-to-upgrade-derbyjava-db-database.html

-- 
Alan Burlison
--