Using MySQL database in Jdeveloper

I am using MySQl database in my applicaion.I have successfully created connection to the database and have created entity beans from the tables and a session bean as well to use the entity beans
now when i am trying to call persistEntity(object obj) of session bean, basically to insert records into tables.
i am getting following exception :
Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"tdmce_approval_status" (APPROVALLEVEL, DOCREFNO, STATUS, COMMEError Code: 1064
Call:INSERT INTO "tdmce_approval_status" (APPROVALLEVEL, DOCREFNO, STATUS, COMMENTS, DMCETYPE, ACTIONDATE) VALUES (?, ?, ?, ?, ?, ?)
     bind => [1, 12355, Approved, abcd, import, 12/03/2008]
i believe this insert query is automatically generated by Jdeveloper. have tried executing the same query in sql sheet it has worked perfectly fine.
Can any one please suggest on this ?

Hi Frank,
thanks for your response, there are only setters & getters method in my entity
my entity look like this
package buslogic;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
@Entity
@NamedQuery(name = "TdmceApprovalStatus.findAll",
query = "select o from TdmceApprovalStatus o")
@Table(name = "\"tdmce_approval_status\"")
@IdClass(TdmceApprovalStatusPK.class)
public class TdmceApprovalStatus implements Serializable {
@Column(nullable = false)
private String actiondate;
@Id
@Column(nullable = false)
private Integer approvallevel;
private String comments;
@Column(nullable = false)
private String dmcetype;
@Id
@Column(nullable = false)
private String docrefno;
@Id
@Column(nullable = false)
private String status;
public TdmceApprovalStatus() {
public String getActiondate() {
return actiondate;
public void setActiondate(String actiondate) {
this.actiondate = actiondate;
public Integer getApprovallevel() {
return approvallevel;
public void setApprovallevel(Integer approvallevel) {
this.approvallevel = approvallevel;
public String getComments() {
return comments;
public void setComments(String comments) {
this.comments = comments;
public String getDmcetype() {
return dmcetype;
public void setDmcetype(String dmcetype) {
this.dmcetype = dmcetype;
public String getDocrefno() {
return docrefno;
public void setDocrefno(String docrefno) {
this.docrefno = docrefno;
public String getStatus() {
return status;
public void setStatus(String status) {
this.status = status;
& session bean class to call the same
package buslogic;
import buslogic.persistance.TdmceApprovalsFlow;
import buslogic.persistance.TdmceApprovalsFlowPK;
import buslogic.persistance.TdmceUserDetails;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Stateless(name = "FirstCheckFacade")
public class FirstCheckFacadeBean implements FirstCheckFacade {
@PersistenceContext(unitName = "SOAServices")
private EntityManager em;
public FirstCheckFacadeBean() {
public Object mergeEntity(Object entity) {
return em.merge(entity);
public Object persistEntity(Object entity) {
em.persist(entity);
return entity;
/** <code>select o from TdmceApprovalsFlow o</code> */
public List<TdmceApprovalsFlow> queryTdmceApprovalsFlowFindAll() {
return em.createNamedQuery("TdmceApprovalsFlow.findAll").getResultList();
public void removeTdmceApprovalsFlow(TdmceApprovalsFlow tdmceApprovalsFlow) {
tdmceApprovalsFlow =
em.find(TdmceApprovalsFlow.class, new TdmceApprovalsFlowPK(tdmceApprovalsFlow.getApprovallevel(),
tdmceApprovalsFlow.getDmcetype()));
em.remove(tdmceApprovalsFlow);
/** <code>select o from TdmceUserDetails o</code> */
public List<TdmceUserDetails> queryTdmceUserDetailsFindAll() {
return em.createNamedQuery("TdmceUserDetails.findAll").getResultList();
public void removeTdmceUserDetails(TdmceUserDetails tdmceUserDetails) {
tdmceUserDetails =
em.find(TdmceUserDetails.class, tdmceUserDetails.getUserid());
em.remove(tdmceUserDetails);
Where else can i look for the query?or for mysql i have to configure some property.

Similar Messages

  • Try to use Mysql database with forte

    Dear All:
    As title said, I try to use Mysql database with forte.
    I read the manual , it said I have to put the database jdbc driver in
    the Forte for Java lib/ext directory.
    I did it and then add a new Driver in the Runtime tab in the Explorer
    window .
    But when I try to test this new driver(by Right-clicking on the driver
    or connection in the Explorer and select Test Driver from the context
    menu),it said "cannot find driver class: check your CLASSPATH or
    \lib\ext direectory".
    I am sure I'hve put the driver class(with the whole directory structure)
    in that folder.
    Does anyone what I may go wrong ?
    Could you please give me some advices that I can fix this problem ?
    Thanks in advance.
         Ken @ Taipei , Taiwan , Asia

    You should have put the jar file that contains the driver into that directory. If you unpacked the jar file and put the individual classes into that directory, it will not work.

  • How to create ssas cube by using MySQL Database

    please tell me step by step process to create ssas cube by using MySQL database in my system, i have Sqlserver 2008 enterprise edition and MySql5.0

    There is an OLEDB provider for MySQL which you can get from here
    https://cherrycitysoftware.com/ccs/Providers/ProvMySQL.aspx otherwise you can also use SSIS to push the data straight into the Analysis Services database without needing to stage it in SQL Server. Also, as you can load data into AS using XMLA you could
    also write your own loader to extract data using ODBC and push it into AS using XMLA, essentially what I suspect SSIS does. However those latter solutions don't allow you to create a database on top of MySQL because you need an OLEDB (or .net) provider for
    that.
    In the simplest case, install the OLEDB provider and then in AS create a Data Source connection using that provider. Once you have done that you should be able to create a Data Source View using that connection enabling you to import the schema definitions
    for the tables/views in the MySQL database. From there you build dimensions and cubes etc. about which there is plenty of information on the web.
    http://bi-logger.blogspot.com/

  • CONNECTING TO MySql DATABASE FROM Jdeveloper

    Hi,
    How can i connect to MySql database form Oracle Jdeveloper version 11.1.2.0.0.
    I was trying to create connection using create database connection dialog box but it is giving this error:
    Test failed: Driver class not found.
    Verify the Driver location
    Please can I get step by step procedure on how to create this connection.
    Thanks.

    Connect JDeveloper to a MySQL database - YouTube
    http://people.cis.ksu.edu/~hankley/d764/tut06/Ross_mySQL/mySQL.htm
    Hil &amp;amp; Co IT Solutions: Connecting to MySQL in JDeveloper

  • Question:How to use MySQL database as a service in Oracle Cloud

    Hello All,
    I want to use MySQL as backend for my application.How can i select MySQL database.Its showing me only to choose Oracle database.
    Thanks in advance.

    The Oracle Database Cloud Service uses the Oracle Database.  You do not have access to the underlying operating system to make the choice you are seeking.
    When the Oracle Compute Service comes out later this year, you could use one of those "infrastructure only" environments and load MySQL into it.  You would be responsible for all maintenance of MySQL and the environment.
    Hope this helps.
    - Rick Greenwald

  • Using mysql database on another machine without having mysql installed

    Hi...
    I was wondering whether its possible to copy a Mysql database that I have created on my machine, take it to another machine which does not have Mysql command line stuff installed and use my own JDBC connection to the copied mysql database and start manipulating my data. I don't know if this is possible or not ..
    The main purpose of doing this is I am creating a Java program which uses a Mysql database and I want to know if I give it to someone else to use it do they have to install Mysql and all the package or can they simply start using it.
    Thanks a lot
    Sassan

    masijade. wrote:
    TuringPest wrote:
    masijade. wrote:
    Sasanpad wrote:
    Hi...
    I was wondering whether its possible to copy a Mysql database that I have created on my machine, take it to another machine which does not have Mysql command line stuff installed and use my own JDBC connection to the copied mysql database and start manipulating my data. I don't know if this is possible or not ..No. Not only would it be in violation of the terms of your license, but a MySQL database is a client/server type setup. No MySQL binaries, no server, your client (jdbc) cannot connect.im just curious because im new to mysql myself, but what do you mean that its a violation of his license?
    do you mean for the commercial version?If he licenses his application under GPL, okay, no problem. Otherwise I read this quote
    Free use for those who never copy, modify or distribute. As long as you never distribute the MySQL Software in any way, you are free to use it for powering your application, irrespective of whether your application is under GPL license or not.
    to mean that you are not allowed to distribute MySQL (or any part of it, unless your application is GPL licensed) with your application, and if he distributes even just the data directory, he is distributing at least a part of MySQL.
    Other's may not see it that way, but do you want to take the chance?The critical element is the word distribute. If he tries to embed MySQL in the application he is giving to his users, he's distributing it. Hence a violation of the license. That does not in any way prevent him from including scripts that when the application is installed goes out and runs the script on the user's installation of MySQL and builds the databases and whatnot his application needs on their MySQL installation.
    Now, for the OP. If all you're keeping up with is urls and such and you don't have hundreds of them. I wouldn't bother with a db at all. a properties file would actually serve your purposes, and xml would suit just fine. Of course you'd have to have access to the file system and such but no licensing issues at all.
    PS.

  • Can we use MYSQL database with the UI5 application?

    Hey,
    I want to make an SAPUI5 application and there i have to use database to save the data.
    Then, i will retrieve the data from there. Can we use MYSQL as a database to save the data.
    If yes, then how we will retrieve the data from there?
    Regards
    VAIBHAV JAIN

    Hi Yury,
    There's a lot of new technologies in order to acchieve that. You could create this app components:
    1. Persistence layer. Hibernate/JPA connected to Relational ER Model in MySQL.
    2. Service layer. Restful Services. With Spring (Getting Started &amp;middot; Building a RESTful Web Service), Jersey (Jersey), etc.
    3. View Layer. SAPUI5. Consume your services.
    Hope this helps,
    Kind regards!

  • How to assign values to JTable using mysql database

    how to assign value to JTable using mysql...

    Search the forum. You use the values of the "ResultSet" to create a "DefaultTableModel" which you then add to the "JTable".
    I'll let you pick the search keywords to use, which I've suggested above. You can also throw in my userid if you want to specifically look for my solution.

  • Upload and Download file using MySQL database.

    Can anyone help me ....
    how to write a code to upload file to and retrieve file from MySQL database.
    The files may be .bmp , .wav, .zip, .exe and so on....
    thank you...

    Cross-posted and multi-posted.

  • SQL vi's using MySQL database?

    Is it possible to use connect to a
    MySQL data source with the SQL vi's?
    I guess that might be more of a windows
    question, but I'd like to know if anyone
    has done that.
    -H.
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    On Sat, 01 Jul 2000 10:35:48 GMT, [email protected] wrote:
    >Is it possible to use connect to a
    >MySQL data source with the SQL vi's?
    Yes, that should be possible.
    You need the MySQL ODBC driver for Win95/WinNT.
    Try this link
    http://linux.ind.ntou.edu.tw/Linux/packages/MYSQL/download_myodbc.html
    If you need more information please ask.
    Rolf

  • MySQL Connection with JDeveloper

    Hi,
    How can i retrieve records from MySQL database in JDeveloper. Is it possible to access database through Java code?
    Thanks

    HI,
    Check following will useful
    http://www.oracle.com/technetwork/developer-tools/jdev/mysql-and-bc-howto-082060.html

  • How can I use mySQL with OC4J

    Hello,
    I have standalone OC4J and I want to use mySQL database (Oracle is no problem). My data-sources.xml for application (not global data-sources) is:
    <data-sources>
    <data-source class="com.evermind.sql.DriverManagerDataSource"
         connection-driver="org.gjt.mm.mysql.Driver"
         ejb-location="jdbc/MG_DBDS"
         inactivity-timeout="30"
         location="jdbc/MG_DBCoreDS"
         name="MG_DBDS"
         password=""
         pooled-location="jdbc/MG_DBPooledDS"
         url="jdbc:mysql://127.0.0.1:3306/test"
         username="root"
         xa-location="jdbc/xa/MG_DBXADS"/>
    </data-sources>
    Deploy return me:
    Error initializing data-source 'jdbc/MG_DBCoreDS': DriverManagerDataSource driver 'org.gjt.mm.mysql.Driver' not found
    Then I run this command:
    java -jar %OC4J_HOME%\admin.jar ormi://192.168.1.14:23791/ admin heslo -application Register -updateDataSource -oldLocation jdbc/MG_DBCoreDS -jar mysql-2.0.11-bin.jar
    this action is success and create in OC4J folder lib with jar file mysql-2.0.11-bin.
    When I use this configuration in application, I get connection but creating Statement cause SQL Exception - No suitable driver.
    When I try to restart OC4J, I get the same message as throught deploy - Error initializing data-source ...
    What is go wrong???? Could me help anyone?
    Thanks
    Libor

    pooling solution:
    1) put driver mysql.jar into any directory wich described in OC4J application.xml file like
    " <library path="D:\j2ee\home\lib">jdev-generated</library>"
    2) put a new datasource in data-sources.xml:
    <data-sources>
    <data-source name="MySqlDS"
    location="jdbc/MySqlDS"
    class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
    max-connections="100"
    min-connections="5"
    inactivity-timeout="200"
    wait-timeout="10"
    username="scott"
    password="tiger"
    url="jdbc:mysql://localhost:3306/oln?useUnicode=true"/>
    </data-sources>
    OC4J needs a special pooling class in comparision with other containers. For example, JBoss has own implementation of pooling broker, so pooling is enabled by default.

  • How make installer java with mySQL database

    How do I create a java installer for windows, because I have a project that uses mySQL database.
    Anyone please help me....

    If you have eg. a desktop application which needs a database, but don't have/ need a database server, which is accessed by several instances of the application (which seems to be the case, otherwise you wouldn't want to install it along with the application), consider an embedded database such as Apache Derby/ Java DB.
    Then all you need is to ship some jars and make sure they are on the classpath.
    If you're using JPA and generate the DB schema, then switching DB vendors should be quite easy. Just reconfigure your persistence.xml.

  • How to create table using mysql in LabVIEW

    Hii
               I am using mysql database Toolkit for my project.  In that how to New create a table. Is there any possiblilites to create a table using query...can u send a sample prg ... and inform which toolkit Vi to use....  

    The SQL syntax for creating a table is:
    CREATE TABLE table_name
    column_name1 data_type,
    column_name2 data_type,
    column_name3 data_type,
    )The toolkit has a funciton called DB Tools Create Table. That would be the obvious function to use if you don't want to execute a SQL query to create the table. The tooklit comes with examples. Have you looked at them? There's one called Create Database Table that  would seem to be exactly what you are looking for.

  • How to connected mysql database to iphone app?

    I make application which must use mysql database because my application is related to other desktop application

    If the app uses the same db as on the user's computer, you should look into using iCloud to share and sync the data. Visit the iOS Dev Center for details.

Maybe you are looking for