5 Replies Latest reply on Aug 5, 2009 9:52 PM by thachduong

    Configuring a connection to MySQL


      I have installed lcds es trial version 2.6.1 with tomcat option. When I run the test of the installation it works OK.

      Now I want to make a connection to a MySQL database to access it through a flex program with data service.  The first thing I'm doing is preparing a folder where define the connection.  I copied the c:\lcds\tomcat\webapps\lcds in C:\lcds\tomcat\webapps\foed, assuming that with this there shouldn't be a problen.  Then, when I run lcds with tomcat appears errors.  When I follow creating the options in the data-management-config.xml its turns worst.

      I'm looking for a way to connect lcds to MySQL but I can't find it.  I need help configuring the access to MySQL.



        • 1. Re: Configuring a connection to MySQL
          thachduong Level 1

          anyone can help ? i have the same problem

          • 2. Re: Configuring a connection to MySQL



            you can not access the MySQL database directly with flex (like php).

            You need to access it via a Java Assember (Custom, SQL, Hibernate, Fiber Assembler) that transfers the data via AMF  ( with BlazeDS/LCDS) to Flex.


            So how do you want to access the data, with BlazeDS, with LCDS

            and which assembler do you want to use: SQL Assember,  Hibernate Assember, Fiber Assembler ...?


            Martin Zach

            • 3. Re: Configuring a connection to MySQL
              thachduong Level 1

              Hi, i'd like to use Hibernate Assember  and Fiber. And now my LCDS's connected to

              MySQL, but i don't know how to use Hibernate Assember, can u help me. Sory

              for my Bad English, i come from VietNamese.

              • 4. Re: Configuring a connection to MySQL
                ma.tze Level 1



                there is a nice example of hibernate in the lcds-examples. They are created with the setup with tomact.


                There are several tutorials, google for "Hibernate Flex", for example:



                The hibernate.cfg.xml for MySQL ist attached below.


                Fiber is only part of the new lcds3b1 and Flashbuilder 4b1:

                There are nice tutorials under



                If you look for very simple connection to mysql you can take a look at




                All the best!


                Martin Zach


                <?xml version='1.0' encoding='utf-8'?>
                <!DOCTYPE hibernate-configuration PUBLIC
                        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"




                        <!-- Database connection settings -->
                        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
                        <property name="connection.url">jdbc:mysql://localhost:3306/databasename</property>
                        <property name="connection.username">user</property>
                        <property name="connection.password">password</property>


                        <!-- JDBC connection pool (use the built-in) -->
                        <property name="connection.pool_size">2</property>


                        <!-- SQL dialect -->
                        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>


                        <!-- Enable Hibernate's automatic session context management -->
                        <property name="current_session_context_class">thread</property>


                        <!-- Disable the second-level cache  -->
                        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>  
                        <!-- Echo all executed SQL to stdout -->
                        <property name="show_sql">true</property>


                        <!-- XML Mapping Load the database table mapping file -->
                      <mapping resource="flex/samples/contact/Contact.hbm.xml"/>
                <!--        <mapping resource="flex/samples/person/Person.hbm.xml"/>-->


                        <!-- Annotations Mapping-->
                <!--        <mapping class="flex.samples.contactannotate.Contact"/>-->





                • 5. Re: Configuring a connection to MySQL
                  thachduong Level 1

                  I Think if using LCDS 3 , Fiber is no1. Because it's easy , visualization and commercial .Now, i'm trying to intergrate BlazeDS + Spring + Hibernate + MySQL (100% OpenSource). I have already configured BlazeDS 3.2 + Spring 3.M3 + MySQL and i don't know how to config Hibernate to work with them. Can u help me?