[teiid-users] Question on Applet accessing vdb deployed in JBoss AS

Hong Yi hongyi at renci.org
Tue Jun 8 17:08:44 EDT 2010


Ramesh,

Thanks very much for your quick reply. I have looked at the link you sent and understand the difference between Applet and JSP. In fact, I have Java client code working to access the vdb deployed in teiid server via JDBC, however, I still have difficulty in figuring out how to embed this Java client JDBC code in an Applet that communicate with JBoss Application Server to access the vdb deployed in teiid server which is embedded in JBoss AS. Specifically, I defined the "Teiid embedded" vdb as a data source in JBoss AS, but the Applet has to communicate with this teiid data source via the defined JNDI name, right? Client.jsp does this by getting initial context first, then doing a lookup on the context to get the JNDI name defined to be able to get a JDBC connection to query the teiid vdb, but Applet cannot get the initial context successfully, so it cannot do the lookup to hook up with the JNDI name that defines the JDBC data source in JBoss AS. I hope I stated my problem in an understandable way, but I think in a nutshell, I cannot seem to find a working way to hook up with the JNDI name that defines the JDBC data source in JBoss AS. I've been looking for info and trying to get it working for the whole day but no avail. I will read more info on JNDI, but at the same time, if you can offer some pointers or examples that show how an Applet can hook up with the teiid data source defined in JBoss AS, that would be a huge help for me. 

Thanks very much for all the help!!!

Hong

-----Original Message-----
From: Ramesh Reddy [mailto:rareddy at redhat.com] 
Sent: Tuesday, June 08, 2010 3:07 PM
To: Hong Yi
Cc: teiid-users at lists.jboss.org
Subject: Re: [teiid-users] Question on Applet accessing vdb deployed in JBoss AS

Hong,

On Tue, 2010-06-08 at 19:09 +0000, Hong Yi wrote:
> I followed the similar code as client.jsp in Applet but Applet has
> been having problem to get initial context via JNDI although jsp can
> do so successfully. Is there an example or pointers somewhere that
> show how to write an Applet to access teiid vdb via JBoss AS?

A applet lives in your browser's VM, thus it does not have access to the
JNDI context like your JSP page did. The way to access from the browser
is opening up a JDBC connection to the VDB. i.e. you need to write
connection code in your applet. See this link for instructions
https://community.jboss.org/docs/DOC-13887 on how to make a connection.
Also, most of the times browser's security does not allow opening
sockets, you may need to relax the security settings for the applet. You
can search the web for that, as I am not familiar with details of it.

> 
> On a related note, could you point me to where I can find
> steps/instructions on how to bind JBoss Application server to a real
> URL address rather than the default http://localhost:8080? 

I am not sure about your question? Are you looking for something like

http://mydomain.com

if it is it beyond scope of this email. You need domain name
registration, domain name parking, domain hosting and whole lot more
configuration before you can get there. If you already have all those
then you have a static IP that points to the mydomain.com, use that IP
and start the jboss with "-b <your-ip>" option. Then you get what you
are looking for.

Ramesh..




More information about the teiid-users mailing list