Solved

JDBC select all rows in order

Posted on 2002-07-12
1
154 Views
Last Modified: 2012-05-04
Hi All,
 I would like to collect all the rows of a small MS Access database in the order that they are listed in the database. I am using JDBC in JSP pages.

My SQL statement is simple:
"SELECT * from NavTable"

Unfortunately, the recordset does not return the rows in the same order.  

Everything is re-arranged.

What can I do?
TIA DoughBoy
0
Comment
Question by:DoughBoy
1 Comment
 
LVL 28

Accepted Solution

by:
TextReport earned 50 total points
ID: 7151050
You need to tell your SELECT statement the specific order you wish it to return in, eg SELECT * FROM navtable ORDER BY field1, field2 ...

If you are not able to sort by fields and you you want data entry order then there is no way you can get this as the table stands. You can create an AutoNumber field and this will work with new tables.

Cheers, Andrew
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now