Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Emile Ghazzawi

Greenhorn
+ Follow
since Dec 30, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Emile Ghazzawi

That's nearly right, but the problem is not a case of how many timers i want. I am trying to name the timer according to an ID field in a database so i do not know how many i will need in advance.

For example if the ID field is 99 i want it's associated timer to be called timer99, that way i can easily link the two objects in my code and cancel the timer if needed or generate new timers on the fly when new IDs are created. Does that make any sense?

I appreciate your help with this, i just though there might be an easy way i was completely overlooking, but it seems this might not be the case.
14 years ago
Hi,

Is it possible to assign a variable value to the name of a new object. For example:



I want the newTimer object to be called newTimer4, is there a way to include the variable value in the name declaration. I have tried all sorts but cannot seem to do it!

Thanks in advance for any help!
14 years ago
Thanks Jeanne, i got it sorted in the end after much tinkering around.

I'm not quite sure what was wrong or how i fixed it, but for now all that matters is it works! :-D

Thanks again for your help.
I can build the ImageIcon before it goes to the database and i can successfully write the image to a file from Access using a FIleOutputStream, to confirm it is stored correctly.

When i print the byte[] array it seems to be filled with random numbers so i am assuming that it contains the correct contents. This is something that really has me puzzled.

Is the code i posted the right way to go about retrieving the bytes from Access and converting them to an ImageIcon?
I have successfully placed an image into MS Access with Jeanne's kind help, but i am having problems getting it back out again.

Is this something anybody can help me with? The code i am using is below.



Thank you in advance for your help!
I understand the concept and logic behind RMI Callback i am just struggling to understand how i change my current RMI code to make it happen.

Could someone please explain the steps necessary to do so. I am a complete Java beginner way out of my depth here but it is something that i would really like to understand and get working!

Any help is much appreciated.
14 years ago
I have created an application that uses RMI with a Client and a Server. They can both communicate effectively but i would like to implement RMI Callback so that the Server can pass back messages and invoke methods on the client.

I have looked at numerous RMI callback examples but they are often poorly explained or use long winded examples, all of which are going completely over my head.

My question is: Are there some simple steps or lines of code that can be added to add RMI Callback functionality to an exisiting RMI implementation?

Any help or examples would be hugely appreciated.

Thanks in advance!
14 years ago
Thank you, your solution worked perfectly!

The only problem i am having now is when i retrieve the byte array from access and pass it into an ImageIcon i get a null pointer exception. I have output the contents of the array and it has been populated with data.

Any ideas???

Thanks once again!
I have successfully converted an image into a byte[] array which i am then trying to store in an MS Access database in an OLE Object Field.

I am using a statement.executeUpdate SQL statement to insert my data along with teh byte[] array into the database. I do not know if this is the correct way of doing it, but i cannot find any helpful examples or documentation for my problem.

It keeps returning the error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Missing ), ], or Item in query expression '[B@1667df0)'

My code is below:



Thanks in advance for any help!

[added line breaks so screen doesn't scroll right]
[ March 31, 2007: Message edited by: Jeanne Boyarsky ]
Thank you Vu Lee - i totally missed it. I had used a different ResultSet but forgot to update the rest of the code to point to it.

You were very diligent in spotting that, more so than me! :-)

Thanks once again!

Emile
I have a program that is retrieving data from a database into a ResultSet. The result set is then read into a Vector to be passed back to the calling method.

After much tinkering i have failed to solve the ResultSet is Closed error that keeps being generated, it is simply driving me mad!

I'm hoping that one of you can help me from going insane.

My code is below:



Thanks in advance for your help!
[ March 30, 2007: Message edited by: Emile Ghazzawi ]
Hi there,

Can someone please explain to me what a JavaBean is, how to create one and maybe some example code of one and how it is used???

Any help would be much appreciated as i'm supposed to construct a JavaBean but don't even know what one is!

Cheers,

Emile
16 years ago
Hi,

Thanks for you help everyone, i solved the problem in the end. Somehow i had stupidly put a vector inside another vector, thats why it wasn't working!

Cheers,

Emile
16 years ago
Hi,

I have tried the instanceof method and it simply returns that it as an object? Although in Microsoft Access the field is set up as an integer!? Any other ideas would be greatly appreciated! I am fairly new to this so i may have missed something very obvious!

Thanks,

Emile
16 years ago
Hi,

I want to call a Java application i have created from within the code of another Java application. Both of the class files will be in the same folder! Is this possible? If so, how?

Thanks for any help,

Emile
16 years ago