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>

Similar Messages

  • How to connect one database in two threads?

    Dear All,
    If anyone can tell me how to connect one database concurrently?
    I tried the following idea:
    1.create a Hashtable to keep database objects(those databases have been opened)
    2.Before openning(connecting) a database:first step is to check the hashtable.
    If the the database object is in the hashtable, this object will be returned.
    If the datatbase object is not in the hastable, open the database and store this opened database object into the hashtable.
    I failed the test of this implementation. My test is:Create two threads (extend java Thread class).In each of these two threads, try to open the same database.Just like the following:
    MyThread thread1 = new MyThread();
    MyThread thread2 = new MyThread();
    thread1.start();
    thread2.start();
    I guessed the database object in the hashtable would be returned in the second thread.Unfortunatly, I only got an exception which meant the database couldn't be opened twice.It looks like the second thread happened before the opened database object stored into the hashtable.
    I cannot figure out if my design is wrong or my test application is wrong.
    I really appriatiate your attentions!!!
    Lu

    um not sure i follow exactly but in your code add the word synchronise to it and this means only 1 tread can access it at any 1 time.
    So your could have a class which is a singleton so it only opens the dbase once and then all other access share your connection.
    so
    public class foo{
    foo INSTANCE = new foo();
    private foo(){} //private constructor
    then all your methods use foo's internal dbase connection. Am i making sense

  • Generate query  at a time &  connect  two database ?

    Hi
    Could u help me? it is necessary  that  
    I have  two database ( RSHPL,RSPL)  and both data base have  same table name and same fieldname (Table Name :-OITM, Fieldname :ONHAND ,pk- ITEMcode,) 
    At first I tell u what I want?
    I want to generate query  at a time &  connect  two database and same table name(OITM)  to select the TOTAL VALUE of this  field(ONHAND) and pk-key is Itemcode.  
    Is it Possible? If  Possible  plz  write this query and send me.

    Hi,
    I don't think its possible to write a query from within SAP that allows you to get data from another SAP database. 
    I have used SQL Reporting Services to report on data from multiple databases, and this works very well for many of my clients.  It depends on what you want to do with the data, do you need to display it on the screen in SAP and it to a field or will a report suffice?
    Regards,
    Adrian

  • How do we connect two databases in Oracle other than Database Link?

    Good Morning,
    How do we connect two databases in Oracle other than Database Link?
    I am using Oracle 10g, I heard that we can connect two database in Oracle through ODBC. Is it possible? How?
    Thanks
    Nihar

    See if this helps.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4406709207206#18830681837358

  • I want to connect two database in Oracle

    Dear All
    I want to connect two database in Oracle ver-10.2.0.1.0 ,And fetch data from 2nd table.
    OS - XP Pro.
    Regards,
    Parwez

    Configure remote DB in TNS first.
    Create DB link.
    CREATE {PUBLIC} DATABASE LINK "DBLINKNAME"  CONNECT TO "remoteuser" IDENTIFIED BY "remotepwd" USING 'REMOTEDBTNSALIAS';Query remote tables using
    select * from remotetable@DBLINKNAME;

  • Connect two database in runtime

    I have a application, which will set the JDBC connection once the tomcat load. Then i can get the connection each time. But there are another function in the application, which will insert some data into another database. But I don't know how to load two database connection once the tomcat load or switch to another database base. Thanks for you help.
    In the context.xml. the current setting as belows
    <?xml version="1.0" encoding="UTF-8"?>
    <Context reloadable="true" path="/">
    <Resource auth="Container"
                   driverClassName="oracle.jdbc.OracleDriver"
                   maxActive="15"
                   maxIdle="60"
                   maxWait="8000"
                   name="jdbc/dbdatasource"
                   username="xxx"
                   password="xxx"
                   type="javax.sql.DataSource"
                   url="jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.1)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.2(PORT = 1521))(LOAD_BALANCE = yes))(CONNECT_DATA =(SERVICE_NAME = toc)))"/>
    </Context>
    And when the application get connection, will use the following coding.
    db = new DBAccess(this.getClass());
    public DBAccess(Class sInClass) throws Exception{
    sCallerClassName = sInClass.getName();
    connectDB();
    private void connectDB() throws Exception{
    String sDbName;
    String sDbUser;
    String sDbPasswd;
              try {
              Context initCtx = new InitialContext();
              Context envCtx = (Context) initCtx.lookup("java:comp/env");
              DataSource ds = (DataSource) envCtx.lookup("jdbc/dbdatasource");
              this.oCon = ds.getConnection();
    oSystemLog.debug(" ----- Class " + sCallerClassName + " connection started ----- ");
    } catch (Exception e) {
    oSystemLog.error("",e);
    throw e;
    }

    Configure another Resource entry with a different JNDI name (yours is called "jdbc/dbdatasource") in Tomcat and create a corresponding mapping in your web application's deployment descriptor (the web.xml file).

  • How to connect oracle database from tuxedo

    Hi,
    How to connect oracle database from tuxedo.
    If any one can help me.
    Regards,

    it depends on configuration your going to choose, there are two ways--
    - Using X/Open standards, for this
    you have to make an entry of Resource manager in $TUXDIR/udataobj/RM file.
    Then in UBBConfig file in GROUPS section u have to set Openinfo.
    It also depend on which database you are going to use.
    In your service now you need to call tpopen() API from tpsvrinit() function.
    - Other possibility is, take an implicit connection using Pro*C or Pro*Cobol whatever platform you are using.
    EXEC SQL Connect ...

  • How to connect mysql database using xml

    welcome to all,
    here my doubt is how to connect mysql database using xml file, how to integrate xml file and jsp file and how to access data from dabase using jsp file. can any one help me
    regards

    Short answer: you wouldn't do any of those things. The first two are meaningless and the third is a bad practice. I have no idea what those ideas were supposed to achieve so I have no idea what tutorials I should suggest to you.

  • How  to  connect  to  database

    Hi Experts,
    i am using oracle 10g (10.2),linux4.6 .my databae server contain multiple databases how can connect one database to another database and how can i put this all environment variable in single parameter file

    tmadugula wrote:
    Hi Experts,
    i am using oracle 10g (10.2),linux4.6 .my databae server contain multiple databases how can connect one database to another database and how can i put this all environment variable in single parameter fileYou can see from the responses two very different sets of advice. To know what applies to your situation, you need to clarify what you need to do.
    If you are talking about choosing which database you connect to from sqlplus, follow the advice about changing the environment variable ORACLE_SID.
    If you are talking about having one database being able to access another (one db acts as the client to another) follow the advice about db links.

  • How to connect two external monitors to a Mac Book Pro?

    How to connect two external monitors to a Mac Book Pro?

    Not as is, but  Matrox makes a peripheral that enables connecting more than one external monitor - matrox.com.

  • How to connect sybase database in JDeveloper 11g using JConnect

    Hi
    How to connect sybase database in JDeveloper 11g using JConnect? Please help.

    User,
    It would help if you explained Sybase Jconnect instead of leaving us to google.
    At any rate, it appears you need to create a library definition in JDeveloper, add the appropriate JConnect JAR files to the library's classpath, and then add the library to your project.
    John

  • How to connect Oracle database in VC++.06

    How to connect Oracle database in VC++.06 please give me details

    on the Insert command button and add the following code to the button click event:
    try
    string results = "";
    OracleConnection con = new OracleConnection("DSN=Employee;uid=system;pwd=test");
    con.Open();
    .....................................................................

  • How to connect external database(Ex:SQL Server/Tivoli)  from ABAP Webdynpro

    Hi,
    Any one have idea how to connect external database like SQL Server/Tivoli to access tables from WebDynPro ABAP.
    Please point to me some links if you have
    Thanks
    Praveen

    Hi,
    Please check out this link -
    FETCH DATA FROM ORACLE DATABASE USING Web Dynpro
    Regards,
    Lekha.

  • How to connect two computers

    please help me
    how to connect two computers through telephone line

    Double Post. See:
    http://forum.java.sun.com/thread.jspa?threadID=770305&tstart=0

  • How to connect oracle database using jsf

    how to connect oracle database using javaserver faces with connection pooling

    Here is one way...
    http://jakarta.apache.org/commons/dbcp/

Maybe you are looking for

  • Microsoft Visual C++ Runtime Library Error!! HELP PLEASE**

    # An unexpected error has been detected by HotSpot Virtual Machine: # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x77f52b6a, pid=2552, tid=2236 # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode) # Problematic frame: # C [ntdll.dll+0x2

  • Hi, Help me please with my T410 Bios..

    Hi.. ? It is possible to recover bios on T410 laptocs?. I have downloaded the bios from official site, T410, and flashed it on Windows 7 (lenovo software), it said that flash is succefully updated (bios updated) and needs to restart the computer, but

  • NullPointerException after upgrading to Portal 7.0.5 from 7.0.4

    Hi, I just upgraded to Portal 7.0.5 and I am getting a nullPointerException logging in to the portal site. I put in debug statements and found that for 7.0.4, portalManager.getGroupPortalMembership returns an empty list [], while for 7.0.5 it returns

  • TreeView with checkboxes

    Hi, I was wondering if anyone had a simple solution on using a TreeView control with checkboxes. The only required functionality would be: Clicking on the CheckBox beside an item that has children will result in all children also becoming selected/un

  • SetModel of JTable doesn't work

    Hi, there I'm trying to create jtable that one of column is checkbox. I have make new class below. class MyTableModel extends AbstractTableModel     Object[][] data;     private int colCount=1;     MyTableModel()         JCheckBox jCheckBox1=new JChe