Hi all,

I'm trying to connect a stand-along client application to the HypersonicSQL
database using Orion and datasource. The JNDI lookup works fine and I am
able to get a connection. The problem arises when I try to create a
Statement object. Moreover, there is no particular error message which could
put me on the right way. I catch a null message.

These are the files which compose my stand-alone application :

jndi.porperties:

java.naming.factory.initial=com.evermind.server.ApplicationClientInitialCont
extFactory
java.naming.provider.url=ormi://myserver
java.naming.security.principal=hello
java.naming.security.credentials=tutut

The hello/tutut profile belongs to the "administrators" group.

application-client.xml:

<?xml version="1.0"?>
<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
Application Client 1.2//EN"
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
<application-client>
</application-client>

TestClient.java :

import java.sql.*;
import javax.naming.*;
import javax.sql.*;

public class TestClient {
        public static void main(String arg[]) {
                try {
                        InitialContext ctx=new InitialContext();
                        System.out.println("ctx found");
                        DataSource ds=(DataSource)ctx.lookup("jdbc/HypersonicDS");
                        System.out.println("datasource retrived");
                        Connection con=ds.getConnection();
                        System.out.println("connection established");
                        Statement stmt=con.createStatement();
                        System.out.println("statement created");
                        stmt.close();
                        System.out.println("statement closed");
                        con.close();
                        System.out.prinltn("connection closed");
                }
                catch(Exception e) {
                        System.out.println(e.getMessage());
                }
        }
}

The files are organized with this file strucutre :

root
 ¦
 --jndi.properties
 --TestClient.java
 --Meta-inf
        ¦
        -- application-client.xml

Any help is welcome.

Denis Jaccard ([EMAIL PROTECTED])
Java / XML Trainer & Consultant

Adenia Software Sàrl - Your path to the e-technologies
Puits-Godet 6a
2000 Neuchâtel

Tél. : +41 (0)32 724 96 57
Fax  : +41 (0)32 724 96 59
Web  : http://www.adenia.com


Reply via email to