JBoss with CORBA and Oracle combining C++ with Java

streakconvertingSoftware and s/w Development

Dec 13, 2013 (3 years and 7 months ago)

99 views

JBoss with CORBA and Oracle

combining C++ with Java

Jeremy Lemaire

April 2007

Purpose of Project


Show Development of a 3
-
tier client server
project.


Illustrate EJB 3.0 concepts.


Illustrate connectivity to a professional Oracle
database.


Seamlessly integrate different technologies and
languages.

Logical Architecture

Development of a 3
-
tier client server
project.



Note the use of both the OmniORB and the JDK
ORB to facilitate communication between Java
and C++ CORBA clients and servers using a
common IDL stub.


Use of a normalized, tuned and documented
Oracle database on the backend.


Use of JDBC proxy to facilitate connectivity of
the client front
-
end to the Oracle database

Development of a 3
-
tier client server
project

cont.


The client is created such that any *.sql script
stored on the server can be executed and the
result will be passed to the client application in the
form of a string.



The sample run depicts the PASTDUE.sql script
being triggered. This SQL query uses sub queries
to select all customers that have a total current
balance greater than $100.00 and a past due
balance greater than $0.00.


Development of a 3
-
tier client server
project

cont.


In addition to mixed languages, mixed operating
systems were also used (i.e. Solaris and
Windows).


Use of EJB 3.0 and annotations within persistent
objects.


Use of the JBOSS Application Server.


OOUI front
-
end dumps remote queried data from
PASTDUE.sql to a local embedded Hypersonic
Database and the re
-
queries it.

Illustrate EJB 3.0 concepts


The Entity Bean Class


POJO

s (Plain Old Java Objects)


Entities in Java Persistence are POJO

s
annotated with Object/Relational mapped
meta
-
data.



Persistence.xml file specifies information
for the EntityManager like the database
connection url.

EJB 3.0 concepts


The Bean Class


@Entity

@Table(name="PASTDUE")

public class PastDue implements
java.io.Serializable

{




EJB 3.0 concepts


The Bean Class (continued)



@Id


@Column(name="ID")


public String getId()


{




return id;


}


public void setId(String str)


{




id = str;


}



EJB 3.0 concepts


The Bean Class (continued)

@Column(name="INFO")


public String getInfo()


{


return info;


}


public void setInfo(String str)


{



info = str;


}

}

EJB 3.0 concepts

Persistence.xml file

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

<persistence>


<persistence
-
unit name="verizon">


<jta
-
data
-
source>java:/DefaultDS</jta
-
data
-
source>


<properties>


<property name="hibernate.hbm2ddl.auto"
value="create
-
drop"/>


</properties>


</persistence
-
unit>

</persistence>

Connectivity to the Oracle database.

Database.PROPERTIES file



jdbc.drivers=oracle.jdbc.driver.OracleDriver

jdbc.url=jdbc:oracle:thin:@prophet.njit.edu:1521:cou
rse

jdbc.username=jml25


jdbc.password=xxxxxxxx

Illustrate connectivity to a professional Oracle
database.

Retrieving database.PROPERTIES


String drivers = props.getProperty("jdbc.drivers");


if (drivers != null)
System.setProperty("jdbc.drivers", drivers);



String url = props.getProperty("jdbc.url");


String username =
props.getProperty("jdbc.username");


String password =
props.getProperty("jdbc.password");



return DriverManager.getConnection(url,
username, password);

Connectivity to the Oracle database.

Common Cdr.idl file


interface Cdr

{


string executeSQL(in string
database, in string statement);

};

JDK orbd started on AFS15 and waiting for
clients.

The omniOrb C++ CdrServer binding the server to
the registry and waiting for clients on AFS15
.


The Java ORB CdrProxyServer binding the server
to the registry and waiting for clients on AFS15.


JBOSS EJB Application Server running and and
waiting for clients on host ma01jlemaire02
.


Description for Next Slide



The EJB/CORBA CdrClient running on
ma01jlemaire02 in Vermont connecting to the
CdrServer running on AFS15 in New Jersey.
The console shows the results of the
PASTDUE.sql query executed on the CDR_DB
running on Prophet.njit.edu. The results from
this query are added to the local Hypersonic
Database and re
-
queried using an annotated,
persistent, Java Entity Bean named PastDue.

EJB/CORBA Client

Usefull Links


www.jboss.com


http://omniorb.sourceforge.org


http://java.sun.com


http://web.njit.edu