You can't know upfront if a question will be salvaged with an edit. You can only try to address any issues based on the guidance in the Help center and the question checklist. After that you wait for comments and keep an eye on the timeline.
You make your life (and ours) much easier if a post in its first revision is on-topic, well researched, shows any attempts, provides context, includes an MCVE (assuming you ask about code), is well formatted (paragraphs, text, outlines), is free of grammar and spalling mistakes.
Your first revision was this:
I need to edit .sql files with Java, so that I can set all the options before sending the sql to a server.
I couldn't find any way to edit the file contents programatically, without having to send it to a server.
Is there a way to do it?
This question is a lost case at the start and once posted your subsequent edits, hopefully triggered by the comments, didn't really address any of the concerns raised. None of the items in the question checklist can be answered with yes. After this you leave the question alone for 6 days only to make another edit that is an attempt to fix things but still doesn't get to the core of the problem. In the mean time your question has been in the triage queue and two times in the close vote queue, survived both times. Lucky for you, it received one upvote (and two more down votes).
Fast forward to today. You made another edit. Looking again at the question checklist you get some issues right now, like context, and example input but what still is lacking is: Your attempt: did you try to have Eclipse do that transformation for you? Notepad++? Attempt to write a java console app? None of that in your question. What research did you do? Which search terms did you use? We don't know. And this are just some of the bullet points mentioned in question checklist.
However it's unlikely you really can put much improvement to a question that received a lot of down-votes on its first appearance.
It is always a bit strange that users claim this while I can point out some issues that need to be addressed. The first comments you got were very helpful in the sense that they should have triggered the idea that your question might have been too broad. It still might be too broad today, if not unclear. If you're unable to address the concerns raised immediately one often overlooked option is to delete the post first, then edit the post while it is still deleted. That gives you plenty of time to edit the hell out of it.
People might just see a big amount of downvotes and downvote it again, and this way I won't know that the question improved?
The votes really don't matter for the new voters. Up votes are much more likely to happen then down votes. What you can do is either ping the commenters to inform them you updated the question and ask if that addresses their earlier comments. When they confirm they can remove that comment or you can flag for a moderator to have the comments removed. That prevents that any confusion will arise from now obsolete comments. And if the earlier commenters chime in with tips you'll learn if your edit was successful
This all said: There is no guarantee that a question that had a bad start will magically transform into a gold nugget. Putting effort in might help but bumping it with trivial edits or parading it on meta while it is still not good enough might have averse effects. Voting, after the initial burst, isn't guaranteed. I have plenty of old posts that still need to see their first up vote (but that is also due to the fact that I'm only mediocre). If the post is OK, it will get a vote, somewhere in the future.