Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//===   it under the terms of the GNU General Public License as published by

public class Main {
    private static boolean dbCanUseMultipleThreads = false;

    /** Get number of processors allocated to JVM if the database supports
     * threaded access. 
     * 
     * @return number of processors allocated to JVM.
     */
    public static String getNumberOfProcessors() {
        int result = 1;
        if (dbCanUseMultipleThreads) {
            result = Runtime.getRuntime().availableProcessors();
        }
        return result + "";
    }
}