Skip Headers

# Using Java

Previous

Next

You can create an instance of the `DatabaseSession` class 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 Database Session from a Project Class illustrates creating a `DatabaseSession` using a `Project` class.

Creating a Database Session from a Project Class

    Project myProject = new Project();
    DatabaseSession databaseSession = myProject.createDatabaseSession();

Example: Creating a Database Session from a project.xml File Project illustrates creating a `DatabaseSession` using a `Project` read in from a `project.xml` file.

Creating a Database Session from a project.xml File Project

    Project myProject = XMLProjectReader.read("myproject.xml");
    DatabaseSession databaseSession = myProject.createDatabaseSession();