aspose file tools*
The moose likes JDBC and the fly likes Using JSP how  du I work with jdbc (ms-access) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using JSP how  du I work with jdbc (ms-access)" Watch "Using JSP how  du I work with jdbc (ms-access)" New topic
Author

Using JSP how du I work with jdbc (ms-access)

shekar narayan
Greenhorn

Joined: Mar 14, 2001
Posts: 3
Hi Guys,
I have 4 tables, viz. problem, area, engineer and complaints. While storing the data in the table of complaints, the respective ids of former three are stored. While displayng the records of complaints, i am able to get the ids of the former tables viz. problem, area and engineer and not the names. The other fiels are displayed, fine.
My problem is how do I run a SQL query, such a way that I get the names of the above mentioned tables.
The tables are as follows:
1)probelm : probid, name.
2)area : areaid, name.
3)engineer: engid, engineer.
4)complaints: compid,custname,date,time,problem,area,engineer,status.
Pls help me !

Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252

Is this what you meant? A join? Note: "problemname" and "areaname" are field aliases for your result set, because both fields originally have the same name "name".
A few comments though. Two fundamentally different types of things should, if at all possible, not have the same name. So, "problem.name" and "area.name" are fine, they refer to a similar things in different tables. But "engineer.engineer" and "complaints.engineer" are very different! The first is a name, the second is an id field. Try to adopt a naming convention for your id fields and others instead. For example:

  • problem: id, name
  • area: id, name
  • engineer: id, name
  • complaints: id, problemid, areaid, engineerid,...

  • Some people don't like things like "id" and "name" in tables, and would want you to use "problem_id" and "problem_name". That's fine too. As long as you're consistent.
    Furthermore, watch out with names like "date", "time", and perhaps also "status". In some databases they are reserved words, and to prevent problems you would always have to quote these field names (which leads you straight into the snake pit of case sensitivity if you don't watch out). Rather avoid them if you can.
    - Peter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using JSP how du I work with jdbc (ms-access)
 
Similar Threads
JDBC query Problem Using MS-Access
Want to get table names from db in access
Problem retrieving output from stored procedured
Get File list from URL
How to get drive names?