Making database for each user (no sharing between each other)

This commit is contained in:
Nanne Baars
2017-04-15 18:11:55 +02:00
parent 7ff5503241
commit 213e73bf02
2 changed files with 3 additions and 6 deletions

View File

@ -7,8 +7,6 @@ import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
/**
*************************************************************************************************
@ -39,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
* @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a>
* @version $Id: $Id
*/
//TODO: class we need to refactor to new structure, we can put the connection in the current session of the user
public class DatabaseUtilities
{
@ -122,7 +121,7 @@ public class DatabaseUtilities
private static Connection getHsqldbConnection(String user, WebgoatContext context) throws ClassNotFoundException,
SQLException
{
String url = context.getDatabaseConnectionString().replaceAll("\\$\\{USER\\}", user);
String url = context.getDatabaseConnectionString().replace("{USER}", user);
return DriverManager.getConnection(url, "sa", "");
}