Commit a7aebf2 1 parent cf23b86 commit a7aebf2 Copy full SHA for a7aebf2
File tree 1 file changed +21
-1
lines changed
extension/datasource/src/site/markdown
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ You override the default DataSource using the snippet below:
28
28
</data-source >
29
29
```
30
30
31
- For runtimes that do not include the web.xml extension you will need to add it if you want
31
+ For runtimes that do not include the Piranha web.xml extension you will need to add it if you want
32
32
to override the default DataSource as described above. You can do this by adding the
33
33
following dependency to your pom.xml:
34
34
@@ -39,3 +39,23 @@ following dependency to your pom.xml:
39
39
<version >${piranha.version}</version >
40
40
</dependency >
41
41
```
42
+
43
+ ## Register Any Other DataSource
44
+
45
+ You can register any other DataSource by using a similar approach. Below is an example of configuring a PostgreSQL DataSource:
46
+
47
+ ``` xml
48
+ <data-source >
49
+ <name >java:comp/PostgreSQLDataSource</name >
50
+ <class-name >org.postgresql.ds.PGSimpleDataSource</class-name >
51
+ <url >jdbc:postgresql://localhost:5432/mydb</url >
52
+ <user >myuser</user >
53
+ <password >mypassword</password >
54
+ <property >
55
+ <name >ssl</name >
56
+ <value >true</value >
57
+ </property >
58
+ </data-source >
59
+ ```
60
+
61
+ Make sure to replace the values with your actual PostgreSQL database details.
You can’t perform that action at this time.
0 commit comments