Is it possible to install 32 bit JDBC driver in a 64bit OS?

Is it posssible to get a DataSet without getting a ResultSet

There are no letters like that.
my java is upto date.
im updating netbeans IDE.

Is there a solution for this prob?

Yes i got win 7 64bit.
I did not unserstand the last quiz.
I will update everything and post back the results.

It prints the field one by one smoothly.
No probelm there. This happens when assigning.
And also as the resuls show it is 0,1,2...coz 3rd fiels is null.So it gives
Data Not Found exception. How ever now i refer to columns by their name.

    try{

            //Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            Class.forName("com.mysql.jdbc.Driver");

        Connection conn = DriverManager.getConnection("jdbc:odbc:abc");

                Statement stmt = conn.createStatement();
                ResultSet rss = stmt.executeQuery("Select Datestamp from TimeTrans");

                 while (rss.next()) 
                 {
                      // String s =rss.getString("Datestamp").toString();
                      System.out.println(rss.getString("Datestamp") );//this prints the values

                    }

        } catch (Exception e) {  
            e.printStackTrace();  
        }

Insert statemnts work fine.

Hi,

I did this

String s =rss.getString(2).toString();

But still it throwes the exception.

Hi all,

I get 'Invalid string or buffer length' exception when trying to
do this.

String s=resultSet.GetString(1)

Exception:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
    at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3906)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5697)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353)
    at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1503)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:381)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at Controll.Test.sselect(Test.java:72)
    at Controll.Test.main(Test.java:33)

Not only getString(), any method in Resulset cannot be assigned to a variable.
But this prints the values. When i try to assign the value to a variable it throws the exception.

System.out.println(resultSet.GetString(1))

Here is my code

        try{

                    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

                    Connection conn = DriverManager.getConnection("jdbc:odbc:abc");

                    Statement stmt = conn.createStatement();
                    ResultSet rss = stmt.executeQuery("Select * from TimeTrans where PID=100");

                 while (rss.next()) 
                 {
                       String s=rss.getString(1);//this lines is the problem
                      // System.out.println(rss.getString(1) );

                 }

        } catch (Exception e) {  
            e.printStackTrace();  
        }

Second column of my table is a type of varchar(10)
plz plz....help me.
Im stuck here for 2 days.

This is the implementation.

public ClientImplementation(String name) throws RemoteException
    {
            String arg = "rmi://localhost:2828/chatfun";
            myName=name;

            try{
            csi=(chatServerInterface)Naming.lookup(arg);
            csi.joinChatRoom(name,(chatClientInterface)this);
            this.chatStart();
            }catch(Exception ex)
            {

                ex.printStackTrace();
                System.exit(0);
            }
    }
     public void chatStart()
    {
    Scanner in = new Scanner(System.in);
        while (true) {
            try {
                String lastMessage = in.nextLine();
                csi.sendToAll(lastMessage,myName);
            }catch (Exception e) {
                System.out.println("exiting with error...");
                System.err.println(e);
                System.exit(1); //exit
            }
        }
    }

What do you mean by check csi? You mean check for null.
I add this line

if(csi!=null)
   csi.joinChatRoom(name,this);

But still gives me the exception.

I cast this because it gives me a IllegalArgumentException, I thought to cast "this".

(chatClientInterface)this

PLZ help me solve this.

This is my server

public synchronized void joinChatRoom (String clientName, chatClientInterface c) throws RemoteException
    {

                    if (clientList.containsKey(clientName))
                    {
                       c.nameAvailable();
                    }
                    else
                    {
                        System.out.println(clientName+" is now joined the chat room!");
                        clientList.put(clientName,c);

                        Collection cc= clientList.keySet();
                        Iterator itt= cc.iterator();

                        while(itt.hasNext())
                        {
                            chatClientInterface client=(chatClientInterface)itt.next();
                            try{
                                client.receiveMessage(clientName+" is now joind the chat room!", clientName);
                            }catch(Exception ex)
                            {
                                System.out.println("failed to join "+clientName+ "into chat room");
                                ex.printStackTrace();
                            }

                    }

                    }

    }

Do i need to remove null?

