title: I want to connect a Netbeans java application with Firebase Database
body: <p>I am new to Firebase. I know there is an SDK (Firebase Admin SDK) which allows you to connect a Java application to the Firebase Database. I followed all the instructions given on the Firebase's website ( <a href="https://firebase.google.com/docs/database/admin/start" rel="nofollow noreferrer">https://firebase.google.com/docs/database/admin/start</a> ) but still my data is not getting saved in the database. My code is as follows : </p>
  
  <pre><code>import com.google.auth.oauth2.GoogleCredentials;
  import com.google.firebase.FirebaseApp;
  import com.google.firebase.FirebaseOptions;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import java.io.FileInputStream;
  import java.util.HashMap;
  import java.util.Map;
  
  public class FirebaseDBDemo {
  
  public String date_of_birth;
  public String full_name;
  public String nickname;
  
  public FirebaseDBDemo(String date_of_birth, String full_name) {
      this.date_of_birth = date_of_birth;
      this.full_name = full_name;
  }
  
  public FirebaseDBDemo(String date_of_birth, String full_name, String nickname) {
      this.date_of_birth = date_of_birth;
      this.full_name = full_name;
      this.nickname = nickname;
  }
  
  
  public static void main(String[] args) {
  
      try {
  
          // Initializing the SDK
  
          FileInputStream serviceAccount = new FileInputStream("C:\\Users\\ABC\\Documents\\NetBeansFirebase\\New\\nbfb-51117-firebase-adminsdk-s2gs4-5b1a87c6b2.json");
  
          FirebaseOptions options = new FirebaseOptions.Builder()
              .setCredentials(GoogleCredentials.fromStream(serviceAccount))
              .setDatabaseUrl("https://nbfb-51117.firebaseio.com/")
              .build();
  
          FirebaseApp.initializeApp(options);
  
  
  
          System.out.println("\n------SDK is Initialized------");
  
  
  
          final FirebaseDatabase database = FirebaseDatabase.getInstance();
          DatabaseReference ref = database.getReference("server/saving-data/fireblog");
  
          DatabaseReference usersRef = ref.child("users");
          Map&lt;String, FirebaseDBDemo&gt; users = new HashMap&lt;&gt;();
          users.put("alanisawesome", new FirebaseDBDemo("June 23, 1912", "Alan Turing"));
          users.put("gracehop", new FirebaseDBDemo("December 9, 1906", "Grace Hopper"));
  
          usersRef.setValueAsync(users);
  
  
      } catch (Exception e) {
          System.out.println(""+e);
      }
  
  
  }
  }
  </code></pre>
  
  <p>My build.gradle file is as follows : </p>
  
  <pre><code>apply plugin: 'java'
  
  sourceCompatibility = '1.8'
  [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  
  // NetBeans will automatically add "run" and "debug" tasks relying on the
  // "mainClass" property. You may however define the property prior executing
  // tasks by passing a "-PmainClass=&lt;QUALIFIED_CLASS_NAME&gt;" argument.
  
  // Note however, that you may define your own "run" and "debug" task if you
  // prefer. In this case NetBeans will not add these tasks but you may rely on
  // your own implementation.
  if (!hasProperty('mainClass')) {
      ext.mainClass = 'FirebaseDBDemo'
  }
  
  repositories {
      mavenCentral()
      // You may define additional repositories, or even remove "mavenCentral()".
      // Read more about repositories here:
  
  }
  
  dependencies {
      // TODO: Add dependencies here ...
      // You can read more about how to add dependency here:
  
      testCompile group: 'junit', name: 'junit', version: '4.10'
      implementation 'com.google.firebase:firebase-admin:6.5.0'
      implementation 'org.slf4j:slf4j-jdk14:1.7.25'
  }
  </code></pre>
  
  <p>Please help me out.</p>