James Redpath

Greenhorn
+ Follow
since Aug 02, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by James Redpath

Well looks like I had to do it after all. What you need to do is create the Socket without opening it (connecting). Then pass it to a thread testing its status after a sleep (specified). Meanwhile returning back open the socket. The thread then awakes and tests to see if it not null, if so then closes which causes an exception caught by the parent opening socket. Here it is:


[ April 07, 2005: Message edited by: James Redpath ]
I certainly would like to do that as well. The problem is all the options are for after the socket is created and most have to be Java 1.3 or higher. When you create a socket and the location does not exist (wrong IP or port), then you wait for a much longer time on Sun Solaris than XP. The default time for Solaris is 3 minutes (190 seconds), but this can be adjusted using ndd command all the way down to 10 seconds. As I recall Sun does not recommend making it lower than 30 seconds. The wait cannot be adjusted for XP. The only way I see is a thread which waits a specific time and throws an exception. I am considering this but its messy. I would like to see your thread if you have done this. Meanwhile, looks like I�m going to do it.
Look at Sun Bug document 4283424 (http://online.sunsolve.sun.co.uk) for Allocation, static method performance issues uncovered; when you have multiple CPUs on a machine and use static methods in threads there is a problem but this only says something about Java 1.2. What about 1.4?

Does anybody know about Java 1.4?
20 years ago
Look up JOONE on the Internet (Java Object Oriented Neural Network). This is the way to recognize patterns.
20 years ago
Go for option 2 Pascal-Pl/SQL Oracle. Yes, it is true that Pascal is not used much; however, Pascal is taught to develop your logical thinking, a training in computer science. Also you need to know SQL not only PL/SQL but understanding the structure, syntax, and calls of this query language into a language like PL will help in using JDBC in the future. You must understand a Database first (i.e., understanding DDL vs. DQL, cursors, connections, etc.) before using JDBC or you will fall into the many pitfalls that many make in poor programming.

I know Java is sexy now and you want to jump in, but build a solid foundation first or you will be like the many poor programmers we have today.
20 years ago
For Oracle JDBC the key for Apache Jakarta Tomcat 5 is to place the classes111.zip file in the subdirectory common/lib with the jar extension. So rename the Oracle file classes111.zip to classes111.jar and copy to <installed directory>/common/lib/classes111.jar. Then stop and restart the server. It should work.
20 years ago
I found it I was using a Canvas and drawing the ImageIcon. Instead I used a JLabel with ImageIcon and it fixed it. This made it less complicated as well. I forgot that SWING now provides ImageIcon use with a label.
21 years ago
Correct that was it. I never disconnected from the database which would provide a commit.
I have ran into this myself. Here's the story from Oracle. The drivers do not have finializer methods; cleanup routines are performed by the close() method of the ResultSet and Statement classes. If you do not explicitly close your ResultSet and Statement objects (I stress AND here), serious memory leaks could occur. Plus you could run out of cursors in the database. (this has happen to me). Closing the result set or statment releases the corrsponding cusor in the database. So close for each rs/stmt, your connection will still stay open! Then create rs/stmt again
s = new String("Select * from user_tables");
Try{ stmt=conn.createStatement();
rs = stmt.executeQuery(s);
rs.close();
stmt.close();
}catch (SQLException sqle) {}
.... some building of new string
Try{ stmt=conn.createStatement();
rs = stmt.executeQuery(s);
rs.close();
stmt.close();
}catch (SQLException sqle) {}
Solaris 2.8
Hardware Sun Microsystems
Oracle 8.1.6
Java 1.4
Oracle JDBC class111.zip
I have a Java application that creates a JDBC connection to Oracle database and queries a table called foo, printing out the values. The table has three columns. I the do the following:
1. I close the resultset and statement, etc. and terminate the program.
2. I go into Oracle sqlplus session and drop the table foo and recreate the data (insert).
3. I re-run the Java application and the resulting query is 0 rows; No errors.
4. I stop and start the Oracle listener and retry the java application with not result.
5. I stop the Oracle listener and shutdown the Oracle database.
6. I startup the Oracle database and Oracle listener.
7. I run the Java application again and it gets the new data.
How to prevent restart of database for change in tables?
I have a JTabbedPane with three tabs. The First and Third tabs have an ImageIcon (each different instance). When the Frame (DialogFrame) first comes up the ImageIcon in Tab 3 shows through on top of Tab 1. Now when you select the Tabs 3 and then 1 the ImageIcon is then fixed and not seen-through to the first tab. How to fix? I don't want to see the Tab 3 ImageIocn in Tab 1. For testing I have tried using the same ImageIcon instance in Tab 1 also in Tab 3 and it still does the same behavior.
[ August 17, 2003: Message edited by: James Redpath ]
21 years ago
If you have Oracle 8.1.7 you don;t have to down load anything when you install it. The JDBC jar classes are installed in the directory named jdbc. SImply copy this file typically called class111.jar and include in your CLASSPATH variable.
Have you tried setting the setLightWeightPopupEnabled(false)
for the JPopupMenu instance after creating the popup menu?
The default is true and may be behind your table.
popup.setLightWeightPopupEnabled(false);
21 years ago