chatServerInterface csi;

Null is assigned.

public class ClientImplementation{

    chatServerInterface csi = null;

     public ClientImplementation(String name) throws RemoteException
    {
            String arg = "rmi://localhost:2828/chatfun";
            myName=name;
           // myGui=gui;
            try{
            csi=(chatServerInterface)Naming.lookup(arg);
            csi.joinChatRoom(name,(chatClientInterface)this);
            this.chatStart();
            }catch(Exception ex)
            {
                //JOptionPane.showMessageDialog(null, "Failed\n"+ex.printStackTrace());
                //System.out.println("Failed to bind\n"+ex.printStackTrace());
                ex.printStackTrace();
                System.exit(0);
            }

    }

Hi all,
I'm developing a simple RMI chat server.
Im getting following exception when i execute Client.
Server works well.

java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
        at sun.rmi.transport.Transport$1.run(Transport.java:177)
        at sun.rmi.transport.Transport$1.run(Transport.java:174)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
        at ServrImplementation_Stub.joinChatRoom(Unknown Source)
        at ClientImplementation.<init>(ClientImplementation.java:28)
        at ClientImplementation.main(ClientImplementation.java:79)

this is my client implementation

 public ClientImplementation(String name) throws RemoteException
    {
            String arg = "rmi://localhost:2828/chatfun";
            myName=name;
           // myGui=gui;
            try{
            csi=(chatServerInterface)Naming.lookup(arg);
            csi.joinChatRoom(name,(chatClientInterface)this);//this is the line which the exception shows
            this.chatStart();
            }catch(Exception ex)
            {
                //JOptionPane.showMessageDialog(null, "Failed\n"+ex.printStackTrace());
                //System.out.println("Failed to bind\n"+ex.printStackTrace());
                ex.printStackTrace();
                System.exit(0);
            }

    }

this is my server interface

public interface chatServerInterface extends Remote{

    public void joinChatRoom(String clientName,chatClientInterface c) throws RemoteException ;
    public void leaveChatRoom(String clientName) throws RemoteException;
    public void sendToAll(String msg,String name) throws RemoteException;
    public java.util.Iterator getOnlineClients() throws RemoteException;

}

PLZZZZZZZZZZz....help me i cannot find the mistake i made.

Hi,

Im developing a game. When the human gets his turn i want to display a JFrame with some buttons.
So the game must wait until the user clicks on a button. Also i want to identify which button is clicked.

I read that JOptionPna gets any component as a parameter.I did the following.
but the coding of the my object is shown inside an input field.

 MyFrame my=new MyFrame();
 JOptionPane.showInputDialog(null,"test",my);

PLZ....... help me

Hi,

I want to get the object of the currently open JFrame?

I found this

 Frame[] frames = Frame.getFrames();

Does this provide the open frames?
If so how to get the frame that i need.

Plz Help..

The requirements for the project was changed. Now I have 51947 words.

And i want get all the words when i provide a set of letters.
Ex: abanana
answers: BANANA ANNA NAN NANA ABA ANA ...

Is it still ok to load the words into an array and do this search.
Or is it better to implement a trie?

Im a student so im not sure about my selection. Correct me if im wrong.
I think it should be a trie. This is for a game like scrabble.
I do only search and there are no any removals.

Hi,

I want to implement an English word dictionary without the meanings. I have 51,947 words.
I read many articles on the internet and sugestions were trie, Hashset
Will implementing a trie provide better perfomance for serching or Hashset or anyother.

Plz help me..

Here's a quickie example to show what I mean. Please excuse the crappy Java, I'm terribly rusty:

Thank you very much.
I get it now and you just saved me :-)

Im a student so Im not expert in java.But not even too much low.
I dont understand the frequency list.
If u could please explain the psuedo code a bit?

Hi,

I want to find all the words(scabble words) that can be made out of given set of letters.
ex: abnana

results: a aa ab an baa ban banana na nab

How could i achieve this? Do i need a binary tree?
Plz some one help me...

Thank you.
I got it..
:-)

Yes.The array elements are printed.When i read the words from the file into the array, the regex is not detecting. These are the words in the files:

