Sequence state machine
First, you should follow the Java naming conventions.

Second, don't shorten names just because you can. Example, what does &quot;Proc&quot; stand for? Procedure? Processor? Even if names become longer, the readability is worth it!

static String db_host = null;

Your members should not be static, and should ideally be qualified with something else than package-private, like protected or private to show the intent clearly.


In order to read the required arguments I need some kind of state machine.

Is that a requirement you've been given or is that an assumption you had? Because that's not true at all. Overall, your system is completely unnecessarily complex without an obvious reason or benefit. Neither does it seem like a state-machine at all, it's just an overly complex chain of function calls.
A state-machine for your command-argument parsing would be something like this:
for (int index = 0; index &lt; args.length; index++) {
    String arg = args[index];
    
    if (arg.equals(&quot;-p&quot;) &amp;&amp; databaseHost == null) {
        arg = args[++index];
        
        databasePort = arg;
    } else if (databaseHost == null) {
        databaseHost = arg;
    } else if (databaseUsername == null) {
        databaseUsername = arg;
    } else if (databasePassword == null) {
        databasePassword = arg;
    } else if (inputFile == null) {
        inputFile = arg;
    }
}

And even that is oddly complex.
What you want is the most simplest solution that works, and that would be a hardcoded extracting of arguments:
if (args[0].equals(&quot;-h&quot;)) {
    printHelp();
    return;
}

int portProvidedOffset = 0;

if (args[0].equals(&quot;-p&quot;)) {
    databasePort = args[1];
    
    portProvidedOffset = 2;
}

databaseHost = args[portProvidedOffset + 0];
databaseUsername = args[portProvidedOffset + 1];
databasePassword = args[portProvidedOffset + 2];
inputFile = args[portProvidedOffset + 3];

Which is, of course, not pretty, but the most simplest solution you can get away with. Of course, the length of the array should be checked beforehand, whether it is 4 elements or more. Afterwards you'd check whether all parameters are set, if not, exit with an error.
If you want a more sophisticated solution, you'd need to write yourself a complete argument parser, a not-so-trivial exercise.