MySQL JNDI in JDeveloper

Hi All,
I am developing an application in struts and using JNDI for the connection string lookup. The Driver is loading up and I'm getting the data from the database at the first time, but when I try to add some new records, it doesn't do so. It neither throws any exception nor it shows any other problem. The query gets executed. I checked it with the following condition
if( preparedStatement.executeUpdate() > 0 )This condition is always evaluated to true but there is no data entered in the database. Could the problem be with the SQL syntax as JDeveloper may be using it's own SQL syntax as compared to MySQL SQL syntax.
I am totally cnofused as to why this is happening.
Can someone please help me out soon..!!
Thanks

>>
action"action1.do?method=showData&dataId=${dataList.DataId}" property="method"/>
This would not work with a Struts tag. You need to
prepare the String first and the set it in the tag. A
scriptlet would work here.The same code is working if I geenrate a war file from Eclispe and deploy it to JBoss application server. I had tried this multiple times and without even changing a single word, it works fine in JBoss. There should be some other reason or if there is a problem, there might be some solution to overcome this situation.
The JSTL is also working fine while I'm using it to populate the drop down menu.
Any idea why there is difference between application running in JBoss and in JDeveloper?
Thanks

Similar Messages

  • 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

  • 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.

  • MYSQL error in JDeveloper 10g using ADF Swing

    I am trying to update data in mysql database. But the following error appears in JDeveloper 10g using ADF Swing
    Mysql library is mysql-connector-java-3.1.12
    What is the problem ? INSERT and SELECT queries do not give errors. But UPDATE has problem.
    Thank you in advance.
    Sony Kalkan
    (oracle.jbo.DMLException) JBO-26041: Failed to post data to database during "Update": SQL Statement "UPDATE banner Banner SET imptotal=? WHERE bid=?".
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) You have an error in your SQL syntax near 'Banner SET imptotal=22 WHERE bid=1' at line 1

    After i put a jtable,navigator on the form using appmoduledatacontrol on the top-right side of the jdeveloper, i run the form. Everything goes ok listing rows of data. But the error appears when i change the value of a field on the table and updating it using navigator.
    Thank you very much.

  • 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

  • J2EE RI and MySQL, JNDI problems

    Hi.
    I am trying to write a simple J2EE application that would use Entety EJB with bean persisatance. I have downloaded driver from the www.mysql.org, copied it to the lib/system directory and modified J2EE_CLASSPATH in bin/userconfig.bat. I am using reference implementation server and with deploytool in �tools/serverconfiguration/datasourses/standard� I am specifying driver: org.gjt.mm.mysql.Driver or com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource and in datasourses in JNDI Name I write �jdbc/mydb� and in JDBC URL �jdbc:mysql://localhost:3306/this�, problem comes up when I try to reference �jdbc/mydb� from an entity bean, during deployment process of application it says that it is not bound
    Binding name:`java:comp/env/jdbc\persondb`
    Warning: Reference reference java:comp/env/jdbc\persondb is using a JNDI name that is not bound: jdbc\mydb
    I do not get it, what I am doing wrong? Please help me to find out how to bind a JNDI name to MySQL

    Ive been playing with the J2EE RI server for a bit now..
    and dispite documentation to the contrary the latest RI DOES NOT use standard naming conventions when referencing jndi resources.
    ie:
    so if you trying to get : java:com/env/jdbc/persondb
    then try accessing it by
    jdbc/persondb
    omit the java:com/env/

  • JDeveloper/MySql: 'access denied'

    I'm trying to develop a web application using JDeveloper/MySql...
    My 'try-out' servlet ends here:
    conn = DriverManager.getConnection("jdbc:mysql://localhost/eyes?user=me&password=pwd");
    saying
    "Access denied for user 'me'@'localhost.localdomain' (using password: YES) 11045 228000"
    user me has been granted 'all' and the database eyes is accessible via the commandline.
    Any help is appreciated!

    This is MySQL issue not JDeveloper.
    Anyway this problem usually occurs when:
    1. there is not localhost or hostname in "user" table (mysql).
    So check whether user table contains two rows for user, one row for "localhost" and the second row for hostname or single row where "%" (any host) is in hostname column.
    Example:
    mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1810 to server version: 4.1.5-gamma-standard
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql> \u mysql
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    Database changed
    mysql> select * from user where user = 'test2';
    | Host      | User  | Password         | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections |
    | localhost | test2 | 35a7d8163f9d93b2 | Y           | Y           | Y           | Y           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                |          |            |             |              |             0 |           0 |               0 |
    | machinename  | test2 | 35a7d8163f9d93b2 | Y           | Y           | Y           | Y           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                |          |            |             |              |             0 |           0 |               0 |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2. common mistake is when user is created and privileges granted and administrator didn't flush hosts and privileges.
    So login as root and execute "flush hosts" and "flush privileges" commands.
    Example:
    mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1812 to server version: 4.1.5-gamma-standard
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql> flush hosts;
    Query OK, 0 rows affected (0.00 sec)
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

  • Help needed on allocating a JNDI name for MYSQL on Glassfish

    Hi,
    I am trying to invoke my database (MYSQL) through a JNDI lookup on GlassFish Server. I copied the MySQL connector into the GLASSFISH_HOME/lib directory and went into Admin console (http://localhost:8080/login.jsf) to create a ConnectionPool. After this, I am not sure what I should do, inorder to associate a "jdbc/mysql" JNDI name for this pool. Can anybody point me to what has to be done?
    Thank you.

    Figured it. After you've setup your pool, you need to go to Resources -> JDBC -> JDBC Resources and then create an new mapping of the pool that you've just created to some name (ex: "java/mysql"); This should integrated Glassy with Mysql
    Thanks.

  • OC4J with MySQL please Help

    i wanna test my work with Ejb 3.0 and i want connect with MySQL
    i tested connection with MySQL database from JDeveloper
    and it successed and i created CMP from MySQL tables
    But the problem when im trying to deploy it with OC4J
    it throws an exception SQLException ( Invalid Oracle URL )
    if anybody know anything about this problem
    please help me

    thankx for help
    but it didnt work i dont know why
    i tried many way to deploy it but it stell throws exception
    << Invalid Oracle URL specifiedError Code: 17067
    >>
    this is OC4J data-sources.xml file
    <?xml version="1.0" ?>
    <data-sources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd" schema-major-version="10" schema-minor-version="1">
    <managed-data-source user="root" password="pagera" connection-pool-name="Example Connection Pool" jndi-name="jdbc/MySQLDS" name="MySQLDS" />
    <connection-pool name="Example Connection Pool">
    <connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="root" password="pagera" url="jdbc:mysql://localhost/test" />
    </connection-pool>
    </data-sources>
    and i tried it
    <data-source class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
    name="mysqlDS" location="jdbc/mysqlCoreDS" xa-location="jdbc/xa/mysqlXADS"
    ejb-location="jdbc/mysqlDS" connection-driver="com.mysql.jdbc.Driver"
    username="root"
    password="pagera"
    url="jdbc:mysql://localhost/test"
    inactivity-timeout="30" />
    but it didnt work too
    i dont know what to do.....
    if anyone has another way pls tell me

  • J2ee naming services with JDeveloper

    I am trying to use the JNDI services of the j2ee specs with JDeveloper and the Oracle Application server (9iAs). Doing this we have the problem that JDeveloper do not support the java.naming package. We have added the package to JDeveloper but we do not know ik Oracle 9iAs will work with this package added.
    Can someone give me some information about the use of JNDI within JDeveloper and Oracle 9iAs

    One solution to this problem is to make sure that the complex type you are using in yous service interface do implement the JAVA Bean as per the spec (at least Oracle's interpretation of it).
    You need to have getter/setter for all members and you need to have an empty ctor() to create new instances of your objects. In some cases, the design time let you get by, but the runtime fails in the code generation.
    In your case, the 'Task' class may have some issue.
    Hope it helps,
    -eric

  • Database synchronization with MySQL

    Hi,
    I'm connecting my ADFbc to a MySQL database v5.6; However, I can't seem to find the option that allows me to synchronize my entities to the changes made on the database tables. I am using JDeveloper 12c.
    Is the database synchronization option only available for an Oracle database connection?
    Imad.

    Imad,
    database synchronization is available.
    Zeeshan Baig's Blog: Connecting MySQL Database with Jdeveloper 11g
    Is your project migrated from a older jdev version ?

  • Reimport and Refresh Tables (MySQL DB adapter)

    Hello.
    I created DB adapter to MySQL DB in JDeveloper 11.1.1.5.
    Everytime I open Adapter Configuration Wizard on this DB Adapter I get warning: Reimport and Refresh Tables.
    "Some changes have been detected in the relational schema since these tables were imported. Please go back to the select tables page and reimport them. The changes are major enough that they can't be easily reconciled. The changes are: Table removed: ..." even there are not any changes in schema and tables still exists.
    Is it a bug or feature?
    I never saw this behaviour with Oracle DB. Is it a problem with MySQL JDBC driver?
    Thanks

    Looks like a bug to me. You should file an SR...
    Timo

  • MySQL and J2EE 1.4 AppServer

    Hi I was wondering if anyone has gotten MySQL to work with CMP EJB's on the J2EE 1.4 AppServer? This is my story so far. Using the admin console I created a new Connection Pool named MySQL, it uses the com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource class as the Datasource Classname, all other settings I left as default. I added three properties which the MySQL driver expects to be passed: username, password, and databaseName. Once this is done I can ping the MySQL server successfully. Next I add a new JDBC Resource named jdbc/MySQL. Then using deploytool I change the Sun-specific Settings CMP Resource JNDI Name to jdbc/MySQL. When I try to deploy my EJB, this is when the problem occurs. I get the following error from the server:
    -- Fatal Error from EJB Compiler -- JDO74030: JDOCodeGenerator: Caught an IOException initializing CMP code generation for application 'vwcm' module '/opt/sunappserver/domains/versaqual/applications/j2ee-modules/': JDO7001: Cannot find resource com/sun/jdo/spi/persistence/generator/database/MYSQL.properties.
    Would anyone know what to do to fix this situation?

    I am using Sun App Server 7 and I believe the same concept can be applied to J2EE 1.4. In the CMP EJBs you have create the persistence manager to persist the data with the database. The JDBC resources are for making connection to the database, not for persistence. And the cmp jdbc resource should be named as jdo/MySql rather jdbc/MySql.
    Here is how you have to provide in the sun-ejb-jar file for the CMP beans.
    <cmp-resource>
    <jndi-name>jdo/MySql</jndi-name>
    </cmp-resource>
    You should find another option in the app server configuration console for "persistence managers".
    In the persistence manager console create a new persistence manager called jdo/MySql. It will ask you the following information. (As per App server 7)
    JNDI ----- jdo/MySql
    Description ------ Provide desc
    Factory Class ------- com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl
    Connection Pool ------- Provide your connection pool from the combo box.
    A JDBC resource will be automatically created to associate the Persistence Manager run-time with the specified Connection Pool.
    Persistence Manager Enabled: (Check the check box)
    Once you submit this information, it will create a JDBC resource in the name "jdo/MySqlPM". You can check whether it is created or not under the JDBC resource link in the app server configuration console. If it is created, then you should not have any other problem.
    After performing the above steps try to deploy, which I believe you should have any problem.
    Thanks

  • Help me to remove this Error in Entity Beans

    this is the Error i am getting along with this Error i have also put my ds xml file and other related file , please help me to remove this error
    at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(Re
    flectedDispatcher.java:91)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:64)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
    ler.java:884)
    at $Proxy18.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:414)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy71.start(Unknown Source)
    at org.jboss.ejb.EjbModule.startService(EjbModule.java:367)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
    upport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
    eanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
    ler.java:884)
    at $Proxy18.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:414)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy15.start(Unknown Source)
    at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:570)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy8.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
    tScanner.java:304)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
    canner.java:460)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    doScan(AbstractDeploymentScanner.java:201)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    loop(AbstractDeploymentScanner.java:212)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    run(AbstractDeploymentScanner.java:191)
    Caused by: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml
    : datasource-mapping MySql not found
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDB
    CEntityMetaData.java:483)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init
    (JDBCApplicationMetaData.java:312)at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
    lFileLoader.java:67)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
    a(JDBCStoreManager.java:721)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
    StoreManager.java:409)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
    r.java:353)
    at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
    er.java:155)
    at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
    upport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
    eanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    ... 65 more
    11:37:34,679 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.6/server/default/d
    eploy/ProductBean.jar
    11:37:34,679 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    MBeans waiting for other MBeans:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,plugin=pool,service=EJB
    state: CREATED
    I Depend On:
    Depends On Me:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,service=EJB
    state: FAILED
    I Depend On:
    Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error
    in jbosscmp-jdbc.xml : datasource-mapping MySql not found
    Cause: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : da
    tasource-mapping MySql not found
    MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,plugin=pool,service=EJB
    state: CREATED
    I Depend On:
    Depends On Me:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,service=EJB
    state: FAILED
    I Depend On:
    Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error
    in jbosscmp-jdbc.xml : datasource-mapping MySql not found
    Cause: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : da
    tasource-mapping MySql not found
    1 ) Contain of mysql-ds.xml File
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- $Id: mysql-ds.xml,v 1.1.2.1 2003/12/12 19:19:56 starksm Exp $ -->
    <!-- Datasource config for MySQL using 3.0.9 available from:
    http://www.mysql.com/downloads/api-jdbc-stable.html
    -->
    <datasources>
    <local-tx-datasource>
    <jndi-name>MySql</jndi-name>
    <connection-url>jdbc:mysql://192.168.111.44:3306/temp</connection-url>
              <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>new_temp</user-name>
    <password>temp</password>
    </local-tx-datasource>
    </datasources>
    2) i have also add datasource mappping in standardjaws.xml and standardjbosscmp-jdbc.xml file
    File :standardjaws.xml
    <datasource>java:/MySql</datasource>
              <type-mapping>MySql</type-mapping>
         File : standardjbosscmp-jdbc.xml
         <datasource>java:/MySql</datasource>
    <datasource-mapping>MySql</datasource-mapping>

    have a look at http://www.onjava.com/pub/a/onjava/2004/02/25/jbossjdbc.html

  • How to connect database

    This is my jsp file!(
    Claims Processing: Data Entry
    Created on Apr 18, 2007
    To change the template for this generated file go to
    Window>Preferences>Java>Code Generation>Code and Comments
    package Database;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    @author Administrator
    To change the template for this generated type comment go to
    Window>Preferences>Java>Code Generation>Code and Comments
    public class DataRetriever {
         Connection connection = null;
         public DataRetriever(String jndiName) {
              try {
                   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   connection =
                        DriverManager.getConnection(
                             "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=HRMS;User=sa;Password=sa");
                   System.err.println("Database connection established AGAIN");
              } catch (Exception e) {
                   System.err.println("Cannot connect to database server - " + e);
         private void getConnection(String jndi) {
              try {
                   Context ctx = new InitialContext();
                   if (ctx == null) {
                        throw new Exception("Boom - No Context");
                   DataSource ds = (DataSource) ctx.lookup("java:comp/env/" +jndi);
                   System.err.println(jndi);
                   if (ds != null) {
                        connection = ds.getConnection();
              } catch (Exception e) {
                   e.printStackTrace();
                   connection = null;
         public ResultSet execSelectQuery(String sql) {
              try {
                   if (connection == null) {
                        return null;
                   Statement s = connection.createStatement();
                   return s.executeQuery(sql);
              } catch (SQLException e) {
                   e.printStackTrace();
                   return null;
         public int execUpdateQuery(String sql) {
              try {
                   if (connection == null) {
                        return -1;
                   Statement s = connection.createStatement();
                   return s.executeUpdate(sql);
              } catch (SQLException e) {
                   e.printStackTrace();
                   return -1;
         public void terminate() {
              try {
                   connection.close();
              } catch (SQLException e) {
                   e.printStackTrace();
    This is the servlet.
    package servlet;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import bean.createClaimsBean;
    public class CreateClaimsServlet extends HttpServlet {
    protected void doGet(
    HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(
    HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    private void processRequest(HttpServletRequest request,
    HttpServletResponse response) throws ServletException, IOException{
    String mySqlJndiName =
    this.getServletContext().getInitParameter("MySql JNDI");
    createClaimsBean cb = new createClaimsBean();
    String bd = request.getParameter("textfield1");
    String pl = request.getParameter("textfield2");
    String pa = request.getParameter("textfield3");
    String bn = request.getParameter("textfield3");
    String d = request.getParameter("D1");
    String ta = request.getParameter("textfield4");
    System.out.println("n");
    cb=cb.registerCreateClaims(bd, pl, pa, bn, d, ta, mySqlJndiName);
    request.getSession().setAttribute("registerCreateClaims", cb);
    request.getRequestDispatcher("/WEB-INF/pages/regsuccess.jsp").forward(request,
    response);
    Lastly it is the java file.
    Created on Apr 19, 2007
    To change the template for this generated file go to
    Window>Preferences>Java>Code Generation>Code and Comments
    package bean;
    import Database.DataRetriever;
    @author Administrator
    To change the template for this generated type comment go to
    Window>Preferences>Java>Code Generation>Code and Comments
    public class createClaimsBean {
         private String billDate;
         private String plans;
         private String panel;
         private String billNo;
         private String dependent;
         private String totalAmt;
         public createClaimsBean(String billDate,String plans,String panel,String billNo,String dependent,String totalAmt)
              this.billDate = billDate;
              this.plans = plans;
              this.panel = panel;
              this.billNo = billNo;
              this.dependent = dependent;
              this.totalAmt = totalAmt;
    @return
         public String getBillDate() {
              return billDate;
    @return
         public String getBillNo() {
              return billNo;
    @return
         public String getDependent() {
              return dependent;
    @return
         public String getPanel() {
              return panel;
    @return
         public String getPlans() {
              return plans;
    @return
         public String getTotalAmt() {
              return totalAmt;
    @param string
         public void setBillDate(String string) {
              billDate = string;
    @param string
         public void setBillNo(String string) {
              billNo = string;
    @param string
         public void setDependent(String string) {
              dependent = string;
    @param string
         public void setPanel(String string) {
              panel = string;
    @param string
         public void setPlans(String string) {
              plans = string;
    @param string
         public void setTotalAmt(String string) {
              totalAmt = string;
         public createClaimsBean{
         public void registerCreateClaims(String mysql, String billNo, String dependent, String panel, String plans, String totalAmt)
         DataRetriever data = new  DataRetriever(mysql);
        String sql= "INSERT INTO claims VALUES (billDate, billNo, dependent, panel, plans, totalAmt)";
        data.execUpdateQuery(sql);
        data.terminate();
    How to connect sql so that i m able to insert new data into the database?
    Message was edited by:
            fatimah rasheed

    Hi Fatimah,
    You are on the right way. You need a DataSource to get Connection to the DB and execute queries through it. Have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/15/6d56f65fb59e4db97253c89c5cfefd/frameset.htm">this</a> page for more information on setting up a reference to the DataSource from your Web application.
    The procedure for creating a custom DataSource is described <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bb/69da54d8aedc419d46d9ea074e4d41/frameset.htm">here</a>. You can also <a href="http://help.sap.com/saphelp_nw04/helpdata/en/7f/d84b25d49846819d08e1c8ba03a9cd/frameset.htm">use the default DataSource</a>.
    Hope it helps!
    -Vladimir
    PS. Don't use java.sql.DriverManager directly in a J2EE environment. It is designed for standalone usage in the J2SE environment. The recommended way for J2EE is to go through a <b>javax.sql.DataSource</b> object.

Maybe you are looking for

  • Accrual Engine- Open Item Gl Account

    Hi In case of Accrual engine , I am trying to post to target account which is Open item managed . I know system will not allow to post to OI . Is there a workaround for this ?? Regards Ram

  • JVM Crash on Linux Cron Restart.

    Our application is deployed in Jboss AS with MySql db under RedHat Linux. We scheduled a cron to restart server on everyday morning. During this time the server is not starting properly, this was not happening regularly. And the log says: # An unexpe

  • HT1918 I forget my apple Id secure question, and I can't reset it , what am I supposed to do ? Please help .....help 

    I forget my apple Id secure question, and I can't reset it , what am I supposed to do ? Please help .....help 

  • 1300 Wireless Bridge

    I have been using two 1310 wireless bridges for about six months now. They have been working very well. However this morning they stoped connecting and one says that the Software status is disabled and the hardware status is down. in the configuratio

  • Kindly write some sample code for this scenario

    Kindly write some sample code for the below Logic. For a set of Deliveries entered on the selection screen get the relevant data from LIKP & LIPS. for all the deliveries selected get the sales order data from VBAK & VBAP based on the VGBEL & VGPOS in