comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * acceptable way to program - 6 messages, 5 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/829184c5bd6bb8b0 * 1 KeyStroke triggering 2 actions? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1ae255c9746878c3 * Splitting a full-duplex socket - 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/51615aee9a18c299 * JTable program - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2954af29fca502b6 * Modifying the parameter Objects passed to RMI server - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e958d8037e335b39 * translate a language that runs on JVM - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/971529a0b6d8122c * Removing those square bytes from a string - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/892d2fba66e8bde8 * Stuff the purple heart programmers cook up - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ff788c5b12bf8d8f * session id is determined by the cookie? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2a2b9a17b4d01adc * Microsoft and Sun JVM ? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dbdadd7a3dd948a4 * java question - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f7cbb5948b4f8b79 * JavaRSS.com 2004: Review of the Year - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76b656a62c7246b4 ============================================================================== TOPIC: acceptable way to program http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/829184c5bd6bb8b0 ============================================================================== == 1 of 6 == Date: Sun, Jan 2 2005 9:19 pm From: Chas Douglass DA Morgan <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: [snip] > It is true. Most of the Java being written against relational > databases doesn't perform and doesn't scale well. [snip] Thats a pretty broad brush you're painting with. Do you have some numbers on which your are basing this claim? It also gives the impression that performance is the most important element of software development, which is certainly not always true. Chas Douglass == 2 of 6 == Date: Sun, Jan 2 2005 4:33 pm From: Sudsy Chas Douglass wrote: > DA Morgan <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > [snip] > >>It is true. Most of the Java being written against relational >>databases doesn't perform and doesn't scale well. > > [snip] > > Thats a pretty broad brush you're painting with. Do you have some numbers > on which your are basing this claim? > > It also gives the impression that performance is the most important element > of software development, which is certainly not always true. Ah, but lack of performance becomes a very /big/ issue! People have become accustomed to a certain level of responsiveness. Are you willing to wait 30 seconds or more for a page to load on the www? Of course not! Based on my personal experience, there's a lot of lousy database programming out there. The language doesn't matter, so we're probably getting OT for a Java ng. The "ad hoc" query support was probably one of the most counter- productive "enhancements" seen in recent years. If you don't know which columns in are table are indexed then you can create a very "expensive" queries or updates. Even creating temporary indices in order to resolve the request can be resource-intensive (disk and CPU). But if you do it right then it /does/ scale well. And if you've got a sharp DBA willing to share their knowledge with the Java developers then you've got a fighting chance to create a solution which is efficient, responsive, and scalable. Disclaimer: I'm not a DBA and never wanted to be; their specialized knowledge can be invaluable, however. == 3 of 6 == Date: Sun, Jan 2 2005 4:20 pm From: Sudsy Chris Smith wrote: <snip> > There is undoubtedly some bad database programming being done by Java > programmers (and by C programmers, and especially by VB programmers, > etc.). Nevertheless, the use of Hibernate doesn't represent poor > database programming practice. What you should look for instead is ay > of the following indicators of poor use of Hibernate: <snip> > Stored procedures are, of course, not any part of relational theory at > all, so it's silly to complain that relational theory is being thrown > out. Use of Hibernate in no way contradicts relational theory. Thanks for pointing out the obvious, Chris. That's not a snide comment, BTW. I cringe when I see code which accesses a database in the worst way possible. I strongly believe that you /need/ to understand how databases work if you're going to program at the JDBC layer. You don't need the same depth of knowledge if you're programming CMP entity EJBs, although it wouldn't hurt. I'm not suggesting that you need to be at the expert DBA level just to create applications which access a database, but you do need to know what's going on "under the covers" so you don't create queries which perform an outer join and take 48 hours to process... ;-) Don't laugh too hard: I've seen it done! Your professional experience in this area makes your advice valuable. I thank you for sharing your thoughts. == 4 of 6 == Date: Mon, Jan 3 2005 6:19 am From: steve On Sun, 2 Jan 2005 18:00:15 +0800, Robert kebernet Cooper wrote (in article <[EMAIL PROTECTED]>): > > steve wrote: >> Hi, >> >> Recently I have been looking at the various ways people are > implementing, >> interaction between java & oracle databases. >> > > >> I have seen people Serializing java objects , such as purchase > orders >> orders, customer records etc , then sticking the "object" into am > oracle blob >> column. >> > > These people are nearly all morons and should be first against the wall > when the revolution comes. > >> >> I'm looking to implement a java front end, (oracle back end), system > ,that >> allows a product , to be inspected by an inspection team , and > comments/ >> photographic record kept. >> >> using an "object approach" would make it very simple, but the size of > the >> resulting object could be very large. >> >> does anyone have any thoughts how to accomplish this task. >> >> >> steve > > Look into using Hibernate or Castor. They are much better solutions. > CMP EEJBs are kinda sorta OK, but not really. Until EJB 3.0 is > available, I still avoid them like the plague. > looked at hibernate, it seems to do mostly what I want, but it's another thing I would have to learn. Castor , didn't seem to fair too well , it get's a real slagging down in various places on the net , seems some people are distinctly un-happy with it. steve == 5 of 6 == Date: Sun, Jan 2 2005 2:45 pm From: "Robert kebernet Cooper" steve wrote: > On Sun, 2 Jan 2005 18:00:15 +0800, Robert kebernet Cooper wrote > (in article <[EMAIL PROTECTED]>): > > > > > steve wrote: > >> Hi, > >> > >> Recently I have been looking at the various ways people are > > implementing, > >> interaction between java & oracle databases. > >> > > > > > >> I have seen people Serializing java objects , such as purchase > > orders > >> orders, customer records etc , then sticking the "object" into am > > oracle blob > >> column. > >> > > > > These people are nearly all morons and should be first against the wall > > when the revolution comes. > > > >> > >> I'm looking to implement a java front end, (oracle back end), system > > ,that > >> allows a product , to be inspected by an inspection team , and > > comments/ > >> photographic record kept. > >> > >> using an "object approach" would make it very simple, but the size of > > the > >> resulting object could be very large. > >> > >> does anyone have any thoughts how to accomplish this task. > >> > >> > >> steve > > > > Look into using Hibernate or Castor. They are much better solutions. > > CMP EEJBs are kinda sorta OK, but not really. Until EJB 3.0 is > > available, I still avoid them like the plague. > > > > looked at hibernate, it seems to do mostly what I want, but it's another > thing I would have to learn. > Castor , didn't seem to fair too well , it get's a real slagging down in > various places on the net , seems some people are distinctly un-happy with > it. > > steve I have always been extremely pleased with Castor. Most of the "slagging" it gets is in the "that's not JDO!" context. In terms of utility and "work" I find it to be much more flexible than Hibernate in many situations. == 6 of 6 == Date: Sun, Jan 2 2005 3:14 pm From: DA Morgan Chas Douglass wrote: > DA Morgan <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > [snip] > >>It is true. Most of the Java being written against relational >>databases doesn't perform and doesn't scale well. > > [snip] > > Thats a pretty broad brush you're painting with. Do you have some numbers > on which your are basing this claim? > > It also gives the impression that performance is the most important element > of software development, which is certainly not always true. > > Chas Douglass Very broad ... and I intentionally said "most" rather than "all" because there is some very good Java being written too. My assessment comes from two sources: The consulting work I have done for a number of Fortune 500 size corporations, and government agencies, in the last 5 years. Much of my time has been spent teaching Java developers that the database is not a bucket full of stuff. Their ignorance leads them too far too often reinvent the wheel or insist on stupid stuff such as XML stored as XML rather than being reconstituted on-the-fly. The other source of my broad brushstroke is teaching at the University of Washington where I regularly get students whose prior experience is Java and whose CIO or IT manager has sent them to learn something about the database. They may be very good at their primary job ... but their profound ignorance of databases is amazing. Addressing your second comment I would not say that performance and scalability are the most important attributes of a program. But when the database is capable of returning a result set in less than a second and the Java developer getting the same result set uses a method that takes 1-5 seconds there is a major problem and not just to the end-user. Often management ends up purchasing far more expensive hardware to compensate for bad design, bad implementation, and a lack of experience. Let me give you some simple examples related to Oracle since that is where this has been cross-posted. How many Java developers in your organization know about the following? EXPLAIN PLAN TKPROF TRACE ANALYZER Bind Variables Multiversion Read Consistency Stored Outlines Hints And that is just the tip of the iceberg. The answer, undoubtedly, is a very small number. And yet no serious Oracle DBA or developer would consider doing much without one or all of them. -- Daniel A. Morgan University of Washington [EMAIL PROTECTED] (replace 'x' with 'u' to respond) ============================================================================== TOPIC: 1 KeyStroke triggering 2 actions? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1ae255c9746878c3 ============================================================================== == 1 of 1 == Date: Sun, Jan 2 2005 4:18 pm From: Russell I am trying to set up some key command to mimic Emacs. For ctrl-k, I want to mark all text to the right of the cursor and then delete it This code marks all the text to the right of the cursor key = KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK); inputMap.put(key, DefaultEditorKit.selectionEndLineAction); This line deletes all marked text inputMap.put(key, DefaultEditorKit.deleteNextCharAction); How can I combine them? What I really want is selectionEndLineAction and deleteNextCharAction. Thanks in advance. This is the first time I am using keymaps. Russell ============================================================================== TOPIC: Splitting a full-duplex socket http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/51615aee9a18c299 ============================================================================== == 1 of 4 == Date: Sun, Jan 2 2005 2:34 pm From: "cyberco" Still no solution.... Anybody any tips? cheers, cyberco == 2 of 4 == Date: Mon, Jan 3 2005 1:31 am From: "Filip Larsen" "cyberco" wrote > Still no solution.... Anybody any tips? If you didn't get my post with suggestions please say so and I will repost it. Regards, -- Filip Larsen == 3 of 4 == Date: Mon, Jan 3 2005 1:51 am From: "Filip Larsen" "cyberco" wrote > Still no solution.... Anybody any tips? And I said > If you didn't get my post with suggestions please say so and I will > repost it. Sorry, didn't see your reply to the post I mention above. I understand you have now think the problem is on the proxy side and not on the client side? This does not makes sense to me, since you said earlier that you want to use a proxy because the sockets on the client did not work in full-duplex. Perhaps you could clarify which setup you know that work and which you know that dont work. Regards, -- Filip Larsen == 4 of 4 == Date: Mon, Jan 3 2005 1:21 am From: Andrew Thompson On Mon, 3 Jan 2005 01:51:47 +0100, Filip Larsen wrote: > "cyberco" wrote >> If you didn't get my post with suggestions please say so and I will >> repost it. > > Sorry, didn't see your reply to the post I mention above. A misunderstanding which could be avoided in future by the OP not trimming *everything* from previous posts, but posting in the style used by Filip and myself, 'in-line posting with trimming'. Note that the 'trimming' refers to trimming any text from earlier messages that is no longer needed in order to give the response a context, as opposed to trimming *all* of the previous text. -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ============================================================================== TOPIC: JTable program http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2954af29fca502b6 ============================================================================== == 1 of 1 == Date: Mon, Jan 3 2005 6:28 am From: steve On Sun, 2 Jan 2005 17:21:43 +0800, Rudi wrote (in article <[EMAIL PROTECTED]>): > I'm a beginner in Java and so a have some trouble's ... I am working > with a JTable (SWING) and have this problem: > > In this case all is good, it's working perfect ! In the table the text > "Planet Jupiter at 7.34 AU" appear in the table ! no problem ! > > > import java.awt.*; > import java.util.*; > import javax.swing.*; > import javax.swing.table.*; > > public class Testtable2 extends JApplet > { > private JTable table_example; > private JScrollPane scroll; > > public void init() > { > Container panel_test = getContentPane(); > > // making the table > table_example = new JTable(20,4); > > > table_example.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); > > > scroll = new JScrollPane(table_example); > > panel_test.add(scroll); > > table_example.setValueAt("Planet Jupiter at 7.34 AU",2,2); > > }} > > Now come my problem !!! > > When i work with a datamodel the text doesn't appear in the table !! > WHY ??? CAN SOMEONE HELP ME ??? THANKS VERY VERY MUTCH !!!!! > > import java.awt.*; > import java.util.*; > import javax.swing.*; > import javax.swing.table.*; > > public class Testtable extends JApplet > { > private JTable table_example; > private juptabelmodel jupitertabel; > private JScrollPane scroll; > > public void init() > { > Container panel_test = getContentPane(); > > // making the table > jupitertabel = new juptabelmodel(); > table_example = new JTable( jupitertabel); > > // making the 3 columns > TableColumn firstColumn = new TableColumn(0); > firstColumn.setHeaderValue( (Object)("This is Column1") ); > table_example.addColumn( firstColumn ); > TableColumn secondColumn = new TableColumn(1); > secondColumn.setHeaderValue( (Object)("This is Column2") ); > table_example.addColumn( secondColumn ); > TableColumn thirdColumn = new TableColumn(2); > thirdColumn.setHeaderValue( (Object)("This is Column3") ); > table_example.addColumn( thirdColumn ); > > > table_example.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); > > scroll = new JScrollPane(table_example); > > panel_test.add(scroll); > > table_example.setValueAt("Planet Jupiter at 7.34 AU",2,2); > > }} > > import javax.swing.*; > import javax.swing.table.*; > > class juptabelmodel extends AbstractTableModel > { > > public Object getValueAt(int iRowIndex, int iColumnIndex ) > { > return null; > } > > public int getColumnCount() > { > return 0; > } > > public int getRowCount() > { > return 20; > } > > } 2 problems i can see int getColumnCount() is returning 0 whilst arrays are offset from zero, you need to remember you are returning the NUMBER of columns, NOT the offset. public Object getValueAt(int iRowIndex, int iColumnIndex ) is returning null. null is null is null, it is not really anything , basically you cannot see "null", so your table is empty!! ============================================================================== TOPIC: Modifying the parameter Objects passed to RMI server http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e958d8037e335b39 ============================================================================== == 1 of 2 == Date: Sun, Jan 2 2005 11:26 pm From: "Tony Morris" > In case of the same JVM it is more efficient(faster) to pass the params by > ref. All Java types are pass by value, always, at all times. -- Tony Morris http://xdweb.net/~dibblego/ == 2 of 2 == Date: Sun, Jan 2 2005 8:32 pm From: "Harish" "Tony Morris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> In case of the same JVM it is more efficient(faster) to pass the params >> by >> ref. > > All Java types are pass by value, always, at all times. > this is getting complicated....let me explain. RMI says the params are passed by value. So, the changes made by an RMI server to a param will not get relflected at the client side. This is because the params are transfered from client process space to server process space. so whatever changes made by the server will not get reflected at the client side. If both client and server are in the same process(VM), client will see the changes made by server because both client and server uses the same object reference. RMI can, instead of passing the parameter, serialize and deserialize the param(there by creating a copy of the param) and then pass it onto server. so the changes made by the server won't be reflected at the client side. this is what is expensive. If the server is not making any changes, then the serialize/deserialize is unnecessary.... > -- > Tony Morris > http://xdweb.net/~dibblego/ > > > ============================================================================== TOPIC: translate a language that runs on JVM http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/971529a0b6d8122c ============================================================================== == 1 of 2 == Date: Sun, Jan 2 2005 3:44 pm From: [EMAIL PROTECTED] If we want to write a language translator that translates one language to another language (Java Source Code or Byte Code) that runs on JVM, which of the following approaches is better? 1) Non-Java Source Code -> Language Translator -> Java Source Code 2) Non-Java Source Code -> Language Translator -> Java Byte Code please advise. thanks!! == 2 of 2 == Date: Sun, Jan 2 2005 4:51 pm From: Phil Staite Unless your "Non-Java Source Code" is very close syntactically and semantically to Java (and if that's the case, why not just write in Java?) I would go with #2. ============================================================================== TOPIC: Removing those square bytes from a string http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/892d2fba66e8bde8 ============================================================================== == 1 of 1 == Date: Sun, Jan 2 2005 3:53 pm From: "Arun" I am trying to take a string from a JTextArea box and then convert it to a document model. It works with most text that i load to it but not to one particular file... this is because it has those square symbols that u see when u open an .exe in a text editor. What can i do to rid of these characters from a string? ============================================================================== TOPIC: Stuff the purple heart programmers cook up http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ff788c5b12bf8d8f ============================================================================== == 1 of 1 == Date: Sun, Jan 2 2005 5:58 pm From: "Ryan Stewart" "Last Timer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You're asking for more: [...] Enough for me. Goodbye. ============================================================================== TOPIC: session id is determined by the cookie? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2a2b9a17b4d01adc ============================================================================== == 1 of 2 == Date: Sun, Jan 2 2005 4:23 pm From: [EMAIL PROTECTED] session is not belongs to the web browser...when the first time a request come from a user to a server the sever automitacally give hime a session.. what ever the browser the user is use. >>u can check this by copyeing the url and paste it in another browser after a successfulyy login-- u see that all the autheticate page you are browsing cockies is used by some of the web hoster to track u .to find that u r browsing their site for the first time or for the seccond time . when basically we check on save pass check box this is save in our hard disk as cockie. so seccond time when we logon to that particuler site that cockie is send user name and password for us. >>u can check this by opening cockie folder what is under document and settings E:\Documents and Settings\UR_USER_NAME\Cookies folder and if u delete a cockie what may e set for yahoo or hotmail so nexttime when u going to logon their pages the auto loging system will not work HTTP protocols are stateless, so one state dont know about other state. session id is nedded to be handeld by server side scipting .usually it is handeld by programer. so it is basically our responsibility to play with a session, check it in every pages.. send it to one page to other u can do that in many when like by checking when u give him the id their is many way u can handel a id, like for a page-the id will valid only in a page in a whole session or for some default timing. if in ur websites theire is no securitu like no user name and login system then u can easily forget aout this session and cockie things bye take care == 2 of 2 == Date: Sun, Jan 2 2005 5:38 pm From: Sudsy [EMAIL PROTECTED] wrote: > session is not belongs to the web browser... <snip body of post which gave me a headache trying to understand...> A session is shared between the client and the server. The client or web browser has to present their credentials every time they attempt to access the server so that the server can associate the request with an existant session. Whether via cookies or URL rewriting, the functionality is the same. You are correct about one thing: HTTP /is/ stateless. Adding state to the conversation is what sessions are all about. ============================================================================== TOPIC: Microsoft and Sun JVM ? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dbdadd7a3dd948a4 ============================================================================== == 1 of 2 == Date: Sun, Jan 2 2005 4:40 pm From: "minhaz" for watching u r applet plzz use applet browser and never try to test java product in ms like j++ of j# this both are implemented by microsoft == 2 of 2 == Date: Mon, Jan 3 2005 1:10 am From: Andrew Thompson On 2 Jan 2005 16:40:48 -0800, minhaz wrote: > for watching u r applet plzz For typing usenet posts please use your 'shift' key where appropriate.. <http://www.physci.org/kbd.jsp?key=shift> Most people would also appreciate if you dropped the 'kewl' abbreviations like 'u r' and 'plzz'. >..use applet browser .. Applet browser is OK for some applet testing but there are many things it cannot do - anything to do with mutliple applets or applet/Javascript interaction for example - it also presents a less restricted security environment for the applet, so some things that work locally in AppletViewer will fail on the net. >..and never try to test java product in ms .. Since IE/Java interaction can be quite 'quirky' it makes perfect sense to test your applets in a Win/IE* combo., if available. * Amongst other browser/VM/OS posibilities. [ F'Ups set to c.l.j.help ] -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ============================================================================== TOPIC: java question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f7cbb5948b4f8b79 ============================================================================== == 1 of 2 == Date: Mon, Jan 3 2005 12:54 am From: paranoid-android i wrote a game in java that runs on my pc. How can i get this to play on my palm zire 72? I have java installed or at least what i think is java ..what would i need to do to this? it is not an applet but a series of java classes in a stand alone game. help anyone? == 2 of 2 == Date: Sun, Jan 2 2005 5:27 pm From: "minhaz" plzz be specifiq with your question. i guess-- >>you developed your game in j2se >>ur palm zire 72 is a pocket pc/palmtop or ?-whatever right? for the handheld device theire is another version of java .you have to write the game on that version that is know as j2me(java 2 micro edition). for the j2me casess u have to sure which version of MIDP and CLDC you have in your pocket pc ============================================================================== TOPIC: JavaRSS.com 2004: Review of the Year http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76b656a62c7246b4 ============================================================================== == 1 of 1 == Date: Mon, Jan 3 2005 1:04 am From: Jay K A look back at the major events of 2004 in Java. Check out: http://www.javarss.com/java-2004-review.html ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.java.programmer To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
