Skip Headers

# Using Java

Previous

Next

You can create a server session in Java code using a project. You can create a project in Java code, or read a project from a `project.xml` file.

Example: Creating a Server Session from a Project Class illustrates creating an instance (called `serverSession`) of a `Server` class using a `Project` class.

Creating a Server Session from a Project Class

    Project myProject = new Project();
    Server serverSession = myProject.createServerSession();

Example: Creating a Server Session from a project.xml File Project illustrates creating an instance (called `serverSession`) of a `Server` class using a `Project` read in from a `project.xml` file.

Creating a Server Session from a project.xml File Project

    Project myProject = XMLProjectReader.read("myproject.xml");
    Server serverSession = myProject.createServerSession();

Example: Creating a Server Session with Custom Write Connection Pool Size illustrates creating a server session with a specified write connection pool minimum and maximum size (when using TopLink internal connection pooling). The default write connection pool minimum size is 5 and maximum size is 10.

Creating a Server Session with Custom Write Connection Pool Size

    XMLProjectReader.read("myproject.xml");
    Server serverSession = myProject.createServerSession(32, 32);