Mq4.2 with mySQL datasource

Dear Experts,
My company are using MQ3.6SP4 enterprise version with two broker configuration without message level HA. We would like to migrate to MQ4.2 with MySQL datastore.
I have two approaches on MySQL implementation.
1. two MySQL server with master master replication. One broker connect to one MySQL.
2. MySQL cluster implementation.
my questions:
1. what is the pros and cons for this two approaches?
2. is there any performance issue?
3. what is best practice?
Many many thanks for your advise.
Regards,
Angus

Hello Angus,
Our recommendation is to use MySQL Cluster because it has been tested with OpenMQ.
Please note that if the database instances are separate, HA will not function correctly. For HA, all the brokers in the cluster share the same table schema so when one broker node fails, the data that are owned by the {color:#ff0000}*down*{color} broker are taken over by one of the remaining active brokers and service continues.
For additional, see [Set Up High-Availability Open MQ with MySQL Cluster|http://wiki.glassfish.java.net/attach/OpenMQJDBCQuestions/OpenMQ_MySQLCluster_Setup_Guide.html|Set Up High-Availability Open MQ with MySQL Cluster].
Hope this help!
~Phuong

Similar Messages

  • Problem running Page with MySQL DataSource

    Hi All,
    Jdev Version 11.1.1.6.0
    I have created a MYSQL Datasource (Datasource got created successfully and tested). The issue is when I am running a jspx page, I am getting below exception.
    java.lang.NoClassDefFoundError: com/mysql/jdbc/MySQLConnection
    I have provided the Class path in Weblogic - Servers - DefaultServer- Server Start tab like C:\Users\jars\Downloads\mysql-connector-java-5.1.25\mysql-connector-java-5.1.25
    But still I am getting this exception. I didn't got any issue when I created a MYSQL connection, and provided Driver Class path.
    Any pointer, what I am missing here.
    Thanks
    AP

    Hi Suresh,
    Thanks for the post. Well there are 2 thing which I require to understand.
    1. We can create MYSQL connection using Jdev and set the classpath which is provided in post. It worked fine.
    2. We can create datasource of MYSQL connection and use it in our Model Project. Here I am struck and giving this exception when running.
    Since it Enterprise Application, creating Datasource is generic way to connecting. I am facing issue after creating datasource. I tried above approaches, but getting exception.
    Can you help me in understand, what is going wrong in step 2.
    Thanks, AP

  • About using hibernate with mysql

    hi all,
    i have used hibernate with hsqldb(database given by default) and it works fine.but when i tried to use it with mysql then i have encountered a problem
    xception
    org.hibernate.TransactionException: Transaction not successfully started
         org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
         events.EventManagerServlet.doGet(EventManagerServlet.java:63)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    though i have put jar file of mysql in lib directory and changed the driver name in hibernate.cfg.xml.
    can any one place some example illustrating the steps involving.thanx

    Hi smogura,
    Thanks for the message. Ok I did as you told. I believe I went to the right place:
    Resource->JDBC Connection pools. However I wasn't sure how exactly to go about setting connection pools,
    so I went to the web and did a search and I managed to get hold of this
    website:http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-
    glassfish-application-server/
    I followed from steps 4 onwards. However at step 14, I did not get a sucesfull ping. The values I used are as follows:
    General:
    Name:               MySQL
    Datasource Classname:     com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Resource Type:           javax.sql.ConnectionPoolDataSource
    Advanced Properties:
    databaseName:      ebooking
    ServerName:     GlassFish
    URL          jdbc:mysql://localhost:3306/ebooking
    password          *****
    user:          1234
    I am not sure what is wrong, by the way, I am using Glassfish V3 that comes bundled with netbeans. Any idea what's wrong or missing? Thanks
    regards

  • Database connectivity in struts with mysql

    Hi,
    I want to database connectivity in struts with mysql in struts-config.xml file. I have give the code in struts-config.xml file is given below...................
    <data-sources>
    <data-source key="dbname" type="org.apache.commons.dbcp.BasicDataSource" >
    <set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
    <set-property property="url" value="jdbc:mysql://localhost:3306/antrowinnovation" />
    <!-- <set-property property="username" value=""/>
    <set-property property="password" value="indra" /> -->
    </data-source>
    </data-sources>
    And give the code in Action class is given below...
         int i=0;
         Connection con;
         Statement stmt;
              DataSource dataSource = (DataSource)servlet.getServletContext().getAttribute("dbname");
              System.out.println(dataSource);
         try{
              System.out.println("Database connecting....");
                   con=dataSource.getConnection();
              stmt=con.createStatement();
              System.out.println("Database connected....");
                   i=stmt.executeUpdate("insert into login values('" + username + "','" + password + "')");
                   System.out.println("Values inserted....");
                   }catch(Exception e){
                        System.out.println(e.getMessage());
                        System.out.println("Exception in try");
                        e.printStackTrace();
              return 0;
    But when i have run this then i got this Exception....
    INFO: Initialize action of type: login.LoginAction
    null
    Database connecting....
    null
    Exception in try
    java.lang.NullPointerException
         at login.LoginAction.insertUser(LoginAction.java:27)
         at login.LoginAction.execute(LoginAction.java:47)
         at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
         at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
         at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:743)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Plz help me..

    Read some Struts tutorial.

  • Problem in creating a CMP bean with MySql

    Hi,
    I am using lomboz eclipse, jboss 4.0.2, xdoclet 1.2.3 & DB as MySql 5.0. I am encountering a very strange problem when I try to create a CMP with MySql as DB. After entering relevant information about the datasource & testing the connection & finding it to be successful, I get the error in lomboz eclipse as : CMP has no attributes. Moreover, I donot even get the table names from the schema, that was given in the datasource, with which the mapping of my CMP will be done.
    I tried using Oracle 9i. But to my wonder, I didnot experience this issue, as it gave me all the CMP atttributes mapped & also created the CMP with Oracle DB. Can anyone help me in getting this issue resloved with MySql DB?

    Yeah, the DB User permissions are found to be ok, as the test connection was successfull. I have tried for MySql 4.1 & Myql 5.0, with their respective jars & driver classes. But the result was same. Test connection is successful, but when i hit the next button to see the CMP attributes, it doesnot give me the list of tables under that schema & says that CMP has no attributes. Please help.

  • Problem configure mysql datasource

    Hi, I am trying to use mysql datasource for my application. I had configured MYSQL_DRIVER and then
    i had configured gtasappdb datasource with
       driver-class-name = com.mysql.jdbc.Driver
       url               = jdbc:mysql://localhost:3306/appdb
       alias             = appdbdatasource
    And then i tried to deploy a EJB application which uses the above 'appdbdatasource'. When the application starts
    it says cannot find 'gtasappdb' connectionfactory.
    So can anyone tell me what should be done to use mysql for my application, please

    Hello mahesh,
    There are two ways.
    1. You should add a resource reference to the ds alias in the deployment descriptor of the application component.Once you have defined the reference,use the following snippet to access the data source
    DataSource ds = (DataSource) context.lookup("java:comp/env/<res-ref-name>").
    2. If you have not defined the reference in your application, use the JNDI reference "jdbc/alias".
    Hope this helps,
    Prasad

  • Application server 9.0 with mysql

    Hello!
    I'm using glassfish with application server 9.0 and i want to connect with mysql.
    My settings are:
    datasource classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
    resource type: javax.sql.connectionpoolDataSource
    ARE OK?
    I use mysql connector 3.1.13, 5.0.2 or 3.1.13? which is correct?
    Thanks

    Hi,
    Please take a look at the following blog which talks about using mysql with Glassfish:
    http://weblogs.java.net/blog/amyroh/archive/2006/02/roller_21_on_gl_1.html
    In this example the driver that she uses is sql-connector-java-3.1.12-bin.jar
    Also, she uses the following:
    datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
    which is slightly different to the one that you are using... maybe you should try this....
    Also, please take a look at the three furum posts already raised on similar issues to this:
    http://forum.sun.com/jive/thread.jspa?threadID=102999
    Hope this helps

  • Problems creating MySQL Datasource in OC4J

    I was recently tasked with creating a MySQL datasource in my development OC4J container (running through Eclipse, but that's irrelevant). I searched for and found this page: http://www.oracle.com/technology/products/jdev/tips/duff/mysql_and_oc4j3.html which tells me how to do this.
    I searched for and found the Datasource class jar file: mysql-connector-java-3.0.17-ga-bin.jar, installing it in the ORACLE_HOME/applib directory of my container.
    I then fired up the container, and accessed the ascontrol app to add the Datasource (via Administration/JDBC options), and ran into a few problems:
    After entering the "Create Datasource" menu, I filled in the appropriate values for the JNDI name, class name of the Datasource, URL of the database, username and password. When I went to test the connection, I received an error that the Datasource class could not be created, yet in the error message it showed me where the Datasource class was (in which jar), so obviously the container knew about the jar.
    After much playing around, I determined that the ascontrol app itself was the issue. In the orion-application.xml file for the ascontrol found in ORACLE_HOME/application-deployments/ascontrol, I found the line:
    <remove-inherited name="global.libraries"/>
    in the <imported-shared-libraries> tag. This essentially means, "ignore everything in the applib directory". It seems, as the instructions in the page above state, you actually have to manually edit the data-sources.xml file in your ORACLE_HOME/config directory in order to add this datasource, as the ascontrol app is unable to do so without loading the library from applib.
    Now, I just commented out this line in the ascontrol's xml file temporarily, and was able to use the ascontrol to add the datasource, but this seems wrong. Now, finally, I can ask my questions:
    1. Is this really the preferred method for adding a MySQL datasource to an OC4J container?
    2. If not, what is?
    3. If so, why is the ascontrol crippled in this fashion, and should it be fixed so it isn't anymore?

    Tank -- we recently discovered this situation with ASC ourselves. There's some history there in that by importing the global.libraries in the past, there has been problems with some libs that ASC itself needed being overridden -- evidently some common practice with a framework we supply was to use the applib directory in this manner, which caused issues for ASC. So the solution was to remove global.libraries from ASC.
    OK so how to solve it, there's a number of options.
    1. Remove the remove-inherited libraries tag from the ASC deployment descriptor as you've identified. I actually have the ASC team checking on whether this is something they want to do in a patch release.
    2. Put the mysql driver into its own installed shared-library, then import that into each app that needs it. And add it to ASC as an imported-shared-library. That way the same code-source is available in each location. I'd have to say this is probably the preferred option at this point.
    3. Put the mysql jar file into both the j2ee/home/applib directory AND the web-inf/lib directory of the so both apps have at it. This introduces an abstract dependency, which may cause issues if you update one but not the other at some future point. But it should work.
    cheers
    -steve-

  • How connect with mysql 5

    hi master
    sir i am use studio creator now i install the mysql5
    sir please give me idea how i connect my studio creator with mysql 5
    thank
    aamir

    hi
    follow the following steps:
    1) Download Jconnector Driver for java from www.mysql.com
    2) Open the creator , from servers palette select data source and right click.
    3) choose new data source , click new
    4) select the jar file u downloaded from the web site.
    5)clicj suggeste ( this will make the creator to select connections statments automatailcly )
    6) put the username and password and click ok
    this will make a datasource with mysql server.
    be sure that the mysql server is run,, and make sure that u apply right username and password
    Hope this will help
    Good luck
    Mohammed

  • Mysql datasource and WebDynpro

    Hello all!
    I'm new at WD and NW features and I'm trying to figure out the best way to access an external Mysql database with webdynpro.
    I already configured an external mysql datasource at NW CE and it's working fine.
    My doubt is about how I'm going to access this datasource in NWDS? Do I need to create a new Dictionary? How does it work? How do I link this datasource with my WebDynpro project?
    And about the persistence? Must I use JPA, EJB? How do I do it?
    Is there any article about this?

    Hi,
    there are already a lot of examples in the forum of how to connect MySql db with the portal.
    Here is a simple solution:
    If you have already created a datasource:
    try {
                   InitialContext initialContext = new InitialContext();
                   DataSource dataSource = (DataSource)initialContext.lookup("jdbc/YOUR_DB_ALIAS");
                   connection= dataSource.getConnection();
              } catch (SQLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    And you must change YOUR_DB_ALIAS with the real alias name. That is all if you have already created a datasource.
    About what to use: you can use whatever you want. This is just a simple example of how to get your db connection. After that you can do whatever you want with it.
    You can write your one db engine if you want:
                            PreparedStatement stmt = connection.prepareStatement("insert into simple_table simple_values(?)");
                   stmt.setString(1, "Hello world");
                   stmt.execute();
    Or you can use JPA, JDO, EJB, etc... It depends only on your decision. All of them will work.

  • ACS with MySQL

    Hi, Is it possible to use ACS with mySQL database?
    regards
    Steffen

    Depends on what you mean.
    The ODBC Authenticator (that is authenticate users against an external ODBC datasource) should work fine with mySQL. There is a white paper I wrote still kicking about on CCO somewhere if you search for it.
    If you mean can you use mySQL for ACSs own internal database.. then no you cant.
    Darran

  • Fill Grid with external datasource

    Someone to loaded data from external database to a grid in SAP BO with SDK
    I need to show data from a external system with MySQL to transfer the purchase orders to SAP
    Best Regards
    Claudio

    Here's a little piece of code to work with.  You have to code your part for loading for your datasource and then pass the value to each UserDataSource.
    Try
        Dim oForm As SAPbouiCOM.Form
        Dim oMatrix As SAPbouiCOM.Matrix
        'Load your Data on a DataSet or other DataSource method
        oMatrix.Clear()
        For Each oColumn As SAPbouiCOM.Column In oMatrix.Columns 'Bind your columns
            Dim strColumn As String = Replace(Replace(oColumn.UniqueID, "U_", ""), "UD", "")
            If oColumn.UniqueID = "#" Or Left(oColumn.UniqueID, 2) = "V_" Then
            Else
                Try
                    oForm.DataSources.UserDataSources.Item("UD" & Replace(strCOlumn, "U_", ""))
                Catch ex As Exception
                    Select Case rst.Fields.Item(strCOlumn).Type
                        Case SAPbobsCOM.BoFieldTypes.db_Alpha : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_SHORT_TEXT, rst.Fields.Item(strCOlumn).Size)
                        Case SAPbobsCOM.BoFieldTypes.db_Memo : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_LONG_TEXT, rst.Fields.Item(strCOlumn).Size)
                        Case SAPbobsCOM.BoFieldTypes.db_Date : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_DATE, rst.Fields.Item(strCOlumn).Size)
                        Case SAPbobsCOM.BoFieldTypes.db_Float
                            Select Case rst.Fields.Item(strCOlumn).SubType
                                Case SAPbobsCOM.BoFldSubTypes.st_None : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_QUANTITY, rst.Fields.Item(strCOlumn).Size)
                                Case SAPbobsCOM.BoFldSubTypes.st_Measurement : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_MEASURE, rst.Fields.Item(strCOlumn).Size)
                                Case SAPbobsCOM.BoFldSubTypes.st_Percentage : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_PERCENT, rst.Fields.Item(strColumn).Size)
                                Case SAPbobsCOM.BoFldSubTypes.st_Price : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_PRICE, rst.Fields.Item(strColumn).Size)
                                Case SAPbobsCOM.BoFldSubTypes.st_Quantity : oForm.DataSources.UserDataSources.Add("UD" & Replace(strColumn, "U_", ""), SAPbouiCOM.BoDataType.dt_QUANTITY, rst.Fields.Item(strCOlumn).Size)
                                Case SAPbobsCOM.BoFldSubTypes.st_Rate : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_RATE, rst.Fields.Item(strCOlumn).Size)
                                Case SAPbobsCOM.BoFldSubTypes.st_Sum : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_SUM, rst.Fields.Item(strCOlumn).Size)
                            End Select
                        Case SAPbobsCOM.BoFieldTypes.db_Numeric : oForm.DataSources.UserDataSources.Add("UD" & Replace(strCOlumn, "U_", ""), SAPbouiCOM.BoDataType.dt_SHORT_NUMBER, rst.Fields.Item(strCOlumn).Size)
                    End Select
                End Try
                oColumn.DataBind.SetBound(True, "", "UD" & oColumn.UniqueID)
                oForm.DataSources.UserDataSources.Item("UD" & Replace(strCOlumn, "U_", "")).Value = ""
            End If
        Next
        For i As Int32 = 1 To rst.RecordCount    'load your data here
            For Each oColumn As SAPbouiCOM.Column In oMatrix.Columns
                If oColumn.UniqueID = "#" Or Left(oColumn.UniqueID, 2) = "V_" Then
                    'do nothing
                Else
                    If Len(oColumn.DataBind.Alias) > 0 Then
                        Select Case rst.Fields.Item(strFieldName).Type
                            Case SAPbobsCOM.BoFieldTypes.db_Date
                                oForm.DataSources.UserDataSources.Item(oColumn.DataBind.Alias).Value = rst.Fields.Item(strFieldName)
                            Case Else
                                oForm.DataSources.UserDataSources.Item(oColumn.DataBind.Alias).Value = rst.Fields.Item(strFieldName).Value
                        End Select
                    End If
                End If
            Next
            oMatrix.AddRow(1)
            oMatrix.SetLineData(i)
            rst.MoveNext()
        Next
    Catch ex As Exception
        SBO_Application.MessageBox("Error on column : " & " - " & ex.Message)
    End Try

  • Help - JSC to Tomcat with MySql

    I built a simple test app in JSC with MySql.
    Product: MySql Ver. 5.0.27-community-nt
    Database name: Test
    Table name: testtable
    Datasource name: MySql1
    Dataprovider's SQL: SELECT ALL testtable.code, testtable.name FROM testtable WHERE testtable.name LIKE ?
    The page had a textfield, button, statictext and a table mapped to the dataprovider
    The following code was included:
    public void prerender() {
    try {
    String s = "";
    String t = (String) textField1.getText();
    if (t == null || t.equals(""))
    s = "";
    else
    s = t;
    s += "%";
    staticText3.setText(s);
    getSessionBean1().getTesttableRowSet().setObject(1,s);
    getSessionBean1().getTesttableDataProvider().refresh();
    } catch (Exception e) {error(e.toString());}
    public String button1_action() {
    return null;
    When tested in JSC, it worked fine.
    But when I exported it as a war file and deployed it in Tomcat 5.5.17 with the following settings, the statictext
    displayed the selected value, but the table showed "No items found". Please help.
    User: root
    password: adminadmin
    Connector downloaded: mysql-connector-java-5.0.4.zip
    The appropriate jstl.jar and standard.jar where used by copying them from jakarta
    The tomcat's server.xml used is shown below:
    <?xml version="1.0" encoding="UTF-8"?>
    <Server>
    <Listener className="org.apache.catalina.core.AprLifecycleListener"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
    <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
    <GlobalNamingResources>
    <Environment
    name="simpleValue"
    type="java.lang.Integer"
    value="30"/>
    <Resource
    auth="Container"
    description="User database that can be updated and saved"
    name="UserDatabase"
    type="org.apache.catalina.UserDatabase"
    pathname="conf/tomcat-users.xml"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
    <Resource
    name="jdbc/Travel"
    type="javax.sql.DataSource"
    driverClassName="org.apache.derby.jdbc.ClientDriver"
    password="travel"
    maxIdle="2"
    maxWait="5000"
    validationQuery="select * from TRAVEL.PRODUCT"
    username="travel"
    url="jdbc:derby://localhost:21527/samp"
    maxActive="4"/>
    </GlobalNamingResources>
    <Service
    name="Catalina">
    <Connector
    port="8080"
    redirectPort="8443"
    minSpareThreads="25"
    connectionTimeout="20000"
    maxThreads="150"
    maxSpareThreads="75">
    </Connector>
    <Connector
    port="8009"
    redirectPort="8443"
    protocol="AJP/1.3">
    </Connector>
    <Engine
    defaultHost="localhost"
    name="Catalina">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
    <Host
    appBase="webapps"
    name="localhost">
    <Context
    path="/TomTest">
    </Context>
    <Context
    path="/TradeMeTender">
    <Resource
    auth="Container"
    description="Creator generated DataSource Reference"
    name="jdbc/Travel"
    type="javax.sql.DataSource"
    driverClassName="org.apache.derby.jdbc.ClientDriver"
    password="travel"
    maxIdle="2"
    maxWait="5000"
    validationQuery="SELECT * from TRAVEL.PRODUCT"
    username="travel"
    url="jdbc:derby://localhost:21527/sample"
    maxActive="4"/>
    </Context>
    <Context
    path="/FileUploadExample">
    <EJB
    home="greeting.GreeterHome"
    name="GreeterEJB"
    remote="greeting.Greeter"
    type="Session"/>
    </Context>
         <Context path="/MySqlTest" docBase="MySqlTest"
         debug="5" reloadable="true" crossContext="true">
              <Resource name="jdbc/MySql1" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="root" password="adminadmin" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/Test?autoReconnect=true"/>
         </Context>
    </Host>
    </Engine>
    </Service>
    </Server>

    You could track JDBC calls and the SQL's executed by the driver at the database,
    Update you datasource, DBURL with some parameters/properties to generate some info for debugging like this:
    jdbc:mysql://$hostname:$port/$databasename?autoGenerateTestcaseScript=true&dumpQueriesOnException=true
    Check out your deployment containers log to find out which particular SQL statement is being executed. This could help in identifying performance issues with application. That could possibly give a clue, if something is not working in your application.
    For designtime JDBC calls made, this info is sent to IDE log.
    Reference: http://dev.mysql.com/doc/refman/5.0/en/cj-configuration-properties.html
    HTH,
    Sakthi

  • Problem with USERNAME & PASSWORD creation--JDBC connection with MYSQL

    How to connect to JDBC with Mysql Connector
    i installed mysql & created table, it works fine
    During Password---> I gave it as tiger , no username
    i installed mysql connector
    i saved the .jar file path in class path
    HOW TO CREATE USERNAME & PASSWORD & DATASOURCE NAME ---> Is it the password -tiger or something else like (ADMinstrative tools-ODBC-services--etc )
    Pl, help,
    tks
    Xx

    How to connect to JDBC with Mysql Connector
    i installed mysql & created table, it works fine
    During Password---> I gave it as tiger , no usernameTiger? This ain't Oracle.
    I think you should give a username and password. How can it look up a password without a username? Better GRANT the right permissions, too.
    Read the MySQL docs a bit more closely. Your path isn't the way to go.
    %

  • JRC bug: apostrophe in string parameter passed to Crystal Report with Command datasource to SQL Server

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

    Post Author: nl11087
    CA Forum: JAVA
    A single quote/apostrophe in string parameter passed to a Crystal Report with Command datasource connecting to a SQL Server database, using sqljdbc driver does not escape the special character correctly. When doing a preview in the Crystal Reports IDE it allows you to escape the input parameter as expected and work correctly, but through the JRC component it fails. For string parameters without special sql server characters I experience no problems at all. When replacing the Command with a direct table there is also no problem.
    Reproduction:
    1. create a database db1, create a table table1 with a String type column col1.
    2. Create new report Report1.rpt, create a connection to above, Add Command using 'SELECT col1, col2, col3 FROM table1 WHERE col1 = '{?Par1}' . Add a parameter field Par1 : String
    3. In your java stand alone application using JRC add the parameter Par1 with a value "Jon Doe's Value" containing a single apostrophe. Export to PDF. (I also tried MSWord and this failed too, similar behavior). Additionally, in another test try to replaceAll("'","''") to escape it, preventing the code to break, but now it does not retrieve the expected row anymore and you end up with an empty report.
    Exception StackTrace:
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.if(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.l.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.<init>(Unknown Source)
    at com.crystaldecisions.reports.formatter.formatter.e.p.a(Unknown Source)
    at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
    ... 17 more
    Caused by: com.crystaldecisions.reports.dataengine.be: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.nr(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
    at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
    at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
    at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
    ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.n: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.reportdefinition.datainterface.p.a(Unknown Source)
    ... 35 more
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Incorrect syntax near 's'.
    at com.crystaldecisions.reports.queryengine.driverImpl.o.eC(Unknown Source)
    at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.ea(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.h(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ap.dV(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ax.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.if(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.bc.do(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cy(Unknown Source)
    at com.crystaldecisions.reports.queryengine.ae.cz(Unknown Source)
    at com.crystaldecisions.reports.queryengine.b1.bc(Unknown Source)
    ... 36 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 's'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
    ... 48 more
    - JRCAgent3 detected an exception: An error occured while exporting the report
    at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)

Maybe you are looking for