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

  • Home
  • SEARCH
  • 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 6932375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:41:53+00:00 2026-05-27T11:41:53+00:00

How do I add data source in persistence.xml so that IntelliJ IDEA sees it

  • 0

How do I add data source in persistence.xml so that IntelliJ IDEA sees it ?

I have little desktop application (which works as I want it to) that has following persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="reportingPU" transaction-type="RESOURCE_LOCAL">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <class>com.test.data.Company</class>
        <properties>
            <property name="toplink.jdbc.user" value="SA"/>
            <property name="toplink.jdbc.password" value=""/>
            <property name="toplink.jdbc.url" value="jdbc:hsqldb:file:ReportingDB"/>
            <property name="toplink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
            <property name="toplink.target-database" value="HSQL"/>
        </properties>
    </persistence-unit>
</persistence>

When I open class Company.java which looks like

@Entity
@Table(name = "COMPANY")
public class Company implements Serializable{

    @Id
    private Long id;
    @Column(name = "NAME")
    private String name;
}

IDEA underscores “COMPANY” and “NAME” saying data source is not defined. And yes, I don’t have it in data source column if I open JPA module configuration.

This article says I should add jta-data-source tag to persistence.xml but it doesn’t make datasource show up in JPA module configuration view.

I’m confused 🙁

  • 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-05-27T11:41:54+00:00Added an answer on May 27, 2026 at 11:41 am

    Go to Tool/Data Sources menu. It will let you add new datasource based on information in properties tag of your persistence.xml. After that you’ll be able to select it in JPA module configuration window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGridView which I add data to programatically. I have the AutoSizeRowsMode
I have data source and table that I can bind to my controls and
Greetings. I have an RDLC file and am wanting to add a data source
Things like $log$ and $version$ which add data upon check-in to the file. I'm
How do I add extra data into an atom feed that does not map
Ok first off do I need to add a data source in the designer?
I'm writing a Java SE (desktop) application that has to access different databases all
I have a simple Windows Forms application which binds a DataView to a ListBox.
Currently I have one application in which I am able to access .mdb or
Normally you can add a query as a new data source in Cognos PowerPlay

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.