Problem about constraints and validation

hi
I want to add new unique constraint into a table. But current data does not fit to constraint.
My constraint is like this:
ALTER TABLE T_STUDENT ADD
CONSTRAINT UNIQ_STUDENT
UNIQUE (STUDENT_NUMBER, NAME, SURNAME)
DISABLE
VALIDATE;
I want to add constraint and I do not want to update the data. So how can I add constraint without validating current data?

Since you are creating UQ constraint, Oracle will create a UQ index to enforce it. You have to use non-unique index for such a constraint:
SQL> create table t (x int, y int);
Table created.
SQL> insert into t select 1,1 from dual connect by level <= 2;
2 rows created.
SQL> alter table t add constraint t_uq unique(x) enable novalidate;
alter table t add constraint t_uq unique(x) enable novalidate
ERROR at line 1:
ORA-02299: cannot validate (TIM.T_UQ) - duplicate keys found
SQL> alter table t add constraint t_uq unique(x)
  2  using index (create index t_indx on t(x)) enable novalidate;
Table altered.

Similar Messages

  • Hello apple I have the problem with my iPhone and my friends have this problem too. My iPhone have the problem about calling and answer the call. When I use my iPhone to call I can't hear anything from my iPhone but the person that I call can answer it bu

    Hello apple
    I have the problem with my iPhone and my friends have this problem too.
    My iPhone have the problem about calling and answer the call. When I use my iPhone to call I can't hear anything from my iPhone but the person that I call can answer it but when answer both of us can't hear anything and when I put my iPhone to my face the screen is still on and when I quit the phone application and open it again it will automatic call my recent call. And when my friends call me my iPhone didn't show anything even the missed call I'm only know that I missed the call from messages from carrier. Please check these problem I restored my iPhone for 4 time now in this week. I lived in Hatyai, Songkhla,Thailand and many people in my city have this problem.
    Who have this problem??

    Apple isnt here. this is a user based forum for technical questions. The solution is to restart, reset, and restore as new which is in the manual after that get it replaced for hard ware failure. if your within your one year warranty its replaced if it is out of the warranty then it is 199$

  • A very surprise problem about JDBC and connection pool

    I occur a very problem about JDBC and connection pool on Weblogic Platform
    8.1.
    There is a table in Oracle
    Table
    Name: t1
    id varchar2(5);
    content clob;
    id is primary key.
    If I use a connection pool to connect to Oracle,like following program:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
    con = ds.getConnection();
    then following program will throw a ClassCastException
    String sql = "select content from t1 where id = ?";
    PreparedStatement pst = con.prepareStatement(sql);
    pst.setString(1,"001");
    oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
    statement will throw ClassCastException
    but if I use JNDI to connect to Oracle,like following program, then those
    program above is ok
    private String dbdriver="oracle.jdbc.driver.OracleDriver";
    private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
    private String username="ep";
    private String password="epuser";
    Class.forName(dbdriver);
    conn = DriverManager.getConnection(dburl, username, password);
    conn.setAutoCommit(false);
    On the contrary, if I use JNDI to connect to Oracle, following program will
    throw ClassCastException
    weblogic.jdbc.vendor.oracle.OracleThinClob clob =
    (weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
    but it is fine if I use connection pool to connect to Oracle.
    I am confused this problem, who can tell me why?
    Daniel

    When you are getting connection using datasource lookup from weblogic
    connection pool, this connection is internally wrapped and hence you have to
    cast it to weblogic.jdbc.vendor.oracle.OracleThinClob which you do and so it
    works.
    But when you get connection by loading driver straight, you are getting naked
    oracle connection. In this case when you cast it to oracle.sql.Clob it works,
    as you have seen in your test case.
    I hope this explains what is going on with your code.
    Thanks,
    Mitesh
    Daniel wrote:
    I occur a very problem about JDBC and connection pool on Weblogic Platform
    8.1.
    There is a table in Oracle
    Table
    Name: t1
    id varchar2(5);
    content clob;
    id is primary key.
    If I use a connection pool to connect to Oracle,like following program:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
    con = ds.getConnection();
    then following program will throw a ClassCastException
    String sql = "select content from t1 where id = ?";
    PreparedStatement pst = con.prepareStatement(sql);
    pst.setString(1,"001");
    oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
    statement will throw ClassCastException
    but if I use JNDI to connect to Oracle,like following program, then those
    program above is ok
    private String dbdriver="oracle.jdbc.driver.OracleDriver";
    private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
    private String username="ep";
    private String password="epuser";
    Class.forName(dbdriver);
    conn = DriverManager.getConnection(dburl, username, password);
    conn.setAutoCommit(false);
    On the contrary, if I use JNDI to connect to Oracle, following program will
    throw ClassCastException
    weblogic.jdbc.vendor.oracle.OracleThinClob clob =
    (weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
    but it is fine if I use connection pool to connect to Oracle.
    I am confused this problem, who can tell me why?
    Daniel

  • Problem about rmic and rmiregistry

    I am new to java!
    My OS is Win2000 and the java compiler I installed is Sun One Studio 4 CE. The teaching book I used is teh JAVA2 unleash.
    I try to copy some example in the book and run it! The problem I have the book didn't quite tell me how to compile it!
    The chapter is about the RMI and the step describe in the book are followed:
    1) Move to the directory containing all your classes and compile them. (Which I did)
    2) Move to the root directory
    c:\>rmic unleashed.ch2.GreeterImpl (problem)
    3) Open one command window and type
    c:\> rmiregistry (problem)
    4) Open another command window and type
    c:\> java unleashed.ch2.GreeterServer
    5) open the thrid window and type
    c:\> java unleashed.ch2.GreetingClient
    Problem part:
    I try to follow the step and open a DOS Prompt and type step two and three!! It seems that the window don't understand the command rmic and rmiregistry! What should I do??
    Thank you very much for helping! Thanks!!
    Ferdinand

    you need to add the java bin directory to your 'path' system environment variable

  • A problem about Proc and oci

    I got a new task (coding in c language with oci or proc to operate remote oracle. the develope environment is linux server is windows OS ) ,but I have nothing experice about it previously. in the process of using oci and proc, amount of problems appeared.
    the first question i want to make explicit is , can I testing and running the program with out the client of oracle. in a other word ,only use the .so files to compiling and testing .in linux environment .
    If the answer is that we can . how can i program with oci or proc?
    as I know in the samples of oracle ,every demo is only link to the local database.
    and the resource about this field is so limit. I can not find any usable material with google.
    in my familar condition ,if we need connect to remote database ,we should provide the hostname or ip address and the prot num of oracle service . but in OCI library ,there are two functions olog and ocilogon can use to log to service .how can i use it?
    eg. if the server hostname is dbserver/192.168.1.2 and port is 1521,the dbname is iv. how can i use olog or ocilogon to log on the server? thanks very much !!!
    btw: if we using proc to connect server. how can i connect to server?
    waiting on line...
    Thanks.

    You must install an Oracle Client in order to proceed. The client installation is included in the Oracle Database installation disc.
    Afterwards, use "netca" to configure the connection to your remote DB. Alternatively, you could edit the tnsnames.ora file manually if so you wish.
    For reading material, type "Pro*C/C++ Precompiler Programmer's Guide" in google.
    Message was edited by:
    jonjac

  • Problem about put and get

    hi there,
    I met a problem, when i put the data, and get it.
    key data
    aaa aaaaaa
    bbb bbbbbb
    ccc cccccc
    I have put "aaa", "bbb" and "ccc" into db, but when I try to get the key for "aaa" , "bbb", it return the data "cccccc", how can I solve it?
    after that, when i get the key "ddd", "eee" , and all strings are length 3, the key does not in the DB, it also return the data "cccccc". Did I do something wrong on my code?
    void Set1(CString sKey)
    int ret;
    std::string sdb = "test.db";
    Db db(NULL, 0);
    ret = db.open(NULL,
         sdb.c_str(),
         NULL,
         DB_BTREE,
    DB_CREATE,
         0);
    std::string skey, sdata;
    skey = sKey;
    sdata.append(skey);
    sdata.append(skey);
    Dbt key(&skey, skey.length());
    Dbt data(&sdata, sdata.length());
    ret = db.put(NULL, &key, &data, 0);
    if(ret==0){
    TRACE("success\n");
    ret = db.close(0);
    void Get1(CString sKey)
    int ret;
    std::string sdb = "test.db";
    ret = db.open(NULL,
    sdb.c_str(),
         NULL,
         DB_BTREE,
         DB_CREATE,
         0);
    Dbc *cur;
    ret = db.cursor(NULL, &cur, 0);
    std::string skey, s2, a2;
    skey = sKey;
    Dbt key(&skey, skey.length());
    Dbt data;
    memset(&data, 0, sizeof(data));
    ret = cur->get(&key, &data, DB_SET);
    if(ret!=DB_NOTFOUND){
    a2 = (std::string*) data.get_data();
    s2 = (std::string*) key.get_data();
    TRACE("FOUND %s %s\n", s2->c_str(), a2->c_str());
    ret = cur->close();
    ret = db.close(0);
    }

    Hi,
    The problem seems to be with these lines:
    std::string skey, sdata;
    Dbt key(&skey, skey.length());
    Dbt data(&sdata, sdata.length());You are constructing a Dbt with data that is actually a pointer to a C++ std::string object. You want the value to be an actual c style string.
    An alternative would be to construct the Dbts like:
    Dbt key(skey.c_str(), skey.length());
    Dbt data(sdata.c_str(), sdata.length());You will need to create a new std::string out of any data retrieved from the database as well. Since it will now be just a C-style char * string.
    I hope this helps.
    Regards,
    Alex Gorrod, Oracle

  • Problem about jtable and database

    The problem is that when i clicked the button to save the values of textfields and text area, although the table is supposed to show the new list of datas from the db, it adds the new data list to the end of the first list. I have to list one old and one new in jtable.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * DatabaseConnection.java
    * Created on 28.Aðu.2008, 11:24:52
    package databaseconnection;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableModel;
    * @author ARAGORN
    public class DatabaseConnection extends javax.swing.JFrame {
        /** Creates new form DatabaseConnection */
        public DatabaseConnection() {
            try {
                Class.forName("com.mysql.jdbc.Driver");
                con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Students", "admin", "1837837");
                st = con.createStatement();
            } catch (Exception e) {
                System.out.println("Database Connection Error!");
            try {
                ResultSet rs = st.executeQuery("SELECT*FROM studentdata");
                while (rs.next()) {
                    Object[] rowValues = {rs.getInt(1),rs.getString(2),rs.getString(3),rs.getInt(4),rs.getString(5),rs.getString(6),rs.getInt(7)};
                    row.addElement(rowValues);
                data = new Object[row.size()][7];
                for(int i=0;i<row.size();i++){
                    data=(Object[]) row.get(i);
    } catch (Exception e) {
    System.out.println("reading error!");
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jSeparator1 = new javax.swing.JSeparator();
    jLabel2 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jTextField3 = new javax.swing.JTextField();
    jTextField4 = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jTextField5 = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    jTextField6 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowOpened(java.awt.event.WindowEvent evt) {
    formWindowOpened(evt);
    jTable1.setModel(new javax.swing.table.DefaultTableModel(data,heading)
    jScrollPane1.setViewportView(jTable1);
    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Öðrenci Bilgileri", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N
    jLabel1.setText("Öðrenci No : ");
    jLabel2.setText("Adý : ");
    jLabel3.setText("Sýnýf : ");
    jLabel4.setText("Soyad : ");
    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane2.setViewportView(jTextArea1);
    jLabel5.setText("Adress : ");
    jLabel6.setText("Tel : ");
    jLabel7.setText("Þube : ");
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addGap(22, 22, 22)
    .addComponent(jLabel1)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(364, Short.MAX_VALUE))
    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addGap(40, 40, 40)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jLabel6)
    .addComponent(jLabel2)
    .addComponent(jLabel4)
    .addComponent(jLabel5))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
    .addComponent(jTextField4)
    .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE))
    .addGap(28, 28, 28)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jLabel3)
    .addComponent(jLabel7))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)
    .addComponent(jTextField6, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)))
    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGap(49, 49, 49))
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel1)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel2)
    .addComponent(jLabel3)
    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel4)
    .addComponent(jLabel7)
    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jLabel5)
    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel6)
    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addContainerGap())
    jButton1.setText("Kaydet");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jButton2.setText("Temizle");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton2ActionPerformed(evt);
    jButton3.setText("Çýk");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton3ActionPerformed(evt);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 597, Short.MAX_VALUE)
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addComponent(jButton1)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jButton2)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jButton3)))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGap(18, 18, 18)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jButton1)
    .addComponent(jButton2)
    .addComponent(jButton3))
    .addGap(38, 38, 38))
    pack();
    }// </editor-fold>
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    System.exit(0);
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    jTextField1.setText("");
    jTextField2.setText("");
    jTextField3.setText("");
    jTextField4.setText("");
    jTextField5.setText("");
    jTextField6.setText("");
    jTextArea1.setText("");
    private void formWindowOpened(java.awt.event.WindowEvent evt) {                                 
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    try {
    st.executeUpdate("INSERT studentdata(Ogrenci_no,Ad,Soyad,Sinif,Sube,Adres,Tel) VALUES(" +
    Integer.parseInt(jTextField1.getText()) + ", '" +
    jTextField2.getText() + "', '" +
    jTextField4.getText() + "', " +
    Integer.parseInt(jTextField3.getText()) + ", '" +
    jTextField6.getText() + "', '" +
    jTextArea1.getText() + "', " +
    Integer.parseInt(jTextField5.getText()) +
    } catch (SQLException e) {
    System.out.println("Writing data Error!");
    try {
    ResultSet rs = st.executeQuery("SELECT * FROM studentdata");
    while (rs.next()) {
    Object[] rowValues = {rs.getInt(1),rs.getString(2),rs.getString(3),rs.getInt(4),rs.getString(5),rs.getString(6),rs.getInt(7)};
    row.addElement(rowValues);
    data = new Object[row.size()][7];
    for(int i=0;i<row.size();i++){
    data[i]=(Object[]) row.get(i);
    } catch (Exception e) {
    System.out.println("reading error!");
    jTable1.setModel(new MyTableModel());
    jTable1.setVisible(true);
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new DatabaseConnection().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    // End of variables declaration
    Connection con;
    Statement st;
    Vector row = new Vector();
    Object[][] data;
    Object[] heading = {"Öðrenci_No","Ad","Soyad","Sýnýf","Sube","Adres","Tel"};
    class MyTableModel extends AbstractTableModel{
    public int getColumnCount(){
    return heading.length;
    public int getRowCount(){
    return data.length;
    @Override
    public String getColumnName(int column){
    return heading[column].toString();
    public Object getValueAt(int row, int column){
    return data[row][column];
    public boolean isCellEditable(){
    return false;
    @Override
    public void setValueAt(Object value, int row, int column){
    data[row][column] = value;
    fireTableCellUpdated(row, column);
    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    any one to help ?

  • Problem about aix and java.util.Date

    Hello,
    I am using AIX 5.1 with JDK 1.4 and i got a problem
    using this JDK 1.4
    I was using the jdk 1.2.2 and it gets to me the correct
    date from the system ... i've never exported any environment
    variable like lc_type, lang , etc ...
    but now, using jdk 1.4, i get wrong time, one hour less,
    can i have to export some environmental variable? which ones?
    because i've tried with LANG=es_ES , LC_TYPE and it doesn't
    work
    thank you
    [email protected]

    It seems to have to do with default time zone.
    You can consider explicitly defining the time zone you want the dates to be formatted against.

  • Localizion resource problem about *.resx and Thread.CurrentThread.CurrentCulture

    Hello all,
      I have a strange question. I am building an application which is for US and other localizations
      In one project. I create different resources -- it is *.resx file.  For example
      They are Text.resx and Text.zh-Hans.resx files.
      At the start of the application I add the following code
       Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("zh-Hans"); Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("zh-Hans");
     in the later code, program access the Properties defined in *.resx files for different languages.
    Now here is question. The application works in one Win7 box. But it doesn't work in another Win7 box.
    In the Win7 box which has problem, the application always displays the English text (which are defined at Text.resx )
    It doesn't display the simplified Hans defined in Text.zh-Hans.resx.
    I have tried several system settings, but nothing works in that Win7 box.
    Does any one has any idea with it?
    Thanks
    Good luck

    @startor
    I am glad to know you solved this problem and thanks for sharing the solution.
    It will be very beneficial for other community members who have the similar questions.
    Best Regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Strange Problem about KeyListener, and FocusListener

    Hi,Please help me with this problem.
    I create a JTable and setCellEditor by using my customerized TextField
    The problem is: when I edit JTable Cell, the value can not be changed and I can not get Key Event and Focus Event.
    here is my source:
    //create normal JTable instance,and then initlize it
    private void initTable(Vector folders)
    TableColumn tempcol = getColumnModel().getColumn(0);
    tempcol.setCellEditor(new DefaultCellEditor(new MyTextField()));
    for(int i=0;i<folders.size();i++)
    mddDataSource ds=(mddDataSource) folders.get(i);
    String name = ds.getDataSourceName();
    layers.add(name);
    for(int i=0;i<layers.size();i++){
    Vector temp = new Vector();
    temp.add(layers.get(i));
    temp.add(layers.get(i));
    dtm.addRow(temp);
    // My Text Field cell
    class MyTextField extends JTextField implements FocusListener, KeyListener
    MyTextField()
    setOpaque (false);
    addKeyListener(this);
    addFocusListener(this);
    MyTextField(String text)
    setOpaque (false);
    addKeyListener(this);
    addFocusListener(this);
    public void focusGained(FocusEvent e) {
    System.out.println("get Focus");
    public void focusLost(FocusEvent e) {
    instance.setValue(getText());
    public void keyTyped(KeyEvent e){
    instance.setValue(getText());
    public void keyPressed(KeyEvent e){
    System.out.println("get Key ");
    public void keyReleased(KeyEvent e){
    instance.setValue(getText());
    If there are some good sample, please tell me the link or give me some suggestion.
    Thanks in advanced

    Thanks for your help.
    The problem still exist. It does not commit the value that I input.
    Maybe I should say it clearly.
    I have create JPanel include three JPanel:
    Left Panel and right upper-panel and right borrom panel.
    The JTable instance is on right-upper Panel.
    If I edit one of row at JTable and then click JTable other row,the value can be commited. if I edit one of row and then push one Button on
    the right-bottom button to see the editting cell value.It does not commit value.
    when I use debug style, and set breakpoint the
    foucsGained or KeyTyped,
    It never stopes at there,So I assume that the Editing cell never get focus.
    Is there a bug at Java if we move focus on other Panel, that JTable can not detect the Focus lost or focus gained event?
    Thanks

  • Problems about airplay and apple tv

    Hello,
    I currently have two terminals wifi ssid with two different "alexmario" and "numericable" and are on the same network.
    when I activate "airplay" and my "Apple TV" is ethernet, I the "airplay" broadcast on one of my wi-fi "alexmario" on my iphone ios5.0.1 and then when I conecté on "numericable" airplay function is not available ...
    how do I get the "aiplay" terminal on both networks?

    from this support article: Using AirPlay
    With AirPlay, you can wirelessly stream videos, music, and photos from your iPhone, iPad, or iPod touch to Apple TV (2nd generation) and stream music to AirPlay speakers or receivers, including AirPort Express. You can also wirelessly stream videos and music from your computer to Apple TV (2nd generation) and stream music to AirPlay speakers or receivers, including AirPort Express.
    you can not airplay from ATV2 to other devices.

  • Problem about getAccessibleContextAt and get info of invisible contents

    Nowadays I am studying on how to use java access bridge API,Actually I have worked out some codes to successfully getting information of visible contents of java application. I can use GetAccessibleContextFromHWND and getAccessibleChildContext to track information. But I found that there are some invisible controls in my java app, I can use JAVAFerret to track these control by using getAccessibleContextAt (I guess), but when I used this function in my c# code, it always returns zero
    the procedure I did is as follows
    first use FindWindow to get HWND of the app window
    then use GetAccessibleContextFromHWND to get vmid and ac of the main app window
    then use getAccessibleContextAt(vmid,ac,x coordinates ,y coordinates, out acc)
    but acc always is zero , no matter what x, y is .
    I read source code of javaferret , I think what the code did is the same as I did,but why I can not get correct ac
    why is that,and Is there other way to track those invisble control information , Thanks
    Edited by: user9098048 on 2012-3-29 上午4:12

    Yeah i read back my question and i see that i was not clear :P
    What i want to do is to know the window handle of another apllication already running. Im doing some Java.Robot actions to simulate a user but i need to know on what component i am. I guess this should be done using native java... thats all i know for what i searched. The code i found is not working because something changed around java 1.4
    My app has Swing GUI and is using latest java (1.6 build 07)

  • Problem about SimpleUniverse and Canvas3D

    Hi,all:
    I need to load two different 3D objects in each of JSplitPane. I do as follows:
    (1) //JSplitPane jp
    // Canvas3D c1,c2
    Jp.setRightComponent(c2);
    Jp.setLeftComponent(c1);
    add(Jp,BorderLayout.CENTER);
    (2) BranchGroup scene1=createSceneGraph1();
    BranchGroup scene2=createSceneGraph2();
    SimpleUniverse u1=new SimpleUniverse(c1);
    u1.getViewingPlatform().setNominalViewingTransform();
    u1.addBranchGraph(scene1);
    SimpleUniverse u2=new SimpleUniverse(c2);
    u2.getViewingPlatform().setNominalViewingTransform();
    u2.addBranchGraph(scene2);
    (3) Vector3d viewpoint=new Vector3d(0.0,0.0,2.41);
    Transform3D t=new Transform3D();
    t.set(viewpoint);
    Viewer viewer=new Viewer();
    View view=viewer.getView();
    view.addCanvas3D(c2);
    view.addCanvas3D(c1);
    ViewingPlatform v=new ViewingPlatform();
    v.getViewPlatformTransform().setTransform(t);
    SimpleUniverse u = new SimpleUniverse(v,viewer);
    u.getViewingPlatform();
    u.addBranchGraph(scene1);
    u.addBranchGraph(scene2);
    But I can only get one object displayed in the right pane (c2) of the JSplitPane,while the left pane is null.
    Why? And how can I display the two objects in both panes?

    Hi,all:
    I need to load two different 3D objects in each of JSplitPane. I do as follows:
    (1) //JSplitPane jp
    // Canvas3D c1,c2
    Jp.setRightComponent(c2);
    Jp.setLeftComponent(c1);
    add(Jp,BorderLayout.CENTER);
    (2) BranchGroup scene1=createSceneGraph1();
    BranchGroup scene2=createSceneGraph2();
    SimpleUniverse u1=new SimpleUniverse(c1);
    u1.getViewingPlatform().setNominalViewingTransform();
    u1.addBranchGraph(scene1);
    SimpleUniverse u2=new SimpleUniverse(c2);
    u2.getViewingPlatform().setNominalViewingTransform();
    u2.addBranchGraph(scene2);
    RESULT:
    But I can only get one object displayed in the right pane (c2) of the JSplitPane,while the left pane is null.
    [u]if I write (2) as follows:
    BranchGroup scene1=createSceneGraph1();
    BranchGroup scene2=createSceneGraph2();
    SimpleUniverse u1=new SimpleUniverse(c1);
    u1.getViewingPlatform().setNominalViewingTransform();
    u1.addBranchGraph(scene1);
    u1.addBranchGraph(scene2);
    RESULT:
    Neither the object will display.
    If I change:
    SimpleUniverse u1=new SimpleUniverse([b]c1);
    [u]to:
    SimpleUniverse u1=new SimpleUniverse(c2);
    RESULT:
    I can only get one object displayed in the right pane (c2) of the JSplitPane,while the left pane is null.
    Why? And how can I display the two objects in both panes?

  • Problem about F5 and F6 keys

    I was trying to screenshot but sth wrong happen to my backlit F5 and F6 keys and I cant use it ...like i might accidently press command+shift+f5 ...and somehow the backlit keys stop working...  , what should I do? Thank you

    Try a SMC reset.
    http://support.apple.com/kb/HT3964
    Ciao.

  • Problem about look and feeling

    i want to make my jframe looking and feeling like jdeveloper.what should i do ?

    Hi,
    if I remember well then JDeveloper uses the JGoodies Plastic Look and Feel. Just go to http://www.jgoodies.com/ and get the look and feel.
    Frank

Maybe you are looking for

  • Intermittent Flashing Question Mark Folder

    I've got a iBook g4 that seems to be having an intermittent problem booting. A few months back on boot it came up with a flashing question mark folder. After trying a few things it finally booted OK. For months all was good; until yesterday. The same

  • Netflix crashes all browsers on Watch Instantly launch

    Netflix crashes my Firefox 3.6.16 and Safari 4.1.3 once I get to the black screen with the circles. Re-botted and got the same trouble. Netflix support line was worthless; said it must be a Mac problem. Thanks for nada. Any

  • Change Apple ID Used During MacBook Set Up

    Hi - I set up a MacBook for myself and want to give it to my wife. I set it up using my Apple ID. When my wife opens up iChat, e.g., the application thinks it's me. How can I change the Apple ID associated with the MacBook to her Apple ID ... without

  • Exception in PLSQL

    Hello, I have a problem to catch exception in this proc : create or replace procedure MAPROC (nom_snapshot in varchar2) is ladate varchar2(20); BEGIN select sysdate into ladate from dual; dbms_snapshot.refresh(nom_snapshot); execute immediate 'UPDATE

  • Firefox keeps opening tabs to tell me about add ons!

    Since the latest upgrade, when I open Firefox, 5 or 6 other tabs open telling me about the features of add ons. I am so frustrated by this that I have ACTUALLY STOPPED USING FIREFOX!!! Can anyone tell me how to stop this?? It doesn't matter if I clic