Actually i'd developed one software which is very slow enough as i'm using Swing,
but how 'd the performance go on while i be using AWT.
I need to know the performance than a looks
narayan_gop_mah wrote:
Actually i'd developed one software which is very slow enough as i'm using Swing,..
Swing is not slow(1). Perhaps your application is doing some intensive operations on the EDT and slowing or blocking the GUI, but changing such an application to use AWT will not help it.
(1) At least, not in common situations, though I've heard of problems using JFileChooser with directories that contain thousands of files. In that case, as long as the PLAF is the system PLAF, you can sneak in a FileDialog with barely anyone noticing.
Sir,
I 've made database driven desktop app which is making my program very slow ..
And i had make plan to make all SQL query at SwingWorker doBackground() ....is it good idea for good performance?
One more que,
I used one class DataPass which connects database and all the database name, user and pass is hard coded
Can't be make them to hide on somewhere which can't be seen via source code... or like encrypted type. Can we?
narayan_gop_mah wrote:
Sir,
I 've made database driven desktop app which is making my program very slow ..
And i had make plan to make all SQL query at SwingWorker doBackground() ....is it good idea for good performance?
It depends what you mean. The query will take just as long, but the GUI will remain responsive (hopefully with a progress bar and 'cancel' button if the user changes her mind).
One more que,
Did you mean 'question'? If so, please type the word properly, so the reader does not have to figure what some text-messaging style gibberish means.
I used one class DataPass which connects database and all the database name, user and pass is hard coded
Can't be make them to hide on somewhere which can't be seen via source code... or like encrypted type. Can we?
No - it is insecure to put any 'secret'(1) information into the code. This is a question better taken to a DB forum, but I can guess the DB gurus will tell you to hide the DB behind a servlet (or other server side protection) that restricts what the user/application can do.
(1) The code can be obfuscated to slow a hacker down five minutes, but a motivated hacker will always be able to break whatever controls you try to put on 'secret' information.
The simplest way I can think to do that with any code that accesses a remote resource, is by using a packet sniffer to check the network traffic.
narayan_gop_mah wrote:
Actually i'd developed one software which is very slow enough as i'm using Swing,
but how 'd the performance go on while i be using AWT.
Swing is not your bottleneck, your code is. If your program is "slow" with Swing, then it will also be "slow" if you rewrote it with AWT. Use a profiler to figure out where your actual bottleneck is. I'd bet money though, that you're blocking the EDT when you shouldn't be, you just don't realize it.
narayan_gop_mah wrote:
Actually i'd developed one software which is very slow enough as i'm using Swing,
but how 'd the performance go on while i be using AWT.
I need to know the performance than a looks
NOTE: As of the JDK 6 update 12 and JDK7 build 19 releases, you can seamlessly mixing heavyweight and lightweight components. See the Mixing Heavyweight and Lightweight Components article for more information
1/ try to run(debug) your sceleton under some of profiler, here you can confortly to trace any yr classes (returns memory, time, etc)
2/ ovewrite your lazy methods with similairs funcions (on this forum is "a few" fulltime coders), faster code is sometime very long
3/ somethimes is Case faster than If..else (but depends of yr logics)
4/ sent only prepared (never bindings vaules from huge tables) result to SQL interpreter (sql engines is basicaly faster like as your bettter and tunned code)
5/ to built only one (max two) strong db connection (started with app.), and never open -->close, open-->close (>=10 - 20sec)
6/ doBackround is really good for realtime app. (if you want to catch, trace and dispalay any changes on any sides on your app)
7/ performace of app is depends by only and only abuot your knowledge of this engine (Java) and about basics services (f.e. somethimes is faster send ==null to object and then built its again)
8/ forget for RGT binding of values from MsSql, MsAccess, MsExcell --> dotNet
9/ create refresh button for users
1/ if you needed to "HIDE" the UserName and Psw for db connection, then easiets way is "crypt" this String value to the Binary forms,
2/ from any compiled executable files you can read or display values from string variables, and you can change this string values (exe and dll too), without use the decompilier --> norton comander and F4
3/ be sure that your UserName & Psw are placed on diferent codes blocks, are longer, and contains non Alphanumerics chars,
4/ isn't possible to dispay String value from binary forms, without using strong decompilier
5/ numbers and type of chars from UserName and Psw only coplicated easy listening for encode this values from whispers on PC's ports,
6/ at first you have to lock and check if your bacis input fields didn't allows sql injection (strict check for Sql keywords, not for all, only up to cca. 10pct), if yes then (quite good coders didn't knows more than) you can write your UserName and password as String value, or put it directly to the propertiers file, sry 4 my stupid ...
7/ aaand good Aplications must allows to change the Psw (on some periods), container (15-20 prepared Psw) or Psw generator, with access to change current User's Psw to db,
kopik wrote:
3/ somethimes is Case faster than If..else (but depends of yr logics)
Sorry, but this is truly ridiculous advice. Use a switch/case statement when it makes sense, use an if/else statement when it makes sense. No need to worry about which one is "faster," especially with the optimizations today's compilers can do. I challenge you to come up with a scenario when using one or the other will produce a noticeable performance difference in an application, especially one making calls to a database.
1/ if you needed to "HIDE" the UserName and Psw for db connection, then easiets way is "crypt" this String value to the Binary forms,
This won't stop a determined hacker. You'll have to "decrypt" the information at some time in your application, and that's when a hacker can grab it. Take AndrewThompson's advice and never hard-code passwords in applications.
BoBear2681 said:
'Sorry, but this is truly ridiculous advice. Use a switch/case statement when it makes sense, use an if/else statement when it makes sense. No need to worry about which one is "faster," especially with the optimizations today's compilers can do. I challenge you to come up with a scenario when using one or the other will produce a noticeable performance difference in an application, especially one making calls to a database.'
---> real App's semaphore with Case is markedly faster than same semaphore under if..else, (sry BoBear2681 for my any infos, I want to only hepl, descibed probs or reproduce practicies), but truly ridiculous RTG App's have to :
1/ calcuted with each of moments while code runs,
2/ prepare all possible users decides,
3/ fill up accesible options,
4/ fill up the GUI,
5/ strict on backRound,
6/ altogether execute points 1-5,
7/ sooner (before) than users could see anything overpainting or flashing on screen or "push to anything", that's only about App's performancies, designated for real users ...,
8/ don't built strawman concerning with db conn, it's only about good timing or mistime, today's db engines had correct and fast sql interpreter, non-strict for Sql keywords ordering, quite good ignore CaseSensitive or mistyped characters, simply indexable (some params excluding MsSql), larns to sent nullValue, I think that's prepared result is faster than today's capability fill up and refresh same results data into GUI, 1:2 ---> 2:3 (db v.s. GUI)
BoBear2681 said:
'This won't stop a determined hacker. You'll have to "decrypt" the information at some time in your application, and that's when a hacker can grab it. Take AndrewThompson's advice and never hard-code passwords in applications.'
---> please to compile and debug my bacis example, then open this file for view details from this compiled class, what you could see there,
be sure that String Pws and String BinPws contains same value, but you can't simly reproduce and can't display the prepared value for String BinPws (without using strong decompilier), to hide sensitive and accessible String values, visible from compiled code, nothing else,
---> sry that I didn't solved this problems for product solutions in the long run, cos I'm e-directories familiars, and there are logics for UserAccess or Psw's so different (or elsewhere),
---> only theoreticaly: at first sight is clear that the remote server service (connection) is stronger than coders simple tricks, but with all due respect to real coders...,
---> I think that hacker have got a little bit different methods, and acquisition for the code, decompile this code = last from prospect, here's find out access, not interest about some compiled pieces from the code, please don't make simply things harder,
---> this is only example how to do: