java RMI

S

Sachin

I wrote a RMI server class to access a MS Access database with the
intenetion of providing concurrency access for the database for remote
clients.

Remote interface has 3 methods addEmployee(Employee e),
deleteEmployee(String id), and viewAll()

In the RMI Server class i implemented the above 3 remote ingterface
methods, use try cathc clauses and in the catch block caught Exception
object throw as a RemoteException. Inside the default constructor i
create the connection for the Access database (using a system DSN)
and initialized 2 java.sql.PreparedStatement member variables for used
in addEmployee() and deleteEmployee() methods and
java.sql.Satatement memeber variable to be used in viewAll()
method.

In the main() method of the server class i create a server object and
get the stub and bind it to the local registry.
In the RemotClient class (a Console Application) i lookup the stub in
the localhost.
The problem is when invoking those databae access methods a
SQLException "Invalid database handler" occurs.

Please tell me why is this happens. Is this of Access database? (I
don't have a concurrently accesed database server on my computer).
Help me.
 
R

Roedy Green

The problem is when invoking those databae access methods a
SQLException "Invalid database handler" occurs.

Please tell me why is this happens. Is this of Access database? (I
don't have a concurrently accesed database server on my computer).
Help me.

Write a tiny app that does nothing but open the database and read one
row. If it does not work, you can post it and others can help you.
The trick is always to partition problems getting as many factors out
of consideration as possible.

You may have to do something in the control panel to activate your
ODBC interface. You then need a JDBC-ODBC bridge.

This must be a common thing to do. There must be tutorials on it. Most
people quickly abandon the toy Access for a real, but free database
such as PostGre SQL or MySQL on HSLQb.

See http://mindprod.com/jgloss/sqlvendors.html
 
R

Roedy Green

Write a tiny app that does nothing but open the database and read one
row. If it does not work, you can post it and others can help you.
The trick is always to partition problems getting as many factors out
of consideration as possible.

in other words, no RMI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top