Package org.h2.server.web

# Class JakartaDbStarter

java.lang.Object
org.h2.server.web.JakartaDbStarter

All Implemented Interfaces:
  `jakarta.servlet.ServletContextListener`, `EventListener`

public class JakartaDbStarter extends Object implements jakarta.servlet.ServletContextListener
This class can be used to start the H2 TCP server (or other H2 servers, for example the PG server) inside a Jakarta web application container such as Tomcat or Jetty. It can also open a database connection.

## Constructor Summary

Constructors
Constructor
Description
`JakartaDbStarter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`contextDestroyed(jakarta.servlet.ServletContextEvent servletContextEvent)`
`void`
`contextInitialized(jakarta.servlet.ServletContextEvent servletContextEvent)`
`Connection`
`getConnection()`
Get the connection.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JakartaDbStarter

public JakartaDbStarter()

## Method Details

### contextInitialized

public void contextInitialized(jakarta.servlet.ServletContextEvent servletContextEvent)

Specified by:
  `contextInitialized` in interface `jakarta.servlet.ServletContextListener`

### getConnection

public Connection getConnection()
Get the connection.

Returns:
  the connection

### contextDestroyed

public void contextDestroyed(jakarta.servlet.ServletContextEvent servletContextEvent)

Specified by:
  `contextDestroyed` in interface `jakarta.servlet.ServletContextListener`