Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8529333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:00:51+00:00 2026-06-11T09:00:51+00:00

Does anybody know how to connect jboss-as-7.1.1 to PostgreSQL?

  • 0

Does anybody know how to connect jboss-as-7.1.1 to PostgreSQL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:00:53+00:00Added an answer on June 11, 2026 at 9:00 am

    (Note that this was written for JBoss AS 7.1.1; keep that in mind if on a newer version, as things might have changed.)

    Download PgJDBC. I’m assuming you’re using postgresql-9.1-902.jdbc4.jar, the current version at time of writing. Adjust any filenames to match if you need a different version.

    Now deploy the JDBC driver to JBoss AS 7 by putting it in the deployments folder or using the deploy command in jboss-cli. This will work for most, but not all, purposes.

    Alternately, you an define a PostgreSQL JDBC driver module:

    1. Create the path $JBOSS_HOME/modules/org/postgresql/main. The modules/org part should already exist, make directories for the rest.
    2. In $JBOSS_HOME/modules/org/postgresql/main/module.xml with the following content, changing the resource-root entry for the PgJDBC driver to refer to the driver you wish to use.

      <?xml version="1.0" encoding="UTF-8"?>
      <module xmlns="urn:jboss:module:1.1" name="org.postgresql">
           <resources>
               <resource-root path="postgresql-9.1-902.jdbc4.jar"/>
           </resources>
           <dependencies>
               <module name="javax.api"/>
               <module name="javax.transaction.api"/>
               <module name="javax.servlet.api" optional="true"/>
           </dependencies>
       </module>
      
    3. Into the same directory as module.xml place postgresql-9.1-902.jdbc4.jar
    4. Start JBoss AS
    5. Open jboss-cli by running $JBOSS_HOME/bin/jboss-cli --connect
    6. Run the command:

      /subsystem=datasources/jdbc-driver=postgresql-driver:add(driver-name=postgresql-driver, driver-class-name=org.postgresql.Driver, driver-module-name=org.postgresql)
      
    7. Now create any required data sources, etc, using postgresql-driver as the driver name.

    You can create a datasource via the web ui, with jboss-cli with the data-source create command (see data-source --help, data-source add --help), or by deploying a -ds.xml file like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
      <datasource jndi-name="java:/datasources/some-ds" enabled="true" use-java-context="true"  
            pool-name="some-ds-pool">
        <connection-url>jdbc:postgresql:dbname</connection-url>
        <driver>postgresql-driver</driver>
        <security>
          <user-name>username</user-name>
          <password>password</password>
        </security>
      </datasource>
    </datasources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know how to connect to Jenkins with own openid provider? We have
Does anybody know why this function, when passed an invalid date (e.g. timestamp) to
Does anybody know if the CUDA library 'Thrust' can generate random numbers on the
Does anybody know how to programmatically disable the keyboard individual letter pop-up? (This blue
Does anybody know why my getAltitude in the following always returns 0? package com.example.helloandroid;
does anybody know how to insert code into lyx? just like what is available
Does anybody know a good place to learn how to use the debugger in
Does anybody know how I can enable line numbers for Ruby (and Ruby on
Does anybody know a Perl library that can parse XML documents and enables me
does anybody know of an extension of shouldjs or some other assertion library which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.