AAHED AALII AARGH ABACA ABACI ABACK ABAFT ABAKA ABAMP ABASE ABASH ABATE ABBAS ABBES ABBEY ABBOT ABEAM ABELE ABETS ABHOR ABIDE ABLER ABLES ABMHO ABODE ABOHM ABOIL ABOMA ABOON ABORT ABOUT ABOVE ABRIS ABUSE ABUTS ABUZZ ABYES ABYSM ABYSS ACARI ACERB ACETA ACHED ACHES ACHOO ACIDS ACIDY ACING ACINI ACKEE ACMES ACMIC ACNED ACNES ACOCK ACOLD ACORN ACRED ACRES ACRID ACTED ACTIN ACTOR ACUTE ACYLS ADAGE ADAPT ADDAX ADDED ADDER ADDLE ADEEM ADEPT ADIEU ADIOS ADITS ADMAN ADMEN ADMIT ADMIX ADOBE ADOBO ADOPT ADORE ADORN ADOWN ADOZE ADULT ADUNC ADUST ADYTA ADZES AECIA AEDES AEGIS AEONS AERIE AFARS AFFIX AFIRE AFOOT AFORE AFOUL AFRIT AFTER AGAIN AGAMA AGAPE AGARS AGATE AGAVE AGAZE AGENE AGENT AGERS AGGER AGGIE AGGRO AGHAS AGILE

But when i fill an array like following the regex detects.

   arrayWords[0]="apcple";
   arrayWords[1]="appa";
   arrayWords[2]="esjdchc";
   arrayWords[3]="csksjce";
   arrayWords[4]="ce";
   arrayWords[5]="jazz";
   arrayWords[6]="classic";
   arrayWords[7]="sjdheiudc";
   arrayWords[8]="no";
   arrayWords[9]="yes";

I dont understand Y?
PLZ someone help me...

Hi all,

I dont why my code is not detecting the matching words.
Firstly Im reading the words from a text file into an array.

Plz help me to make this correct.
This is my code.

import java.util.*;
import java.io.*;
public class TestRegex{
public static void  main(String[] arg)
{

String s="ace";
int i=0;
/*if (s.matches(".*c.*e.*"))
System.out.println("ok");

for(char alphabet = 'A'; alphabet <= 'Z';alphabet++){
 System.out.println(alphabet);
 }
*/
   String[] arrayWords=new String[120];
 /*  arrayWords[0]="apcple";
   arrayWords[1]="appa";
   arrayWords[2]="esjdchc";
   arrayWords[3]="csksjce";
   arrayWords[4]="ce";
   arrayWords[5]="jazz";
   arrayWords[6]="classic";
   arrayWords[7]="sjdheiudc";
   arrayWords[8]="no";
   arrayWords[9]="yes";*/
 try
    {
        FileInputStream fileStm = new FileInputStream("words.txt");
        DataInputStream ins = new DataInputStream(fileStm);// Get the object of DataInputStream
        BufferedReader br = new BufferedReader(new InputStreamReader(ins));
        String line;
        String delims = " ";//Delimeters

        while ((line = br.readLine()) != null)//Read the file Line By Line
        {
                    StringTokenizer st = new StringTokenizer(line, delims,false);//split the line into tokens according to provided delimas
            //numTokens = st.countTokens();//count the number of tokens in the line

            while(st.hasMoreTokens())//if there is a token go into the loop
            {
                            String myToken=st.nextToken();
                            arrayWords[i]=myToken;
                            i++;
            }

        }

                }catch (IOException io)
                {
                    System.out.println("IO exception");
                }

                System.out.println("size : "+i);
                String pattern=".*c.*e.*";
            //  System.out.println(arrayWords[10]);
        String str=null;

        for (int c=0;c<10;c++)
        {
   //  System.out.println(arrayWords[c]);
          str=(String)arrayWords[c];
            if (str.matches(pattern))
            {

            System.out.println(arrayWords[c]);

            }
         }

}

}

No it is not null.
As it is the last node LastNode.next=null.
If there is a way to attach my project folder i can attach it.

