comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Servlet for Connection Pooling in NetBeans & builtin Tomcat - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1896ca46c604d4c * LAMP & J2EE as opposed to LAMP vs J2EE - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/33c89ba6522432dc * JAR Files with Class Paths - 7 messages, 4 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/406a82f012791e11 * Detect Java enabled browser - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eca70cec50baafd * How to put traditional Chinese text into Unicode Oracle 9i database via Internet Explorer - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1071f386bec040d * Splitting a full-duplex socket - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/51615aee9a18c299 * TreeModel - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96a60cb3b850a5bc * VM Error - heap memory problem - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/363218dc7986a594 * Export JTree - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/53cc260384c55b0c * Ant question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fa97e66c00da320 * please I need help on my java Applet - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b9a589a8cfda9bef * Packing JRE - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1a5c7579f5f09e2 * Design pattern(s) for batch processing? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d630ddc9229f91d * Using Java sound API to record to a wav file - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b3e62ca66fa2a7db ============================================================================== TOPIC: Servlet for Connection Pooling in NetBeans & builtin Tomcat http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1896ca46c604d4c ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 1:26 pm From: [EMAIL PROTECTED] (Asad) Hi, I installed Netbeans 4.0 a few days ago and so far pretty impressed by it. Previously I was using Tomat 4.0, and I like the idea of embedded Tomcat 5 that can be managed via the IDE. To get things started, I followed the article here: http://www.netbeans.org/kb/using-netbeans/40/dbconn.html to get a connection pool configured in the included Tomcat 5 web server. Everything in the example works great. However, I don't want to use the taglibs, and would rather write servlets and beans to do the task. I tried following the example listed here: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html however that doesn't work for me (I get foo -1 or something; basically its not working). So I was wondering if someone could kindly provide me a simple servlet that works in the Netbeans IDE so I can simply extend on the tutorial here: http://www.netbeans.org/kb/using-netbeans/40/dbconn.html and and draw connection from the tomcat 5 connection pool having configured everything perfectly in this tutorial. Basically do the same thing as: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> <sql:query var="queryresults" dataSource="jdbc/poolDB"> SELECT * FROM t_emp ORDER BY upper(f_name) </sql:query> <table border=1> <tr> <th>First</th><th>Last</th> </tr> <c:forEach var="row" items="${queryresults.rows}"> <tr> <td><c:out value="${row.f_name}" /></td> <td><c:out value="${row.l_name}" /></td> </tr> </c:forEach> </table> but in a servlet rather than using the tag library. Very much appreciated! ============================================================================== TOPIC: LAMP & J2EE as opposed to LAMP vs J2EE http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/33c89ba6522432dc ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 1:59 pm From: "Robert kebernet Cooper" Ross M. Greenberg wrote: > I'm considering starting off discussing LAMP and its interpretive nature as > opposed to J2EE's compiled nature......... > That's really not a valid comparison anymore. Since the Zend stuff went into PHP, it is JIT compiled just like Java. Also remember, both of these are JIT compiled. While you can use gcj to machine-code compile a J2EE app, it is very rarely done. ============================================================================== TOPIC: JAR Files with Class Paths http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/406a82f012791e11 ============================================================================== == 1 of 7 == Date: Fri, Dec 24 2004 2:11 pm From: "Jonathan" Yeah, totally man. The only difference between linux and windows I'm aware of is the ; separator on the path as opposed to, I believe, the : I've included jars before and it's worked fine. == 2 of 7 == Date: Fri, Dec 24 2004 11:12 pm From: ByteCoder kjc wrote: > The VM is not seeing your classpath for reasons i'm unaware of. > Since i'm on a Linux platform, i've gone as far as I can. > Any windows guys monitoring this thread. > > Jonathan wrote: > >> This is what I was doing: >> >> C:\physioclinic\dist>java -cp >> C:\physioclinic\dist\mysql-connector-java-3.0.15-g >> a-bin.jar -jar scheduler.jar Yes. I had the same problem a while back. Back then I solved it by putting the driver in my own jar file. -- ------------- - ByteCoder - ...I see stupid people ------------- Curiosity *Skilled* the cat == 3 of 7 == Date: Fri, Dec 24 2004 11:53 pm From: Lee Fesperman kjc wrote: > > The VM is not seeing your classpath for reasons i'm unaware of. > Since i'm on a Linux platform, i've gone as far as I can. > Any windows guys monitoring this thread. > > Jonathan wrote: > > This is what I was doing: > > > > C:\physioclinic\dist>java -cp > > C:\physioclinic\dist\mysql-connector-java-3.0.15-g > > a-bin.jar -jar scheduler.jar > > > > java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Sun's JVM ignores any classpath info when -jar is used. Just put everything in the classpath and don't use -jar. -- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) == 4 of 7 == Date: Fri, Dec 24 2004 4:31 pm From: "Jonathan" You mean I should deploy my application as a bunch of class files..? == 5 of 7 == Date: Sat, Dec 25 2004 1:23 am From: Lee Fesperman Jonathan wrote: > > You mean I should deploy my application as a bunch of class files..? If you mean putting all needed classes files in one jar, that is one solution. Another choice would be to use the classpath capabilities of the jar manifest file. I haven't used that solution, so check the docs to see if it will help. -- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) == 6 of 7 == Date: Fri, Dec 24 2004 6:38 pm From: "Jonathan" Using the classpath of the jar manifest file was one of my original problems. Specifying the classpath within the manifest results in the jar being unable to find the main-class, even though it's specified in the manifest and included in the jar. == 7 of 7 == Date: Sat, Dec 25 2004 2:47 am From: "Ann" "Jonathan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Using the classpath of the jar manifest file was one of my original > problems. Specifying the classpath within the manifest results in the > jar being unable to find the main-class, even though it's specified in > the manifest and included in the jar. did you try relative path in your classpath or absolute path try the other one ============================================================================== TOPIC: Detect Java enabled browser http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eca70cec50baafd ============================================================================== == 1 of 3 == Date: Fri, Dec 24 2004 4:11 pm From: "Ryan Stewart" *fixed top post* "SPG" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Ryan Stewart" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I'm working on a project to collect usage statistics, and I'm looking for >> a way to detect whether a browser has a Java plugin. I'll be writing it >> in Java, and am quite familiar with J2EE, or at least the servlet corner >> of it. Ideally, I'd like something I can JAR up and drop in an >> application and have it collect data. Obviously I can't quite get away >> with that, but that's the direction I'm going with it. So... anyone have >> experience with this? Can I get Java version and such? >> > This will do what you want.. > Obviously, once you have the VM properties, you can do with them as you > please.. Like post them back to a servlet or external service etc.. > *snip applet* That would work, I suppose, but I'm hoping to find something less intrusive. == 2 of 3 == Date: Sat, Dec 25 2004 1:32 am From: ByteCoder Ryan Stewart wrote: > *fixed top post* > "SPG" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>"Ryan Stewart" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >>>I'm working on a project to collect usage statistics, and I'm looking for >>>a way to detect whether a browser has a Java plugin. I'll be writing it >>>in Java, and am quite familiar with J2EE, or at least the servlet corner >>>of it. Ideally, I'd like something I can JAR up and drop in an >>>application and have it collect data. Obviously I can't quite get away >>>with that, but that's the direction I'm going with it. So... anyone have >>>experience with this? Can I get Java version and such? >>> >> >>This will do what you want.. >>Obviously, once you have the VM properties, you can do with them as you >>please.. Like post them back to a servlet or external service etc.. >> > > *snip applet* > > That would work, I suppose, but I'm hoping to find something less intrusive. Why would that be intrusive? If the applet can't get those properties due to security restrictions there's no harm done. I can't think of any other way to do this. -- ------------- - ByteCoder - ...I see stupid people ------------- Curiosity *Skilled* the cat == 3 of 3 == Date: Sat, Dec 25 2004 4:29 am From: Andrew Thompson On Sat, 25 Dec 2004 01:32:54 +0100, ByteCoder wrote: > Ryan Stewart wrote: >> *snip applet* >> >> That would work, I suppose, but I'm hoping to find something less intrusive. > > Why would that be intrusive? If the applet can't get those properties > due to security restrictions there's no harm done. I can't think of any > other way to do this. To check what you can and can't find out from an unsigned Applet, check JTest. <http://www.physci.org/pc/property.jsp> -- 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: How to put traditional Chinese text into Unicode Oracle 9i database via Internet Explorer http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1071f386bec040d ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 6:13 am From: steve On Thu, 23 Dec 2004 13:18:08 +0800, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > Hello wisers, > > We are testing a system which is developed on top of Oracle 9iAS. The > client PCs are using Internet Explorer to access the system. We are > sure that the Oracle 9i database server is set to use Unicode. The > Oracle 9i database server and Oracle 9iAS server are now running on > English Windows 2000 server. With client PCs running on traditional > Chinese Windows 2000 or traditional Chinese Windows XP, via Internet > Explorer we put traditional Chinese text into the system then query the > data again, it displays in inverted question marks. > > 1. How to resolve the problem? > 2. Does the Internet Explorer View -> Code Unicode (UTF-8) setting > controls content display as well as keyin? > 3. Or the system controls the code interpretation of keyin? > Thanks, > > Bruce > 1.wrong group. 2. you have to use a utf8 char set inside the database. ( this has NOTHING TO DO WITH the char set on the clients of the server.) 3. you may have to re-build hte database from scratch , using export , then import. ============================================================================== TOPIC: Splitting a full-duplex socket http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/51615aee9a18c299 ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 2:40 pm From: "cyberco" I'm certain that some phones don't support full-duplex sockets while others do. I'm not 100% sure whether the former do support simultaneously writing and reading over seperate sockets. That is something that is hard to find out from the specs. That's why I'm going to implement it and see if it works. J2ME does support ServerSockets. Besides the discussion whether phones support simultaneous socket communication I'm still interested in ideas about how to 'split' a full-duplex socket into seperate read and write sockets. Thanks for your help, Cyberco ============================================================================== TOPIC: TreeModel http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96a60cb3b850a5bc ============================================================================== == 1 of 2 == Date: Fri, Dec 24 2004 4:25 pm From: "Arun" Hi, My program starts by loading an xml file to a JTree. It does so by building up a rootNode, adding this to a TreeModel to the JTree. Like buildTree = new JTree(treeModel). How do i go about loading a complete new xml file, which creates a complete new rootNode etc, which will in turn change the contents of the JTree. I tried adding this new rootNode to the treemodel, but this doenst update the JTree. == 2 of 2 == Date: Fri, Dec 24 2004 5:12 pm From: "Arun" Ok i did it. Just overwrote the treemodel then used jtree.setModel(model) to refresh. ============================================================================== TOPIC: VM Error - heap memory problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/363218dc7986a594 ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 6:06 pm From: Surendra Singhi John C. Bollinger wrote: > Surendra Singhi wrote: > >> Hi, >> I am using Java on a windows xp machine. Recently while writing a >> program which takes large amount of memory I ran into this runtime >> error. And it is giving me nightmares, as I have a very important >> deadline to meet. >> The program takes large amount of memory so I tried increasing the >> heap size and set the following options for the vm >> -verbosegc -ms128m -mx128m > > > Your limits there aren't really that big. On the other hand, the GC > output you posted doesn't show your program coming anywhere near using > it all. > >> Also, at one or two places I am explicitly calling gc, to help free up >> some memory. > > > That should never be necessary. It is also unlikely to be related to > your problem. > >> The time the program will take to execute is not a >> concern as long as it runs smoothly. >> >> Attached is a part of the trace of the gc run and the run time error. > > > Snipped automatically by my newsreader because you put it in your > signature. In any case, the VM is reporting an internal error. This > most likely indicates one of: a bug in the VM, corrupted VM or class > files (system or user), or some kind of unrecoverable error in native > code. I would try the application on a different system first, > preferably the cleanest one you can find. > >> How to fix this bug? And is it memory allocation which is causing it? > > > The bug is unlikely to be caused by Java memory allocation -- if Java > cannot allocate enough memory then it throws an OutOfMemoryError. If > you're doing any JNI then I would look there first for a bug. It is > possible that there is no bug in your code. Do note that the error > message asks you to report the incident as a VM bug, although it might > be a bit hasty to do that without verifying that you can duplicate it in > a clean environment. > > > John Bollinger > [EMAIL PROTECTED] Thanks for all your answers. I reported this bug to Sun and I got the following response: "Thank you for using our bug submit page. The bug you have reported appears to be a duplicate of the Bug ID: 5009717. For more information on this, please refer to this bug at: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5009717 " There was no problem with the code, it was an incompatibility issue between code compiled in different version of jvm(i.e. 1.4.05) and being run using a newer version of jvm(1.4.06). -- Surendra Singhi www.public.asu.edu/~sksinghi/ ============================================================================== TOPIC: Export JTree http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/53cc260384c55b0c ============================================================================== == 1 of 2 == Date: Fri, Dec 24 2004 6:20 pm From: "Arun" Anyone know how to get the top root node of a JTree, either from that container or from the TreeModel it is using? == 2 of 2 == Date: Fri, Dec 24 2004 8:24 pm From: "Michael Wong" "Arun" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Anyone know how to get the top root node of a JTree, either from that > container or from the TreeModel it is using? You really need to check the API documentation and/or tutorials before posting all your questions on this newsgroup. See the following, in particular the "getRoot" method. http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/tree/TreeModel.html ============================================================================== TOPIC: Ant question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fa97e66c00da320 ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 7:42 pm From: "Arun" Does ant ever include text inside two tags. For example: <build> is there ever text in here </build> I never see a build file with text between tags, only tags with attributes. ============================================================================== TOPIC: please I need help on my java Applet http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b9a589a8cfda9bef ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 4:38 am From: Andrew Thompson On Fri, 24 Dec 2004 10:37:31 -0500, java10 wrote: .. > if (e.getSource()!= AddItem) > { > JOptionPane.showMessageDialog(frame, "Sorry You Must > Purchase > Something","Cannot be empty",JOptionPane.ERROR_MESSAGE); You seem to be ignoring the advice (tabs, line-wrap, the usual..) I offered re posting code examples.. -- 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: Packing JRE http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1a5c7579f5f09e2 ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 4:47 am From: Andrew Thompson On 24 Dec 2004 16:17:23 GMT, [EMAIL PROTECTED] wrote: > Andrew Thompson <[EMAIL PROTECTED]> wrote: (JD) >>> There are, in fact, quite a few good reasons for wanting to deliver to >>> a customer a native .exe with everything statically compiled into it. >> >> Would you care to list them for the purposes of progressing >> this thread, or are they secret? > > Here are a few reasons, .. (I've snipped 1 and 3, since I do not disagree) .. > 2. The size of the JRE may be a burden for many end users who may find > themselves on dial up or metered access to the Internet. .. True, but weight that up for 20 Java based applications. You may need to include a Meg or two of the JVM with the each native executable (sometimes the same classes, sometimes different). By the time the user has installed 15-20 such apps., the total download size of the 20 native executables will be larger than 20 JWS apps. and 1 JVM. So, I am generally taking the wider view. Make a JWS app. that ultimately benefits the *user*, rather than a native exe that plays into the user's misplaced caution of anything new. .. > Whew! I didn't expect this to end up so long. .. The most interesting threads are like that. ;-) -- 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: Design pattern(s) for batch processing? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d630ddc9229f91d ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 5:10 am From: fishfry I'm redesigning a bunch of batch feeds for an IT org. I was wondering if there is any literature on design patterns for batch processing, ie command-line programs that read a record, do something, read the next record, etc. Also, where besides this newsgroup can people ask design-type questions that might not even be language-specific? Most of my Java questions seem to be along the lines of what's the object-oriented way to do things, rather than specific language questions. ============================================================================== TOPIC: Using Java sound API to record to a wav file http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b3e62ca66fa2a7db ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 10:47 pm From: Phil Staite Look into javax.sound.sampled.* You'll want to check out the AudioFormat class. You fill one in, something like: // set up for simple low-rate mono recording float rate = 11025; int samplesSizeInBits = 8; int channels = 1; boolean signed = true; boolean bigEndian = false; AudioFormat af = new AudioFormat( rate, sampleSizeInBits, channels, signed, bigEndian ); DataLine.Info dli = new DataLine.Info( TargetDataLine.class, af ); TargetDataLine recLine = (TargetDataLine) AudioSystem.getLine( dli ); recLine.open( af ); recLine.start(); // then start reading in buffers byte[] buffer = new byte[11025 * 10]; // say 10 sec worth of audio data int count = recLine.read( buffer, 0, buffer.length ); if( count > 0 ) // process audio data else // WTF happened? If you think this looks ugly, believe me, working with the java audio interface is a lot easier than working with say the raw Windows audio interface... It is both fragile and unforgiving... ============================================================================== 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
