Solved

JDBC select all rows in order

Posted on 2002-07-12
1
155 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

929 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

8 Experts available now in Live!

Get 1:1 Help Now