i did it.
aLetter is null not let.
i grab the input correctly from the user so when it comes to this
Letter link = new Letter(aLetter,points); line. aLetter and points are not null.

So in the Letter constructor im initiating aLetter and Points.
Then when im retriving why it is null?
I think insert(..) method works fine.

Hi,
i get an NullPointerException in this line:if (let==currentLink.aLetter) in search method.

This is node class

public class Letter {
    char aLetter;
    int points;
    Letter next;

    public Letter(char aLetter,int points)
    {
        this.aLetter=aLetter;
        this.points=points;
    }
       public Letter()
       {

       }
     public String printLink() {
          //  System.out.print("{" + aLetter + ", " + points + "} ");

         return aLetter+" "+points;
    }

}

This is the other class

public class CardClass {
     private Letter head;
   //  private Letter prev;
     private static int size=0;

     public CardClass()
     {
       head=new Letter();

          //prev=new Letter();
     }
 //Returns true if list is empty
    public boolean isEmpty() {
        if (head == null)
            return true;
        else
            return false;
    }
    public void insert(char aLetter, int points) {

            Letter link = new Letter(aLetter,points);

         if (size==0)
            {
               link.next=null;
               head.next=link;
            }
           if (size>0)
           {  
               link.next=head.next;
               head.next=link;
           }
            size++;
    }
    public int getSize()
    {
        return size;
    }
    public void search(char let)
    {       
         Letter currentLink = head.next;

         int i=0;
            while(i<size) {
                if (let==currentLink.aLetter)
                {

                   String str= currentLink.printLink();
                   Start ss=new Start();

                javax.swing.JTextField jj=   ss.getJTextField6();
                jj.setText(str);
                    break;
                }
                    currentLink = currentLink.next;
                    i++;
            }

    }
}

I dont unerstand why.
PLZ someone help me out.

cheers

Thanx.
I'll implement it that way.
Thanx 1ce again

Hi all,

I have givn a task to implement a game.
It has ruls of texa's Holdem poker and the objective is to
make words like scabble.So it is a blend of these 2 games.

So i need to store (Only with 5 letters)words(I dont know whether it is a trie,database,map or what..).
There are about 20,000 words.
What i want do is:
When im providing 2 letters(ex: a,c) the storage should give me all the words
which contains a and c.

PLZ some one give me a way of doing this.
I feel like store all the words in a text file and retrieve word by word and use regular expresssion.
Will it be good in performance wice?
Or give me a better idea of doing this.

PLZ HELP..
Thnx in advance.

I got through this. click on the project you want to run(in order to give focus) and click on the small down arrow near run button : run as:android application.

If u can plz give me a url to study about this. Im confused with this.

Hi !
I am writing simple email client that uses TCP/IP sockets to interact with an SMTP server to send email messages.
this is my code

import java.io.*;
import java.net.*;
import java.util.*;
import java.text.*;  

public class TestSendMail {

  public static void main(String args[]) throws IOException {

     Socket socket;
     DataInputStream dataInput;
     DataOutputStream dataOutput;

     String mailServer = new String("smtp.gmail.com");

     socket = new Socket(mailServer, 587);
     dataInput = new DataInputStream( socket.getInputStream());
     dataOutput = new  DataOutputStream( socket.getOutputStream());

     String sender= "mymail@gmail.com";
     dataOutput.writeBytes("MAIL FROM: " + sender );
     System.out.println( dataInput.readLine() );

     String addressee= "friend@gmail.com";
     dataOutput.writeBytes("RCPT TO: " + addressee );
     System.out.println( dataInput.readLine() );

     dataOutput.writeBytes("DATA");
     System.out.println( dataInput.readLine() );

     dataOutput.writeBytes("This is the first line of testing message.");
     dataOutput.writeBytes("This is the second line of testing message.");
     dataOutput.writeBytes(".");
     System.out.println( dataInput.readLine() );

     dataOutput.flush();
     socket.close();
   }
}

when i am executing it prints only this line and cursor waits....
220 mx.google.com ESMTP x23sm19943471bkw.12

It is not proceeding further.
I dont know why.
Plz help me.