Database persistence with Eclipse

Hi All,
I have a basic web project involving few servlets and other utility classes. I just to add a database persistence logic into my project using eclipse. The scenario is very simple, I just need to add few entires into the table which has one foreign key constraint and other simple string columns.
I could do a basic jdbc-odbc way, but just thought of getting into some persistence api provided by the java e.g. JPA. My database is mySQL, application server is JBoss and IDE is Eclipse.
So is there any eclipse tutorial which should help configuring an existing web project to add persistence logic? I didn't find any help material which is simple and quick to adapt.
thanks.

You want to do JPA? Eclipse has the Dali plugin for this. This is by default included in the Eclipse Java EE version. Documentation and tutorials are available at the Eclipse site.
This has nothing to do with JDBC. JPA is another API and Eclipse is just a tool.

Similar Messages

  • Connect a Microsoft SQL Server Database with eclipse

    Hi all,
    I am having problem to connect a Microsoft SQL Server Database with eclipse. Is it possible to do it? And could someone explain me how, please? When I want to create a connection from the data source explorer, I have in the list of connection only derby and jdbc. Is anything else that I have to download?
    Thank you in advance for your help.

    Just choose generic JDBC and locate/specify the driver yourself. Exactly the same as you would use when you wrote JDBC code yourself.

  • Java framework/toolkit for POJO, database persistence and XML

    Hi all,
    I've been wondering if there's a toolkit or framework for developing Java program (could be standalone Java program, EJBs etc.)
    I surfed around casually and found some but there isn't any detailed description of what and how each framework/toolkit does. So I hope to ask around if you've anything that you have used before and would like to point to me to look further.
    Given the huge number of open source toolkits, libraries and frameworks out there, it can be quite confusing as to which one is more suitable for me. Also with Sun's move into JDO and Java Persistence API, things become more messy and complicated - there isn't any clear leader in this area and things are starting to change with the inclusion of JDO which seems to be the future standard persistence API to use.
    So far, I've only worked with Hibernate for database persistence before. So I'm wondering if there're other options such as Hibernate with XDoclet, Castor and Spring framework etc. that can easily transform Plain Old Java Objects (POJO) -- hopefully using Java Reflection w/o using mapping XML files like in Hibernate -- into SQL for database persistence and XML text data and vice-versa. The current problem is that I've been spending tons of time writing code to transform data in Java objects into XML (using my own format) and also doing mapping files for Hibernate.
    I am hoping for something simple like:
    Object o = new Object();
    o.setProperty = "something";
    String xml = o.toXML(); // Convert object to XML text.
    o.save(); // Save to database.
    // The reverse: Parse XML into object and load from database
    Object o = new Object();
    o.fromXML(xml);
    o.load();
    // Properties should be initialized from database or XML.
    Anything similar to this out there?

    Hi,
    Just to share what I've found after surfing a bit more on this issue to promote more discussion on this area.
    For mapping of Java objects to XML, we can try looking more at Castor and JAXB.
    For database persistence to/from Java objects, look at Hibernate and JDO.
    There is this Hydrate project (hydrate.sourceforge.net) that I do not know where it fits in still. But it is supposed to do data transformation and mapping between Java objects, XML and database representation.
    Fyi.

  • Web Service with Eclipse

    Has anyone tried accessing a web service with eclipse? We'd like to start using them with our forms for database lookups and the web services are already written. We just haven't had much success calling them with our servlets.
    Thanks,
    Chad

    We also wrote web services with eclipse and deployed them in our jboss app.serv. We can call them in our pdf forms as data connection, or inside some events with java script code.
    What is your problem about ? Did you manage to deploy the web services ? Can you create data connections inside forms ?
    We have faced some difficulties to success writing and caling web services. I may help if you have similar problems.

  • How to develop web application using ejb3.0 with eclipse

    Hi ,
    I am new to ejb3.0 with eclipse. If any one familar that please guide me...
    how to develop web application using ejb3.0 with eclipse.please help me... server jboss4.2.2. database mqsql5.0
    Thanks,

    jsf_VWP5.5.1 wrote:
    I am new to ejb3.0 with eclipse. If any one familar that please guide me...http://help.eclipse.org/help33/index.jsp

  • Debugging JSP with Eclipse

    Hi, how to connect to Oracle Database 9i R2 with Eclipse?

    Hi, I didn't get an email notifying me of a response to this. Just happened to check myself.
              But basically you want to point the weblogic server directly to your workspace (src code) so it can detect a change. THis is from our doc below. You may also write an ant script specific to weblogic that redeploys the app and reloads the xml and prop files without restarting the server.
              1.     Start up your Weblogic domain server (i.e., C:\Domains\devDomain\startWebLogic.cmd).
              2.     Go to url, http://localhost:7001/console and log in (weblogic, weblogic).
              3.     On the left menu, click Deployments, then Lock & Edit button above it, and then the Install button in the main panel.
              4.     Change the location to the web folder in your project workspace (C:\Eclipse\workspace\<projectname>\web) Click Next.
              5.     Leave checked the Install this deployment as an application and click Next.
              6.     Put name for Name of deployment. . From here you can click Finish.
              7.     Click Activate Changes. Then check the deployment box and click Start button and Servicing all requests (in Deployments panel). Then click Yes to start it on the next page
              8.     Enter the URL of the application. This example is
              http://localhost:7001/web/index.htm
              The ?web? was the name of the web folder we deployed from. In the future you could name this something different if deploying from this console so the url?s do not conflict.
              Edited by mwooten77 at 01/18/2007 9:34 AM
              Edited by mwooten77 at 01/18/2007 9:35 AM

  • AQ Database Persistence Provider

    Hi ,
    i am trying to configure a Database Persistence Provider on OC4J 10.1.3.3 for an AQ database queue , i have defined a Connection Pool and Data Source for that DataBase Connection , and then (through the EM Deploy Database Persistence Provider) i do specify the Resource Adapter Module Name and select the defined DataSource , but it gives me the following error :
    Error
    An error has occurred.
    connectors\ojms.rar (The system cannot find the path specified)
    connectors\ojms.rar (The system cannot find the path specified)
    any hints,
    Thanks in advance.

    Check the comments at the end of this blog post...
    http://mike-lehmann.blogspot.com/2006/09/simple-mdb-with-oracle-database-jms.html
    Hope that helps.
    Rod

  • Custom Java Type persistence with JDO

    Hello,
    I have a question regarding KodoJDO.
    We have a class called "CBOCountry", CBOCountry is a type that has some
    behaviors.
    Each CBOCountry has only one field, an integer.
    We have a class called Person, this class must be persisted in the DB !
    Also, Person has a file of type CBOCountry, so, we need to persist in the
    DB the integer field of the CBOCountry.
    It is possible with JDO ?
    You can call me at +352 295665 280
    (Can you also send me a list of prices for KodoJDO ?)
    Thanks
    Demez Christophe

    Christophe,
    Ah! It seems to be that I recall some discussion of serialization on
    this list and if I recall right, it is possible to serialize an object
    as a field, but then you would lose the ability to query on those
    fields, I'm pretty sure. What you want is CBOCountryValue to be a
    second class object stored in PERSONX table.
    So let's see what the others have to say.
    David
    -------- Original Message --------
    Subject: Re: Custom Java Type persistence with JDO
    Date: Tue, 14 Aug 2001 14:00:28 +0200
    From: [email protected]
    To: [email protected]
    Thanks David, but ...
    I have 2 tables and only one table is usefull.
    In fact, what I need is a table PERSONX with a field CBOCOUNTRYVALUE !
    In our object model, every field is a specific class ( a CBO), and we do
    not want to create a table by field or even by kind of field.
    Thanks , I appreciate your answer
    Christophe
    David
    Ezzio
    <dezzio@ysoft To:
    [email protected]
    .com>
    cc:
    Subject: Re: Custom Java
    Type persistence with JDO
    08/14/01
    02:01
    PM
    Christophe,
    The short answer is yes. Both Person and CBOCountry would be
    enhanced to PersistenceCapable objects with entries in the XML metadata
    (package.jdo) and either entries in the database or in system.prefs.
    When the schematool is run you end up with a PERSONX table in the DB and
    a CBOCOUNTRYX table in the database. The names can be tweaked if
    necessary. Each table will have a column for each persistent field in
    the corresponding object. Which fields are persistent and which are not
    are identified by defaults and by the XML metadata.
    David

  • OEPE 12.1.2.1 with Eclipse (Kepler) M2E and M2E-WTP and Seam 2 problem

    I've a JEE project with Maven 3.0.5  and JBoss Seam 2.3. I've some problems in Weblogic 12.1.2 application deployments with Eclipse.
    If I deploy the application as virtual application (split_src and .beabuild.txt), the .beabuild.txt includes the directories:
    C\:/FundeWeb/2.0/workspace/fundeweb2/web/target/m2e-wtp/web-resources = web_fundeweb2  (m2e-wtp project generated resources)
    C\:/FundeWeb/2.0/workspace/fundeweb2/web/src/main/webapp = web_fundeweb2 (project web resources)
    That's produces the next error (Multiple WEB-INF/ejb-jar.xml found):
    <01-ago-2013 14H07' CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "1375358874432" for task "1". Error is: "weblogic.application.ModuleException: Multiple WEB-INF/ejb-jar.xml found. [weblogic.servlet.internal.WarSource@19d4f67, weblogic.servlet.internal.WarSource@c7fd40]"
    weblogic.application.ModuleException: Multiple WEB-INF/ejb-jar.xml found. [weblogic.servlet.internal.WarSource@19d4f67, weblogic.servlet.internal.WarSource@c7fd40]
      at weblogic.ejb.container.deployer.EjbModuleExtensionFactory.create(EjbModuleExtensionFactory.java:26)
      at weblogic.application.internal.ExtensibleModuleWrapper.createModuleExtensions(ExtensibleModuleWrapper.java:264)
      at weblogic.application.internal.ExtensibleModuleWrapper.initDrivenObjectArray(ExtensibleModuleWrapper.java:232)
      at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:107)
      at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
      Truncated. see log file for complete stacktrace
    If I deploy the aplication in Weblogic Console with the split_src, with only the web/target/m2e-wtp/web-resources, the applications deploy succesfully.
    If I deploy de application as exploded archive, the jboss-seam.jar file isn't included in the WEB-INF/lib folder. The others jboss-seam-xxxx.jar files are included.
    In the virtual application deployments, I think that the OEPE integration with M2E and M2E-WTP, there are include only the m2e-wtp folders.

    Hi Subash,
    I tried the same installer on a 32bit machine and was able to run without any issues.
    I did however come across a few users jdeveloper users who had similar issues with the jdev installer and the following workaround seems to have solved the issue for them. coudl you try the same and let us know if that helped ?
    1. Extract "oepe-12.1.2.1-kepler-installer-win32.exe" file into C:\oepe-12.1.2.1-kepler-installer-win32
    2. In cmd go to C:\oepe-12.1.2.1-kepler-installer-win32
    3. Execute follow command:
       C:\PROGRA~1\Java\jdk1.6.0_31\bin\java.exe ( path to your JDK)  -jar install/modules/ora-launcher.jar DISKCNT=1 JRE_COMPONENT=oracle.jdk,oracle.jre
    thanks
    Raj

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • Database selection with invalid cursor !

    hi experts,
        When  execute SAP BW processchar, it occur some system error: (sm21)
    Database selection with invalid cursor
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed).
    this error occur when apply bw support package 19.
    sap notes 1118584 Solution is: Import Support Package 17 . but my support package is 19.
    how can i solve this error?
    thanks,
    xwu.

    I am only assuming things, but it might be worth to look closely if you were experiencing an ORA- error during the execution. This could have caused a rollback and thus closed the cursor. Please check the job log, the workprocess trace (dev_wX file) and the system log SM21 and ST22 as well.
    Besides that check the oracle alertlog and the usertrace destination.
    Best regards, Michael

  • Database selection with invalid cursor with MaxDB database

    Hi Experts,
    I encountered the this error:
    "Database selection with invalid cursor
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed)."
    We are using bw support package 19 early this month. Previously is working fine but this problem occured from the last 2 days.
    We are using MaxDB database.
    Really appreciate any speedy responds.

    Hi,
    We finally resolved the issue.
    The solution:
    We check the RFC connection test in SM59. There are connection error.
    There is an error that related J2EE_ADMIN user.
    SO we reset the J2EE_ADMIN id in SU01.
    The problem goes away.
    Many thanks

  • Load data error: Database selection with invalid cursor (sm21)

    hi experts,
    when I execute processchar, it occur some system error:
    "Database selection with invalid cursor ",
    "Documentation for system log message BY 7 :
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed). "
    the error msg occur when apply bw support package19.
    data from DSO to CUBE, Transferred Recodes is not zero, but Added Recodes is zero.
    Request status always yellow, process is running.
    current sys info: BI7 and BW19, BASIS17,PI_BASIS17, the database is oracle10g R2.
    thanks for your help.

    I have solved this issue, The Oracle checkpoint not complete.
    thanks,
    xwu.

  • Processchar occur error:  Database selection with invalid cursor (sm21)

    hi,
       when I execute processchar, it occur some system error:
    "Database selection with invalid cursor ",
    "Documentation for system log message BY 7 :
    The database interface was called by a cursor (in a FETCH or CLOSE
    cursor operation) that is not flagged as opened. This can occur if a
    COMMIT or ROLLBACK was executed within a SELECT loop (which closes all
    opened cursors), followed by another attempt to access the cursor (for
    example, the next time the loop is executed). "
    the error msg occur when apply bw support package19.
    data from DSO to CUBE, Transferred Recodes is not zero, but Added Recodes is zero.
    Request status always yellow, process is running.
    current sys info: BI7 and BW19, BASIS17,PI_BASIS17, the database is oracle10g R2.
    thanks for your help.

    I have solved this issue , The Oracle checkpoint is not complete.
    thanks,
    xwu.

  • Database selection with Invalid Cursor error in RSDRI_INFOPROV_READ

    Hi Everyone.
    I am using RSDRI_INFOPROV_READ Function module for reading data from a multiprovider.
    Logic of the code is as following
    while <more data>
    CALL RSDRI_INFOPROV_READ reading data in E_T_DATA
    Append lines of E_T_DATA to EO_T_DATA.
    If total lines of data in EO_T_DATA > 200000
    <save EO_T_DATA in a file using GUI_DOWNLOAD>
    <clear EO_T_DATA>
    EndIF
    EndWhile.
    As soon as number of record exceed 200000 first file is saved, but after that next data call results in error.
    Error says "Database selection with invalid cursor".
    I suspect that this because of call to FM GUI_DOWNLOAD. While calling this FM after RSDRI_INFOPROV_READ causes system to commit and again the cursor is tried to open in next call casuing it to fail.
    But it is imperative for me to save data in file at regular intervals as data volume is huge.
    Any pointers in this direction will be helpful.

    Hi Everyone.
    I am using RSDRI_INFOPROV_READ Function module for reading data from a multiprovider.
    Logic of the code is as following
    while <more data>
    CALL RSDRI_INFOPROV_READ reading data in E_T_DATA
    Append lines of E_T_DATA to EO_T_DATA.
    If total lines of data in EO_T_DATA > 200000
    <save EO_T_DATA in a file using GUI_DOWNLOAD>
    <clear EO_T_DATA>
    EndIF
    EndWhile.
    As soon as number of record exceed 200000 first file is saved, but after that next data call results in error.
    Error says "Database selection with invalid cursor".
    I suspect that this because of call to FM GUI_DOWNLOAD. While calling this FM after RSDRI_INFOPROV_READ causes system to commit and again the cursor is tried to open in next call casuing it to fail.
    But it is imperative for me to save data in file at regular intervals as data volume is huge.
    Any pointers in this direction will be helpful.

Maybe you are looking for

  • Is this a problem or is it just normal?

    I recently got speakers for my ipod and yesterday went I plugged my ipod into the speakers it was really quiet and crackly. Is this the speakers or the ipod? Also. My click wheel hasnt seemed to be functioning properly. It seems to be sticking. Is th

  • Safari keeps reverting to old bookmarks

    I learned to replace the Library/Safari/bookmarks.plist  with one from my Time Machine. It works, but only temporarily. Every few days, it reverts back to the same old ancient set of bookmarks !!!   Do I need to replace something else ??

  • How to Identify incoming and outgoing IDOC in the system for last one year.

    Dear All, How to Identify incoming and outgoing IDOC in the system for last one year. Regards Ashok

  • MSSQL driver: getInt() and getResultSet() are mutually exclusive?

    Hello, I have a problem with a stored procedure which returns out parameter (integer) and a result set produced by "select" sql. If i'm doing sth.registerOutParameter(1, Types.INTEGER); sth.execute(); sth.getInt(1); following while (true) { ResultSet

  • Flash tutorial for BPEL and ESB stuff

    Hi Thank you for reading my post is there any flash tutorial for BPEL and ESB support of Jdeveloper ? something step by step which helps me to learn these features of jdeveloper. thanks