Anand
Anand

Reputation: 10400

How to deploy JDBC client app via WebStart?

I know that this is a very helping community.. so i hope I will get an answer for my problemt. Actually, I have a swing app which contacts an oracle database via JDBC.

Now I want to deploy this via WebStart. I have a text area in the application that prints out the log messages .

all goes well, jnlp downloads my application jar at the client side. But suddenly, the log area says, It cannot connect to the database. I mean, I get an SQL exception while establishing a connection to the database.

what might have gone wrong. Should i include any other jar/library when i deploy the app through web start. But i heard I can only download one jar file via webstart and a jar cannot contain another jar file.

Please help.

Here is my JNLP file

<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="0.2 1.0" codebase="http://172.16.3.214:8080/CRM" href="CsvClient.jnlp">

<information>
    <title>CSV Import Client</title>
    <vendor>CRM Software</Vendor>
    <homepage href="index.jsp" />
    <description>CSV Import client</description>
    <icon href="csv.gif" />
    <offline-allowed/>
</information>

<resources>
    <j2se version="1.6+" />
    <jar href="csv.jar" />

</resources>

<application-desc main-class="org.csv.Main" />

</jnlp>

Here is my Manifest.txt file I used to get the jar file..

Manifest-Version: 1.0

Main-Class: org.csv.Main

Upvotes: 0

Views: 1997

Answers (3)

If your database is not the same host as the web server, you are out over the sandbox boundaries.

You must sign your code to be able to allow to grant it unlimited access. Check the JNLP documentaiton.

Upvotes: 0

Tom Hawtin - tackline
Tom Hawtin - tackline

Reputation: 147164

You can have multiple jar resources in a JNLP. A JNLP file can also use extension JNLP files. The Main-Class entry in the manifest is for use with java -jar and ignored by WebStart.

Oracle ships a number of types of database driver. You probably want the pure Java one. You will also need to arrange for the application to be served from the same machine as the database (or at least appear to be). For larger projects an application tier is often used (probably a bit too eagerly, because it makes for a more complicated project).

Upvotes: 0

nos
nos

Reputation: 229108

You certainly need to include the specific jdbc driver your application need. And you can have several jars in the jnlp resources. You might need to specify security constraints too, jnlp applications runs in a sandboxed environment by default, so it might not be allowed to connect to another host (like your database server). But show the SQL exception, it should contain clues th what's wrong.

Here is one nice place to start

Upvotes: 1

Related Questions