How to synchronize two database in ur java program

Hi All
How to synchronize two data base of mysql using java programing language?
If somebody has any idea that will help me a lot.
Thanks and regards
Srikant

Of corse I have an idea, but not good!
If you know the database stucture then copy data from one to another.
Open 2 connections: one to source and one to dest.
And:
String sql = "SELCET * from mytable1";// from source
string sql2;
Statement st1 = connSrc.createStatement();
Statement st2 = connDest.createStatement();
ResultSet rs = st1.executeQuerry(sql);
while(rs.next()){
sql2 = "INSERT INTO mytable1 ('field1', 'filed2') VALUES ("+
"'"+rs.get(filed1")+"',"+
"'"+rs.get(filed2')+"'"+
st2.executeUpdate(sql2);
// the destination was cleared before this: DELETE FROM mytable1 WHERE 1
This is a mysql sample without processing the errors.
Szabi

Similar Messages

  • How to synchronize two database

    Hi All,
    I am using oracle 10R2 in solaris 10. I am trying one scenario, but unable to come with solution. please give your suggestion.
    In machine A, I have one database called DB1 and its up and running. Now I took cold backup and created the same database in another machine called
    machine B.
    Now the database are running in both machine A & B ( both are same at present).
    Now I am going to do some changes in machine A ( create tables, add rows, delete roes, add user, etc etc etc ), Now I want to apply those changes to
    machine B on daily basis.
    I dont want to do logical standby database, because i am going to use the machine B also ( i will open always).
    Any other way to do this ???? like export or apply logs ??
    I am not sure about this
    Kindly give your suggestion.
    Regards
    Kumar

    Use Oracle Streams for updating Both Sids
    Oracle Streams, a built-in feature of the Oracle database, is a data replication and integration feature. It provides a flexible infrastructure that meets a wide variety of information sharing needs. Oracle Streams enables the propagation of data, transactions and events in a data stream either within a database, or from one database to another. Click on the following links for further details on Oracle Streams
    see this link
    http://www.oracle.com/technetwork/database/features/data-integration/index.html

  • Hi can anyone explain me how to  syncronize two database using jsp?

    Hi can anyone explain me how to syncronize two database using jsp?

    I thinking than you really need the jsp page for calling the java methods whith sincronize the database.You think wrong.
    You wrote a bad question.What was bad about it?
    You need a java method for sincronize the two databases using a jsp page.No you don't, see my answer.

  • How to synchronize two fpga DIO?

    Hi!
    I am using two FPGA 7962R (flexrio) with each 6581 terminal board in PXIe-1082 chassis. My problem is how to synchronize two 7962R digital output with PXIe-1082 chassis backplane signal Dstar* or Clk10 or DAQ signal.
    Actually I tried the synchronization with one DAQ counter clock (confering 'Gen Dig Pulse Train-Finite_NI. vi') , and get the signal PXI-Trig0 by source terminal and target terminal connection, but that one does not work properly. Especially, one trigger signal in HOST to set the starting point of each FPGA (7962R), make error by depending on the trigger signal value(Hz value and Timed loop clock in FPGA vi). It was very tricky and not reliable. (I am attaching figure files as explaining the situation)
    My aim is simply to use two FPGA 7962R Digital output as one FPGA, for controling X-axis, Y-axis with each FPGA, while able to change each FPGA (X-axis, Y axis) digital output value. Because the synchronization is not correct, X,Y axis control with Two FPGA currently is out of target if I use simply while-loop design in HOST and timed-loop design in FPGA vi. What is correct design to synchronize the two FPGA 7962R without using PFI line, only with PXIe-1082 chassis backplane signal and able to change the digital output value? Please let me know any idea for HOST vi, FPGA vi programming.
    Many Thanks
    Attachments:
    host1.png ‏47 KB
    fpga1.png ‏131 KB

    Posted response to this in the following thread:
    http://forums.ni.com/t5/Real-Time-Measurement-and/synchronization-two-fpga-7962r-digital-output/m-p/...
    Patrick H | National Instruments | Software Engineer

  • How to call SAP Webservice in standalone java program

    Hi,
    In our Java application, we want to use the SAP Webservices. I dont know much about authentication mechanism used by SAP. Can any one please help me with any sample code how to Call SAP webservice in Standalone Jave Program. I searched alot on the web regarding this, but helpless. Please help me.
    Thanks,
    Mohan

    Hi Mohan,
    You need an account for the ES Workplace. I'm afraid this is not free, e.g. check [SAP NetWeaver, Composition Subscription|https://www.sdn.sap.com/irj/sdn/subscriptions/composition].
    But I thought you wanted to play with a WSDL [you already had at hand|Sample code to access BAPI Web services from JAVA required;?

  • How to connect iseries green screen from java program

    how to connect iseries green screen from java program to get the data in the DB files ,here the DB is DB2/400

    Just some Friday fun. Use the telnet program that comes with Windows and supports VT escape sequences.
    import java.io.*;
    import java.net.*;
    public class AutoTelnet {
         private static Socket s;
         public static void main(String[] args) throws Exception {
              Thread t = new Thread() {
                   @Override public void run() {
                        try {
                             s = new ServerSocket(5555).accept();
                        } catch (IOException ex) {
                             ex.printStackTrace();
              t.start();
              Process p = new ProcessBuilder("cmd", "/C", "start", "telnet", "127.0.0.1", "5555").redirectErrorStream(true).start();
              t.join();
              PrintStream ps = new PrintStream(s.getOutputStream());
              ps.println("Screen will be cleared in 5 seconds");
              ps.println("5");
              Thread.sleep(1000);
              ps.println("4");
              Thread.sleep(1000);
              ps.println("3");
              Thread.sleep(1000);
              ps.println("2");
              Thread.sleep(1000);
              ps.println("1");
              Thread.sleep(1000);
              ps.println("\u001b[2J");
              Thread.sleep(5000);
    }

  • How to Synchronize two methods or more methods

    HI All,
    As a java starter in learning Synchronization. how simply can I Synchronize two methods
    for example I have the following.
    public class Process {          
    public static void main(String args[]){
    process1();
    process2();    
    private void process1(){
    private void process2(){
    }

    A-KADRI wrote:
    HI All,
    As a java starter in learning Synchronization. how simply can I Synchronize two methods
    for example I have the following.
    public class Process {          
    public static void main(String args[]){
    process1();
    process2();    
    private void process1(){
    private void process2(){
    You're being really ambiguous. You could "synchronize" those methods by adding the synchronized keyword to their method signature, in which case they will implicitly lock on the object they belong to. That's what most people will think you mean when you say synchronized. Is that what you meant? Or did you mean what BDLH was thinking in that you wanted to lock something, then do 1,2,3,4, then unlock it? That's something different. Be specific!

  • Using RMI to synchronize two databases

    Hello
    I have studied Java for some time, but never had
    the opportunity to work in a "real project", but
    now I have something to do...
    I have the following situation: two offices
    of a company, the central one running SQL Server
    database and other running Oracle, must change
    information, reading data from Oracle and saving in
    SQLServer and vice-versa. The programs should be
    running all day, checking at specified periods of
    time if there is some information to be updated
    in any database.
    The offices are phisically far, so it should be
    used Internet to make the connection (both sites
    are connected to Internet 24h).
    I was wondering on using the Java RMI technology
    to achieve this. I have read the official Sun
    documentation about RMI and some articles, and I
    found it very interesting, and pretty easy to
    implement.
    But I have some "real world" questions:
    - Is RMI the ideal solution for this problem, or
    there is some newer or more adequate one?
    - At first it would be a small amount of data
    to be synchronized, but if it grows a lot or
    more offices are to be connected, is RMI performance
    good? (is it quick?)
    - About security - is RMI secure? I mean, I think
    the server program should be listening a port in a
    IP address open to ALL the internet... How safe is
    the user authentication, or this is responsability of
    the application?
    - What is the relationship between RMI and proxies,
    firewalls etc? Are they compatible?
    - XML is something to think about using for this
    application, or it have nothing to do to the job?
    The initial option was using a Microsoft solution
    to make this application :(, but I would be very happy
    if I could use Java ;) , but I have to have the
    adequate technical base to suggest it...
    So, any help would be very welcome!
    Luis Cabral

    Here's a set of (some) answers based on my experience (which is NOT synchronizing two databases, but on synchronizing sets of files across a tree of file servers.)
    Hello
    1. It sounds like two databases must be cross-synchronized. You didn't say what the platforms were, but if they are mixed, then java is a positive choice.
    2. Java rmi is fine for doing this kind of work. However I can't give you any performance guarantees. You probably need to get some fine requirements and write some model programs.
    3. YOU are responsible for security. RMI gives you connectability; you have to develop some kind of cross-authentication procedure as part of you application.
    4. To work over the internet, you will have to develop some way through firewalls.
    o If the two sites use "Virtual private networks", then both the security issue and the firewall issue are mostly solved for you.
    o Otherwise, and maybe even with vpn, you will have to do a little bit of work to use fixed port numbers. (The way rmi works is that there is a listener at a fixed port which will let a remote program "look up" a local object; after that, communication takes place object-object over a randomly-assigned port.) It takes about a dozen lines of code to make this work.
    5. I don't think XML has anything to do with this problem. It MAY help you if you have serious data conversion issues. I hear it's a pig.
    Finally, an application item that may or may not be an issue: Two databases, two platforms == possible character set conversion problems.

  • How to compare two excel files in java ?

    how do i compare two excel files in java.?
    I have two excel files stored on my computer in d: drive.
    Ex:
    D:\\file a
    D:\\file b
    How to compare the contents of these two files and print " files are equal " or "files not equal "

    Javamastermahe wrote:
    I mean i want to print on the console "files are equal " or any message like " both the files match "If this is your requirement, this program satisfies it...
    import java.util.Random;
    public class SuperExcelTester {
        public static void main(String[] args) {
            Random rnd = new Random();
            String[] messages = {
                "files are equal",
                "files are not equal",
                "unexpected error"
            int index = rnd.nextInt(messages.length);
            System.out.println(messages[index]);
    }

  • How to synchronize two Event Dispatcher threads?

    I have two applications running in the same jvm. The flow should go like--
    a) First application (A1) has a swing window containing componets like buttons, text boxes etc.
    b) On click of this button, Event Dispatcher thread (T1) , calls the other application (A2).
    c) The second application A2, creates a swing window using EventQueue.invokeLater method and in the mean time Thread T1 should wait for this new A2 window to get some results from the database.
    Is it possible to stop thead T1 in between without freezing the GUI components of application A2.
    Thanks

    I think what tjacobs01 is getting at, is that there is only one Event Dispatcher Thread per JVM. So your question does not make sense. If there really is two EDT threads, then you are dealing with inter-process communication (since there would be two JVM processes, one for each application).
    It sounds like there is only one JVM, one EDT and two instances of a java.awt.Window. You probably think of the window == an application. In that case, you can probably solve your problem by executing the DB access (the long-running task) in the doInBackground() method of a SwingWorker.
    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html

  • Hibernate query...how to connect two databases...

    hi i m new to hibernate..
    i created two tables..
    1st table is catalog:
    2nd table is acctinfo
    //HBM file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="hibernate.example.Catalog" table="catalog">
    <id name="id" type="integer" column="ID">
    <generator class="increment"/>
    </id>
    <property name="journal" type="string" column="JOURNAL"/>
    <property name="publisher" type="string" column="PUBLISHER"/>
    <property name="edition" type="string" column="EDITION"/>
    <property name="title" type="string" column="TITLE"/>
    <property name="author" type="string" column="AUTHOR"/>
    <bag name="accinfo" cascade="all" >
    <key column="ID"/>
    <one-to-many class="hibernate.example.Acctinfo"/>
    </bag>
    </class>
    <class name="hibernate.example.Acctinfo" table="acctinfo">
    <id name="id" type="integer" column="ID">
    <generator class="increment"/>
    </id>
    <property name="account" type="string" column="ACCOUNT"/>
    <property name="password" type="string" column="PASSWORD"/>
    <property name="balance" type="string" column="BALANCE"/>
    </class>
    </hibernate-mapping>
    ///******************getter setter file is::****************
    package hibernate.example;
    public class Acctinfo
         int id;
         String account;
         String password;
         String balance;
         public Acctinfo()
         public void setId(int id)
              this.id = id;
         public int getId()
              return id;
         public void setAccount(String account)
              this.account = account;
         public void setPassword(String password)
              this.password = password;
         public void setBalance(String balance)
              this.balance = balance;
         public String getAccount()
              return account;
         public String getBalance()
              return balance;
         public String getPassword()
              return password;
    //********************2nd getter setter file is:***********************
    package hibernate.example;
    import java.util.List;
    public class Catalog
    int id;
    String journal;
    String publisher;
    String edition;
    String title;
    String author;
    private List accinfo;
    public Catalog()
    public void setId(int id)
    this.id = id;
    public int getId()
    return id;
    public void setJournal(String journal)
    this.journal = journal;
    public String getJournal()
    return journal;
    public void setPublisher(String publisher)
    this.publisher = publisher;
    public String getPublisher()
    return publisher;
    public void setEdition(String edition)
    this.edition = edition;
    public String getEdition()
    return edition;
    public void setTitle(String title)
    this.title = title;
    public String getTitle()
    return title;
    public void setAuthor(String author)
    this.author = author;
    public String getAuthor()
    return author;
    public void setAccinfo(List accinfo)
    this.accinfo = accinfo;
    public List getAccinfo()
    return accinfo;
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package hibernate.example;
    import hibernate.example.Acctinfo;
    import hibernate.example.Catalog;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.ListIterator;
    import org.hibernate.Query;
    import org.hibernate.SQLQuery;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
    import org.hibernate.cfg.Configuration;
    public class CatalogClient
         Session session = null;
         SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
         public static void main(String str[])
              CatalogClient clc = new CatalogClient();
              //clc.saveData();
              //clc.deleteData();
              //clc.showData();
              clc.updateData();
         public void showData()
              try
                   session =sessionFactory.openSession();
                   String SQL_QUERY ="select id, journal, publisher, edition, title, author from catalog";
                   // String SQL_QUERY ="select c.ID, c.JOURNAL, c.PUBLISHER, c.EDITION, c.TITLE, c.AUTHOR, a.ACCOUNT, a.PASSWORD,a.BALANCE from catalog c, ACCTINFO a where c.ID = a.ID";
                   SQLQuery query = session.createSQLQuery(SQL_QUERY);
                   System.out.println("*** query : *** "+ query);
                   //for(ListIterator it=query.list().listIterator();it.hasNext();)
                   for (ListIterator lit = query.list().listIterator(); lit.hasNext();)
                        Object[] row = (Object[]) lit.next();
                        /*System.out.println("ID: " + row[0]);
                        System.out.println("Title: " + row[1]);
                        System.out.println("Author: " + row[2]);
                        System.out.println("Isbn: " + row[3]);
                        System.out.println("Pages: " + row[4]);
                        System.out.println("Copyright: " + row[5]);
                        System.out.println("Cost: " + row[6]);
                        System.out.println("******NEXT****************");
    Object[] row = (Object[]) it.next();*/
                        System.out.println("ID: " + row[0]);
                        System.out.println("JOURNAL: " + row[1]);
                        System.out.println("PUBLISHER: " + row[2]);
                        System.out.println("EDITION: " + row[3]);
                        System.out.println("TITLE: " + row[4]);
                        System.out.println("AUTHOR: " + row[5]);
                        System.out.println("acc: " + row[6]);
                        System.out.println("pass: " + row[7]);
                        System.out.println("bal: " + row[8]);
                        System.out.println("***************************");
                   session.close();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void saveData()
              session =sessionFactory.openSession();
              Transaction transaction = null;
              transaction = session.beginTransaction();
              Catalog catalog = setBean();
              //System.out.println("before save");
              session.save(catalog);
              //System.out.println("after save");
              transaction.commit();
              session.flush();
              session.close();
         public void updateData()
              session =sessionFactory.openSession();
              Catalog catalog = new Catalog();
              catalog.setId(2);
              catalog.setAuthor("manoj");
              catalog.setJournal("java");
              catalog.setEdition("1st");
              catalog.setPublisher("indiabulls");
              catalog.setTitle("java Servlet");
              session.update(catalog);
              session.flush();
              session.close();
         public void deleteData()
              session =sessionFactory.openSession();
              Catalog catalog = new Catalog();
              catalog.setId(3);
              session.delete(catalog);
              session.flush();
              session.close();
         public static Catalog setBean()
              Acctinfo accinfo = new Acctinfo();
              accinfo.setAccount("MANOJ1");
              accinfo.setPassword("orbis");
              accinfo.setBalance("1000");
              List list = new ArrayList();
              list.add(accinfo);
              Catalog catalog = new Catalog();
              catalog.setJournal("india");
              catalog.setPublisher("indiabulls");
              catalog.setEdition("ist");
              catalog.setTitle("orbis");
              catalog.setAuthor("manoj");
              catalog.setAccinfo(list);
              return catalog;
    //********************CFG FILE IS ******************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory name="session">
    <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
    <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="hibernate.connection.url">jdbc:oracle:thin:@172.16.31.25:1521:BOMBAY</property>
    <property name="hibernate.connection.username">mumbai</property>
    <property name="hibernate.connection.password">mumbai123</property>
    <!-- Set AutoCommit to true -->
    <property name="connection.autocommit">true</property>
    <property name="dialect">org.hibernate.dialect.OracleDialect</property>
    <!-- Mapping files -->
    <mapping resource="Catalog.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    **********************error i m facing is :************************
    0 [main] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/d.poonam/Desktop/hibernate/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
    1188 [main] WARN org.hibernate.impl.SessionFactoryObjectFactory - Could not bind factory to JNDI
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getNameParser(Unknown Source)
         at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
         at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
         at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:247)
         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
         at hibernate.example.CatalogClient.<init>(CatalogClient.java:24)
         at hibernate.example.CatalogClient.main(CatalogClient.java:27)
    please help me out....
    thanks in advance..
    if u know how to connect two tables plz let me know..
    its urgent....

    I made this work with MySQL. Adapt to your situation as needed. - %
    package hibernate.model;
    import hibernate.util.HibernateUtils;
    import hibernate.model.Catalog;
    import hibernate.model.Account;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.hibernate.Session;
    import hibernate.util.HibernateUtils;
    import static junit.framework.Assert.assertEquals;
    import static junit.framework.Assert.assertNotNull;
    public class CatalogTest
       private static final Log LOGGER = LogFactory.getLog(CatalogTest.class);
       public static void main(String[] args)
          Session session = null;
          try
             session = HibernateUtils.getSessionFactory().getCurrentSession();
             session.beginTransaction();
             int rowsBefore = HibernateUtils.getRowCount(session, Catalog.class);
             assertEquals("should not have any Catalogs", rowsBefore, 0);
             Catalog catalog = new Catalog("test title");
             catalog.addAccount(new Account(100));
             catalog.addAccount(new Account(200));
             Long id = (Long) session.save(catalog);
             assertNotNull("generated id should not be null", id);
             LOGGER.info("returned id: " + id);
             session.getTransaction().commit();
             LOGGER.debug("transaction committed");
          catch (Exception e)
             LOGGER.error(e);
             session.getTransaction().rollback();
    package hibernate.model;
    import java.io.Serializable;
    import java.text.NumberFormat;
    public class Account implements Serializable
       private Long id;
       private int balance;
       public Account()
          this(null, 0);
       public Account(int balance)
          this(null, balance);
       public Account(Long id, int balance)
          this.id = id;
          this.balance = balance;
       public Long getId()
          return id;
       private void setId(Long id)
          this.id = id;
       public int getBalance()
          return balance;
       private void setBalance(int balance)
          this.balance = balance;
       public boolean equals(Object o)
          if (this == o)
             return true;
          if (!(o instanceof Account))
             return false;
          Account account = (Account) o;
          return !(id != null ? !id.equals(account.id) : account.id != null);
       public int hashCode()
          int result;
          result = (id != null ? id.hashCode() : 0);
          result = 31 * result + balance;
          return result;
       public String toString()
          return new StringBuilder().append("Account{").append("id=").append(id).append(", balance=").append(NumberFormat.getCurrencyInstance().format(balance)).append('}').toString();
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
          "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="hibernate.model" default-access="field" default-lazy="true">
       <class name="Account" table="accounts">
          <id name="id" column="account_id">
             <generator class="native"/>
          </id>
          <property name="balance" column="balance"/>
       </class>
    </hibernate-mapping>
    package hibernate.model;
    import java.io.Serializable;
    import java.util.Set;
    import java.util.HashSet;
    import java.util.Collections;
    public class Catalog implements Serializable
       private Long id;
       private String title;
       private Set<Account> accounts;
       public Catalog()
          this(null, "", Collections.EMPTY_SET);
       public Catalog(String title)
          this(null, title, Collections.EMPTY_SET);
       public Catalog(Long id, String title, Set<Account> accounts)
          this.id = id;
          this.title = title;
          this.accounts = new HashSet<Account>(accounts);
       public Long getId()
          return id;
       private void setId(Long id)
          this.id = id;
       public String getTitle()
          return title;
       private void setTitle(String title)
          this.title = title;
       public Set<Account> getAccounts()
          return accounts;
       private void setAccounts(Set<Account> accounts)
          this.accounts = accounts;
       public void addAccount(Account account)
          this.getAccounts().add(account);
       public void removeAccount(Account account)
          this.getAccounts().remove(account);
       public boolean equals(Object o)
          if (this == o)
             return true;
          if (!(o instanceof Catalog))
             return false;
          Catalog catalog = (Catalog) o;
          return !(id != null ? !id.equals(catalog.id) : catalog.id != null);
       public int hashCode()
          return (id != null ? id.hashCode() : 0);
       public String toString()
          return new StringBuilder().append("Catalog{").append("id=").append(id).append(", title='").append(title).append('\'').append(", accounts=").append(accounts).append('}').toString();
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
          "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="hibernate.model" default-access="field" default-lazy="true">
       <class name="Catalog" table="catalogs">
          <id name="id" column="catalog_id">
             <generator class="native"/>
          </id>
          <property name="title" column="title"/>
          <set name="accounts" cascade="all">
             <key column="catalog_id"/>
             <one-to-many class="hibernate.model.Account"/>
          </set>
       </class>
    </hibernate-mapping>
    <!DOCTYPE hibernate-configuration PUBLIC
         "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
         <session-factory>
          <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
          <property name="connection.url">jdbc:mysql://localhost:3306/hibernate?autoReconnect=true</property>
          <property name="connection.username">hibernate</property>
          <property name="connection.password">hibernate</property>
          <property name="connection.pool_size">1</property>
          <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
          <property name="show_sql">true</property>
          <property name="generate_statistics">true</property>
          <property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
          <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
          <property name="cache.use_minimal_puts">false</property>
          <property name="cache.use_query_cache">false</property>
          <property name="order_updates">false</property>
          <property name="hbm2ddl.auto">create-drop</property>
          <property name="current_session_context_class">thread</property>
          <mapping resource="hibernate/persistence/hibernate/Account.hbm.xml"/>
          <mapping resource="hibernate/persistence/hibernate/Catalog.hbm.xml"/>
         </session-factory>
    </hibernate-configuration>

  • How to compare two database on different servers

    hi,
    I want to compare two database on different servers in oracle.first i want to ckechk thier structures and then data.i m using oracle 10.2.0.plz help me out
    Thanks in advance

    In terms of structures, there are various tools out there that can do this, such as TOAD which can do a database compare.
    In terms of data comparisons, that will depend on what sort of results you are expecting to see. I'm sure some tools will do it for you, but it can be just as easy to write your own comparison using a database link from one database to the other.

  • How can I use MS Word within java programming

    Hi everyone!
    I am developing a Java program that will take data
    from an Access 2000 database, and manipulate it,
    display the results graphically and in tables. The
    challenge for me is that I want the program insert the
    graphics and tables into the MS Word template and then
    prompt me to save it as a word * .doc. Do you know
    of any articles or sources of sample code on how to do
    this. The Java environment is Java2, JDK 1.3,
    JBuilder4. The OS environment is XP.
    Regards,
    Farad

    Hi, I also need that package. my e-mail is [email protected] Plese send me that. Thanks in advance
    I have a package that will do this for you. I just
    need to get your email to send an attachment and
    examples.

  • SAP database updations through Java program

    Hi All,
    From Java program, I want to access SAP database batch RFC
    Please tell me which batch RFC's I have to use for read and update of a table.
    Please also tell me how to find out a batch RFC for a particular table.Is there any way to find it out like BAPI.
    What are the steps and settings ?
    Detailed steps help the requirement.
    Thanks,
    Giri

    Giri,
    Ya...Java APP sents data to XI and XI needs to insert the data into the database.
    Before the next round of data is sent by the Application, Xi should sent back info on the status of the records.
    Is this what you want?
    This will be like I have pointed earlier possible without a BPM. But, make the call from the sending application Synchronous. And then map the JDBC response to the calling aplication.
    But this updation is only possible through XI.
    If i got the requirement wrong can you let me know in more detail, what is it that you are trying?
    Reward if solved

  • Possible to Get Database backup with java program

    Hello
    Is it possible to Get or Create Database Backup on runtime with java program using some sql statements
    How could i do that
    '

    Cross posted and multi-posted.
    Hey jackass why don't you look where I already answered this question.
    http://forum.java.sun.com/thread.jspa?threadID=654902&messageID=3849575

Maybe you are looking for

  • When i sync my phone itunes stops working when optimizing my photos.  why

    when i plug in my phone to my computor to sync, itunes stops working when it gets to step 5 optimizing my photos .  why?

  • InDesign CS5 malfunctioning

    I upgraded to Snow Leopard a few months ago on my iMac, but was still using CS3, which caused lots of havoc. My company finally got me the CS 5 software, which I installed a few days ago, and I was hoping my problems would go away, but they have not.

  • Information Broadcasting Authorization at Query Level

    Hi, I would like to know, is there any way to authorized a user at query level in information broadcasting? For example, there are three plant P1,P2 and P3 showing in Query, now i want to broadcast this query to E-mail to two user U1 and U2 in follow

  • Why can't i remove my start up programs?

    I have 2 programs that launch in Start up (Windows Messenger and utorrent). But i don't want them to launch on start up. So i go to Users & Groups Preferences from the Menu Bar and i click Login Items. Then i click the lock because i want to make cha

  • Software to find duplicate files

    Is there a way for the macbook pro to find duplicate files? Or is there freeware or a recommended software for this? I have massive duplicates that I need to get rid of.