Click here to Skip to main content
15,922,696 members
Home / Discussions / Java
   

Java

 
GeneralRe: Using JNI without having to add jvm.dll path inside Environment Variables (User or System) Pin
JohnCodding26-Jan-23 0:20
JohnCodding26-Jan-23 0:20 
GeneralRe: Using JNI without having to add jvm.dll path inside Environment Variables (User or System) Pin
Richard MacCutchan26-Jan-23 0:28
mveRichard MacCutchan26-Jan-23 0:28 
GeneralRe: Using JNI without having to add jvm.dll path inside Environment Variables (User or System) Pin
JohnCodding26-Jan-23 0:45
JohnCodding26-Jan-23 0:45 
GeneralRe: Using JNI without having to add jvm.dll path inside Environment Variables (User or System) Pin
JohnCodding26-Jan-23 0:52
JohnCodding26-Jan-23 0:52 
GeneralRe: Using JNI without having to add jvm.dll path inside Environment Variables (User or System) Pin
Richard MacCutchan26-Jan-23 1:44
mveRichard MacCutchan26-Jan-23 1:44 
AnswerRe: Using JNI without having to add jvm.dll path inside Environment Variables (User or System) Pin
jschell26-Jan-23 11:33
jschell26-Jan-23 11:33 
QuestionMemory usage for requested rows from database Pin
Valentinor13-Jan-23 0:18
Valentinor13-Jan-23 0:18 
AnswerRe: Memory usage for requested rows from database Pin
jschell15-Jan-23 8:27
jschell15-Jan-23 8:27 
Valentinor wrote:
SELECT Column FROM Table WHERE Condition


First keep in mind that is SQL. It is sent as is to the database.

Valentinor wrote:
Does the database create in memory a list with all the rows/values that have the given condition


That is not how the jdbc is defined to work. But a bad driver could definitely do that. There is (or was) a jdbc/odbc 'text' driver and presumably it could have loaded everything into memory. But that was basically a toy anyways.

The next() technically loads it. But drivers I have actually looked at usually use some sort of batch request that might load 10, 100, etc, and then wait for the next to pull from the local set. I think I even recall somewhere that can be adjusted. The initial set as somewhat low value.

Valentinor wrote:
FETCH NEXT X ROWS ONLY


How you do that depends on the database (see above). But every query you write should always be constrained (the where clause) and most should have a limit on the number of rows. The result should be paged.

Only time that would not be true when you know for a fact that the target table has an extraordinarily low growth factor. Only ones I know for sure like that are application enumeration tables.

Table examples where you should ALWAYS include the paging mechanism are things like customers, users, orders, events, etc.

Valentinor wrote:
database with millions of entries, that would save time and resources when you only want X rows,


That is a complex statement and there is no simple answer.

You should NEVER, for example, allow for a design where a UI could expect a user to view 'millions' of rows. As a developer if you see a requirement like that you should insist that the requirements be changed to include reasonable constraint restrictions. Some examples
1. Require a date range, account number, customer store, etc.
2. Do a count(*) with the constraints in place and throw an error if the result is larger than X (say 10,000) which would then require the user (in the UI) to add more constraints to narrow the result.

And such queries should ALWAYS require a page and row size. So for example 'page 5', 'size 20'. The backend then restricts (hard code) the max size to something like 1000.

Additionally the users (whoever they are) might claim that they 'need' all of those rows. A person can never process millions of rows so such a claim for a user is ridiculous. The user in such a case always knows that they are looking for something very specific like a email, customer name, account number, etc.

However the other possible need is some automated process is going to consume that result. And in that case you should design a batching system that can dump large files wo some location (FTP server) to be processed by that external service. There are a vast number of problems that should be addressed in such a request, of which just one, is that you do not want to be dumping the entire contents of that table every day or every hour. Not to mention that there might even be some consideration about who actually owns that data and who pays for the processing to deliver it.
GeneralRe: Memory usage for requested rows from database Pin
Valentinor16-Jan-23 20:44
Valentinor16-Jan-23 20:44 
GeneralRe: Memory usage for requested rows from database Pin
jschell17-Jan-23 3:24
jschell17-Jan-23 3:24 
AnswerRe: Memory usage for requested rows from database Pin
RedDk17-Jan-23 7:15
RedDk17-Jan-23 7:15 
QuestionHow to found a file by utilizing a variable for 'Startswith' in JAVA? Pin
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:32
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:32 
AnswerRe: How to found a file by utilizing a variable for 'Startswith' in JAVA? Pin
Richard MacCutchan3-Jan-23 1:22
mveRichard MacCutchan3-Jan-23 1:22 
Questionhow to discover a file by utilizing a variable for 'Startswith' in java? Pin
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:22
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:22 
AnswerRe: how to discover a file by utilizing a variable for 'Startswith' in java? Pin
Richard MacCutchan3-Jan-23 0:25
mveRichard MacCutchan3-Jan-23 0:25 
GeneralRe: how to discover a file by utilizing a variable for 'Startswith' in java? Pin
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 1:11
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 1:11 
QuestionDisplay BLOB image in JSP Pin
simoneguidi0130-Dec-22 5:09
simoneguidi0130-Dec-22 5:09 
AnswerRe: Display BLOB image in JSP Pin
jschell2-Jan-23 13:29
jschell2-Jan-23 13:29 
QuestionWhich coding language is best for developing web apps? Pin
nithin sethu14-Dec-22 2:18
nithin sethu14-Dec-22 2:18 
AnswerRe: Which coding language is best for developing web apps? Pin
Richard MacCutchan14-Dec-22 2:41
mveRichard MacCutchan14-Dec-22 2:41 
GeneralRe: Which coding language is best for developing web apps? Pin
Richard Deeming14-Dec-22 2:48
mveRichard Deeming14-Dec-22 2:48 
GeneralRe: Which coding language is best for developing web apps? Pin
Richard MacCutchan14-Dec-22 2:58
mveRichard MacCutchan14-Dec-22 2:58 
AnswerRe: Which coding language is best for developing web apps? Pin
Gerry Schmitz14-Dec-22 9:10
mveGerry Schmitz14-Dec-22 9:10 
QuestionPor favor alguien q me ayude con estos ejercicios en netbenas en formulario jframe Pin
Joel Jordan3-Dec-22 13:00
Joel Jordan3-Dec-22 13:00 
AnswerRe: Por favor alguien q me ayude con estos ejercicios en netbenas en formulario jframe Pin
PIEBALDconsult3-Dec-22 13:16
mvePIEBALDconsult3-Dec-22 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.