This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The getRealPath("/") method finds the actual file path to your web context root. Once you have this, you can determine any other path relative to the context root. You can then pass this path into your DAO method.
From servlet/action/jsp you can't get the absolute path. You need to specify this a parameter to the Container. You can use context-param in web.xml to specify the absolute path to your webapp directory and use ServletConfig to get the init parameter.