Skip to content

Instantly share code, notes, and snippets.

@danilobatistaqueiroz
Last active June 21, 2024 07:20
Show Gist options
  • Select an option

  • Save danilobatistaqueiroz/dc4ff64e34258c42414a925903e47c61 to your computer and use it in GitHub Desktop.

Select an option

Save danilobatistaqueiroz/dc4ff64e34258c42414a925903e47c61 to your computer and use it in GitHub Desktop.
wildfly and sqlite datasource

[wildfly root]\standalone\configuration\standalone.xml

        <subsystem xmlns="urn:jboss:domain:datasources:4.0">
            <datasources>
                <datasource jndi-name="java:/SqliteDS" pool-name="SqlitePool">
                    <connection-url>jdbc:sqlite:f:/java/projects/java_sqlite/dbwildfly.db</connection-url>
                    <driver>sqlite</driver>
                    <security>
                        <user-name></user-name>
                        <password></password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="sqlite" module="org.sqlite">
                        <driver-class>org.sqlite.JDBC</driver-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>

[wildfly root]\modules\org\sqlite\main\module.xml

<?xml version='1.0' encoding='IBM1252'?>
<module xmlns="urn:jboss:module:1.1" name="org.sqlite">
    <resources>
        <resource-root path="sqlite-jdbc-3.21.0.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

[wildfly root]\modules\org\sqlite\main\sqlite-jdbc-3.21.0.jar

@onlyleft
Copy link

I had to add <module name="org.slf4j" /> but it works perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment