Try Playground
Show / Hide Table of Contents

Java Client API Prerequisites

In order to practically utilize the powerful features of client-side NCache with your Java client application, make sure to implement the prerequisites discussed below.

Java Client Prerequisites

  • Add the following Maven dependencies for your Java client application in pom.xml file:
<dependency>
    <groupId>com.alachisoft.ncache</groupId>
    <!--for NCache Enterprise-->
    <artifactId>ncache-client</artifactId>
    <!--for NCache Professional-->
    <!--artifactId>ncache-professional-client</artifactId-->
    <version>x.x.x</version>
</dependency>
  • Import the following packages in your Java client application:
    • import com.alachisoft.ncache.client.*;
    • import com.alachisoft.ncache.runtime.*;
    • import com.alachisoft.ncache.runtime.exceptions.*;
  • The cache must be running.
  • Make sure that the data being added is serializable.
  • To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
  • To handle any unseen exceptions, refer to the Troubleshooting section.

  • For Tags, Named Tags, Locking, and Expirations:

    • import com.alachisoft.ncache.runtime.caching.*;
    • import com.alachisoft.ncache.runtime.caching.NamedTagsDictionary.*;
  • For Cache Data Dependencies, e.g., KeyDependency, FileDependency, and Database Dependencies: [Deprecated]
    • import com.alachisoft.ncache.runtime.dependencies.*;
  • For JSON Data: [Deprecated]
    • import com.alachisoft.ncache.runtime.json.*;
  • For SQL Queries:
    • import com.alachisoft.ncache.runtime.caching.*;
  • For Event Notifications:
    • import com.alachisoft.ncache.events.*;
  • For Continuous Query: [Deprecated]
    • import com.alachisoft.ncache.events.*;
  • For Data Structures:

    • import com.alachisoft.ncache.client.datastructures.*;
    • import com.alachisoft.ncache.events.*;
    • import com.alachisoft.ncache.runtime.dependencies.*;
  • For Pub/Sub:

    • import com.alachisoft.ncache.runtime.caching.*;

See Also

Create Cache
Connecting to Cache
Insert Data to Cache

In This Article
  • Java Client Prerequisites
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top