Connecting MS_Access

Hai,

I'm using MS-Access with Servlets.When I try to

link more than one table thro' a query(as we do in Oracle),it is not responding.It just selects the datas from the primary table alone.Why................CAN'T WE

WRITE A QUERY TO RELATE MORE THAN 1 TABLE.....OR SHOULD WE CREATE MORE THAN 1 RESULTSETS.

HERE IS MY QUERY:

rs=st.executeQuery("select table1.no,name,sal from table1,table2

whereno=' " + req.getParameter("no")+"' ");

where rs=resultset;

st=statement;

table1=primarytable;

table2=childtable;

req.getParameter("no")->where no is the textbox name through which I'm getting all those related datas.

can anyone help me...........

Thanks in advance.

Subha.

[786 byte] By [subha143] at [2007-9-26 1:51:38]
# 1

You are asking how to write an SQL query that joins two files? Nothing to do with the subject, and really nothing to do with Java, is it?

You are selecting three columns, "no", "name", and "sal". I assume they are all in table1? That would explain your complaint that it "just selects the datas from the primary table alone"; that's what you asked for. Also, I commonly see a clause like "where table1.no=table2.no" in a join query like the one you describe.

DrClap at 2007-6-29 3:00:20 > top of Java-index,Core,Core APIs...