comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Using com.sun.tools.javac.Main() for compiling - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/894f2738d346f374 * Is it possible to set a block of code as non-JIT area? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efa6df384a75654c * use com port as parallel port - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/43f0abc240232d51 * Filtering only punctuation and currency - 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e10f354fb93fb6b7 * CORBA or some other methodology? - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7b217bf697c503b * How can I "force" an upcast? Convert subclass into superclass? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ad4bc9f7ae03de71 * Is "String s = "abc";" equal to "String s = new String("abc");"? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57b8aacdcf136f3f * SAX parser ignores part of XML document - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e5f90c18abffc3c4 * Class and interface loading order - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dc413d1e05db6fe * JBoss to go closed source? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a8dda54906ca8df * Font selection dialog - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3828c43244e7a4b0 * JSP Beginner - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/92c9e31fd2ca8594 * HTTPUnit not working against an https (SSL) site - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8d793f5e72fb7839 * validating classpaths - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9ee9967e34de9e2c * For JDBC juru - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e52944e7550b105f * I wrote my own Java in BASIC ! ! ! - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/29ec22b23b7d5d6d * External packages - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bae8c29cb5e57bba * Mars Rescue Mission Challenge - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9531033f5615f411 * UnsupportedEncodingException - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f05a57f2fc1fbd14 * converting unicode to UTF-8 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a237715716e67cc1 ========================================================================== TOPIC: Using com.sun.tools.javac.Main() for compiling http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/894f2738d346f374 ========================================================================== == 1 of 2 == Date: Fri, Nov 19 2004 8:24 am From: [EMAIL PROTECTED] (Jesper Sahner) Hi! I want to create a dynamic class "on the fly". For this I use: String[] s = {"Myclass.java"}; (new com.sun.tools.javac.Main()).compile(s); This works fine. The code reads the .java-file and creates the .class-file. No problem. Now I wonder if the same thing can be done without using external files. The source-code for the .java-file could be held in e.g. a String-object, and the byte-code as a result of the compilation could be parsed to a ClassLoader-object. However I don't how to do this, but I think it must be possible. Any ideas? Regards, Jesper == 2 of 2 == Date: Fri, Nov 19 2004 9:29 am From: "Fahd Shariff" <[EMAIL PROTECTED]> You could create a Temporary file which you can delete later on. Or you can look at javac's source code and see if there is any other method that might do what you are looking for... -- Fahd Shariff http://www.fahdshariff.cjb.net "Let the code do the talking... " ========================================================================== TOPIC: Is it possible to set a block of code as non-JIT area? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efa6df384a75654c ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 8:31 am From: Samuel Penn <[EMAIL PROTECTED]> jacksu wrote: > "Chris Uppal" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... >> jacksu wrote: >> >> > For the rest of the code, I would like the JIT to do the magic, but >> > for certain portion of the java code, I would make it untouched by the >> > JIT. >> >> Since there's no mention of the JITer in either the Java standard or the >> JVM standard (i.e. the use of a JIT, or any alternative technology is >> purely an >> implementation detail) there can be no standard way of doing that. Any >> such feature would be provided by the /specific/ implementation of the >> JVM that you >> are using. Perhaps as a runtime -XX option that specified a file >> containing a list of methods that should/should not be optimised. >> >> It's not an inherently silly thing to want, but I don't know of any JVM >> implementation that provides it -- probably because there's little need >> for it in general. Standard Sun JVM does this. We had a problem in 1.3 with hotspot causing an infinite loop in one class, and Sun recommended disabling hotspot on that class. There's a file you can stick directives in to tell hotspot how to behave. I can't remember how we did it, but a google of "prevent hotspot compiling of class" finds the following: http://jguru.com/faq/view.jsp?EID=710838 Which sounds similar to what we did. -- Be seeing you, http://www.glendale.org.uk/ Sam. jabber: [EMAIL PROTECTED] Listening to: Hans Zimmer and Lisa Gerrard - Am I Not Merciful? ========================================================================== TOPIC: use com port as parallel port http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/43f0abc240232d51 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 9:48 am From: Graeme Hill <[EMAIL PROTECTED]> Please remember that according to the RS232 specification, a 1 (high bit) is a NEGATIVE voltage with respect to ground - between perhaps -5 and -15 volts. A 0 (low bit) is POSITIVE with respect to ground, again e.g. +5 to +15 volts. Paralell ports, on the other end, will typically operate at TTL voltages e.g. 0 V is 0(low) bit, +5V is 1(high) bit. If you don't know what you doing, you will almost certainly fry your RS232 port. More info e.g. http://www.sangoma.com/signal.htm On Fri, 19 Nov 2004, Babu Kalakrishnan wrote: > b3ny wrote: > >>So while you cannot control the state of the TxD pin (or read that of > >>the RxD pin) programmatically, all the remaining pins (DTR and RTS as > >>outputs and DSR,CTS,DCD and RI as inputs) can be controlled / read > >>asynchronously from the PC. > > > > > > tell me how it works??? > > how di i have to config the comm api? > > maybe a little source code example? > > > > Check out the API for the javax.comm.SerialPort class. You have the > setDTR(), setRTS() methods to set the output bits and the > isDSR(),isCTS(), isCD(), isRI() methods for reading the bits. > > BK > ========================================================================== TOPIC: Filtering only punctuation and currency http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e10f354fb93fb6b7 ========================================================================== == 1 of 4 == Date: Fri, Nov 19 2004 9:46 am From: Glenn Meter <[EMAIL PROTECTED]> I've got a case where I want to build a MaskFormatter that only accepts punctuation and currency symbols. In looking at the APIs, it seems easy to test if a character is a punctuation or currency symbol. But I'm not finding APIs to get the list of punctuation and currency symbols programatically. I just need something that will return the characters as a String. It seems like this should be easy. What stupid thing am I missing? Thanks, Glenn == 2 of 4 == Date: Fri, Nov 19 2004 10:03 am From: Michael Borgwardt <[EMAIL PROTECTED]> Glenn Meter wrote: > I've got a case where I want to build a MaskFormatter that only accepts > punctuation and currency symbols. > > In looking at the APIs, it seems easy to test if a character is a > punctuation or currency symbol. But I'm not finding APIs to get the list > of punctuation and currency symbols programatically. I just need > something that will return the characters as a String. It seems like > this should be easy. What stupid thing am I missing? That's just not how the characters and character classes are defined in Unicode or Java. But it's simple enough to loop over all the 2^16 Java chars, call the classification methods in java.lang.Character for each of them and build the String for yourself. Do that once and save the result in a file somewhere. == 3 of 4 == Date: Fri, Nov 19 2004 11:26 am From: "Ann" <[EMAIL PROTECTED]> "Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Glenn Meter wrote: > > I've got a case where I want to build a MaskFormatter that only accepts > > punctuation and currency symbols. > > > > In looking at the APIs, it seems easy to test if a character is a > > punctuation or currency symbol. But I'm not finding APIs to get the list > > of punctuation and currency symbols programatically. I just need > > something that will return the characters as a String. It seems like > > this should be easy. What stupid thing am I missing? > > That's just not how the characters and character classes are > defined in Unicode or Java. > > But it's simple enough to loop over all the 2^16 Java chars, > call the classification methods in java.lang.Character for > each of them and build the String for yourself. > > Do that once and save the result in a file somewhere. Maybe you can subclass isISOControl() in Character.java --- /** * Determines if the specified character is an ISO control * character. A character is considered to be an ISO control * character if its code is in the range <code>'\u0000'</code> * through <code>'\u001F'</code> or in the range * <code>'\u007F'</code> through <code>'\u009F'</code>. * * @param ch the character to be tested. * @return <code>true</code> if the character is an ISO control character; * <code>false</code> otherwise. * * @see java.lang.Character#isSpaceChar(char) * @see java.lang.Character#isWhitespace(char) * @since 1.1 */ public static boolean isISOControl(char ch) { return (ch <= 0x009F) && ((ch <= 0x001F) || (ch >= 0x007F)); == 4 of 4 == Date: Fri, Nov 19 2004 2:21 pm From: Glenn Meter <[EMAIL PROTECTED]> Thanks for the tips. In the end, it was easiest for me to just create my own formatter: DefaultFormatter nonAlphanumericNonWhitespaceFormatter = new DefaultFormatter() { public String valueToString(Object o) { return o.toString(); } public Object stringToValue(String s) throws ParseException { int strLen = s.length(); for (int i = 0; i < strLen; i++) { char curChar = s.charAt(i); if (Character.isLetterOrDigit(curChar) || Character.isWhitespace(curChar)) { throw new ParseException(s, i); } } return s; } }; nonAlphanumericNonWhitespaceFormatter.setAllowsInvalid(false); JFormattedTextField myFormattedField = new JFormattedTextField( new DefaultFormatterFactory( new DefaultFormatter(), new DefaultFormatter(), nonAlphanumericNonWhitespaceFormatter)); Glenn ========================================================================== TOPIC: CORBA or some other methodology? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7b217bf697c503b ========================================================================== == 1 of 2 == Date: Fri, Nov 19 2004 10:00 am From: [EMAIL PROTECTED] (Ted Holden) On Thu, 18 Nov 2004 19:28:40 +0100, Bruno Grieder <[EMAIL PROTECTED]> wrote: >Cannot be simmpler: www.xmlrpc.com >and for C/C++ >http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-c.html > >Bruno Thanks! One other question. XMLRPC and SOAP/AXIS have been suggested here as alternatives to CORBA. There is one other thing which CORBA does which I might or might not need for this particular application but which is nice to have as a general rule, and that is to maintain some notion of state in the sense that an application which needs one generates an object of a particular type for itself and holds onto it as long as it needs it for whatever it is doing, which might require a number of method calls for the object being used and not just one. State is maintained in the objects data members while that is going on. Do xmlrpc and/or SOAP/Axis have this same capability? In particular, the documentation for xmlrpc appeared to be a little thin and it wasn't totally obvious. == 2 of 2 == Date: Fri, Nov 19 2004 10:13 am From: [EMAIL PROTECTED] (Ted Holden) On 19 Nov 2004 03:25:39 -0800, [EMAIL PROTECTED] (Dave Monroe) wrote: >Take a look at 'axis' from apache.org. > >Interoperability issues, these days, can often be addressed by web services. Thanks! One other question. XMLRPC and SOAP/AXIS have been suggested here as alternatives to CORBA. There is one other thing which CORBA does which I might or might not need for this particular application but which is nice to have as a general rule, and that is to maintain some notion of state in the sense that an application which needs one generates an object of a particular type for itself and holds onto it as long as it needs it for whatever it is doing, which might require a number of method calls for the object being used and not just one. State is maintained in the objects data members while that is going on. Does Axis have this same capability? Also there is a requirement that a C++ server object operate with a Java applet on the client. The statement I read on the Axis doc page: "Numerous tests have been done to test the ability of Axis C++ client side to interoperate with Axis Java server side and the results are successful. Efforts are under way to make the Axis C++ server side to inter operate with Axis Java client side." indicates that I might end up using Axis to write a Java server object wrapper for a C++ object and then have the client access the Java server object. All of that's a little less clean than Corba in a way but, if what I read is correct it's probably still faster and might involve fewer hassles with gateways and what not for an application which might be used by the public at large. I get the impression that CORBA might be better suited for corporate applications in which gateways and firewalls and such are not so much of an issue. ========================================================================== TOPIC: How can I "force" an upcast? Convert subclass into superclass? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ad4bc9f7ae03de71 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 10:03 am From: Chris Smith <[EMAIL PROTECTED]> Andrea Desole <[EMAIL PROTECTED]> wrote: > > Do you also apply this standard to the implementation of equals in > > java.lang.Object? > > no, you are right, this is a good point. > But, given one base class B and two derived classes D1 and D2, wouldn't > you say that generally D1.equals(D2) if: > - their B part is equal > - some extra conditions, related to their D part, is true. In general, I'd say no. In fact, it's exactly this mechanical and habitual implementation of equals that I think Java developers need to be broken of. The vast majority of the time -- for example, any time the class is mutable -- the right thing to do is not to override the equals method at all. In those few remaining cases where it is reasonable to override equals, some thought needs to go into the question of what it means for two classes to be equal. If the class is non-final (another thing that should be more rare than it is), then the thought needs to consider the existence of subclasses. The ideal solution is that equality is defined at only one extra place besides java.lang.Object, and that definition should be broader than the one in java.lang.Object. If a further subclass overrides equals again, then it needs to be yet broader than the next higher implementation. Anything else exhibits some very counterintuitive behavior. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ========================================================================== TOPIC: Is "String s = "abc";" equal to "String s = new String("abc");"? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57b8aacdcf136f3f ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 10:03 am From: "John C. Bollinger" <[EMAIL PROTECTED]> Michael Borgwardt wrote: > John C. Bollinger wrote: >> The ambiguity, I suppose, being a question of time. The JLS is >> ambiguous about whether those invariants are required to hold for any >> two strings chosen at any two points during program execution, or >> whether it only applies to program state any particular time. The > > > Ah, this issue: > http://www.javaworld.com/javaworld/javaqa/2003-12/01-qa-1212-intern.html Yep, that's it. >> then it is possible that the two identity hashes printed by one run of >> the program will be different. > > > Only when the class has bean unloaded inbetween and loaded again. That's > rather more than the "different scopes" that Tony said were required. Yes, you're right, and so my example was oversimplified for the case of String literals. And as you say, "different scopes" is not a sufficient condition for literals, although it _is_ sufficient for interned Strings not representing a literal in any currently loaded class. John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: SAX parser ignores part of XML document http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e5f90c18abffc3c4 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 10:16 am From: "John C. Bollinger" <[EMAIL PROTECTED]> Per Magnus L?vold wrote: > Hi, all! > I have a XML Parsing based on oracle's SAX parser > (oracle.xml.parser.v2.SAXParser). > With some XML files, it works fine. However, a more simple XML file > will not be processed. The parser stops after processing a small part > of the document, and ignores the rest. Is there anything I can do to > make the parser "accept" this document? Changing the structure of the > XML file is not an alternative.. > > Here is an extract from my XML file: > <Products> > <Product> > <IM>Flamingo</IM> > <PDUK>19981231</PDUK> > <PRUKS>1.00</PRUKS> > <AVUK>IN</AVUK> > <DNUK>HarperCollins Distribution Services</DNUK> > </Product> > <Product> > <IM>McGraw-Hill Education</IM> > <BIC>UHD</BIC> > <RC>U</RC> > <RC>P</RC> > <RC>R</RC> > <PDUK>19871231</PDUK> > <AVUK>IN</AVUK> > <DNUK>McGraw-Hill Education - Europe</DNUK> > </Product> > > The first startElement() event I get is for the "Product" element. It > seems as if the parser ignores the "Products" element. Then, after > endElement for the first "Product" element, the parser stops. > > Seems as if it beleives that "Product" is the first element! Is there > anything I can do to make the parser continue to parse the rest of the > document? I note that the extract you have provided is not well-formed. Perhaps that's just a cut&paste error; it should in any case not prevent a SAX parser from generating a startElement() event for <Products>. In order to tell you much more I would need to see your code for instantiating and configuring the parser, for setting up the input, and for performing the parse. Have you configured an ErrorHandler? If so, then have you checked whether it reports any errors / warnings? If not then you really should do. John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: Class and interface loading order http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dc413d1e05db6fe ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 10:47 am From: "bilbo" <[EMAIL PROTECTED]> Andrea Desole wrote: > Classes should be loaded when they are needed. From the JVM spec: > > Creation of a class or interface C denoted by the name N consists of the > construction in the method area of the Java virtual machine (§3.5.4) of > an implementation-specific internal representation of C. Class or > interface creation is triggered by another class or interface D, which > references C through its runtime constant pool. Class or interface > creation may also be triggered by D invoking methods in certain Java > class libraries (§3.12) such as reflection. > > So my guess is that the second case is correct, and the first is not. > Maybe a bug? See my other post though. The paragraph you're citing just says that a reference to a class C can trigger C being loaded. Both of the OPs classes had references to to all the classes, so the above paragraph doesn't preclude them being loaded. Specifically, look at JLS 12.2.1, which spells out more clearly when a class can actually be loaded, and pretty explicitly allows both behaviors that the OP noted. ========================================================================== TOPIC: JBoss to go closed source? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a8dda54906ca8df ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 10:41 am From: Tim Tyler <[EMAIL PROTECTED]> In comp.lang.java.advocacy James <[EMAIL PROTECTED]> wrote or quoted: > Tim Tyler <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > In comp.lang.java.advocacy James <[EMAIL PROTECTED]> wrote or quoted: > > > The question that has never been answered anywhere is do the venture > > > capitalists that contributed $10 million dollars believe they own the > > > intellectual property behind JBoss? > > > > You mean: are they stupid? > > > > People tend not to have $10 million dollars to throw around if they > > lack intelligence. > > This has absolutely nothing to do with intelligence. It does have to > do with stealing the intellectual property of those who have > contributed their own time that do not work for JBoss Group and having > it stolen if they go out of business. VCs are not stupid. The > developers who contribute to open source projects such as JBoss may > be... JBoss is distributed under the LGPL license. You might want to explain how anyone can "steal" the intellectual property in a LGPL project - without breaking copyright law. -- __________ |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply. ========================================================================== TOPIC: Font selection dialog http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3828c43244e7a4b0 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 11:53 am From: "Ike" <[EMAIL PROTECTED]> Thanks! But what is fOwner? -Ike ========================================================================== TOPIC: JSP Beginner http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/92c9e31fd2ca8594 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 11:57 am From: [EMAIL PROTECTED] (hiwa) Jens Körte <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hi cljp! > > I'm going to make it short: > I'm doing my first steps with JSP, but I have really good experience > in Java. I'm trying to change an internet-script. I want to write a > message into the browser if some values match, but I don't know how to > get the variable. The only thing I know is how to get the variable > using HTML. > In the original HTML-Page I found following: > > [...] > <input type="hidden" name="catalogID" value="<cumulus:catalogID/>"/> > [...] > > All I want to do is to check the value of "<cumulus:catalogID/>" so > that I can display any different message to any different catalogID. > > I first thought I can use the variable with this code but I failed: > System.out.println(catalogID); > > Is there any JSP can do almost anything for HTML form handling but you better do it in a servlet and use JSP for sending some result or message to client. //in your servlet String catId = request.getParameter("catalogID"); if (catId.equals("<cumulus:catalogID/>")){ //redirect/foward to the relevant JSP page } ========================================================================== TOPIC: HTTPUnit not working against an https (SSL) site http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8d793f5e72fb7839 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 12:12 pm From: [EMAIL PROTECTED] (samotto) Bruno, I am using HTTPUnit. Below is the code to get a connection: wc = new WebConversation(); WebRequest request = new GetMethodWebRequest( "http://www.development.com" ); //WebRequest request = new GetMethodWebRequest( "https://www.production.com" ); The commented out line above will not work. Also, on your suggestion, it appears that the constructors for HttpsURLConnection and HttpURLConnection are protected so there must be some other way the are created. I have not worked much with the java.net package. It has to be something in HTTPUnit I am not doing right. Thanks again Sam ========================================================================== TOPIC: validating classpaths http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9ee9967e34de9e2c ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 1:11 pm From: "Ferenc Hechler" <[EMAIL PROTECTED]> You can start the applicatino with the jvm option "-verbose:class" each classes and the corresponding jars are printed on first access. bye, feri "John Coltrane" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] >I there a tool I can use that will dump out the fully qualified jar > filenames that are access by either an individual java file or group > of files. > > I would like to be able to verify that java projects built on > different systems are accessing the same jar files. > > It would be great if versions were included but I don't want to get > greedy :)) > > thanks for the help > > > jprok ========================================================================== TOPIC: For JDBC juru http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e52944e7550b105f ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 1:16 pm From: Lee Fesperman <[EMAIL PROTECTED]> cc wrote: > > Hi, > I have found one anomaly inside jdbc. > > I have one table with one "small int" or "short" type column > (database dependent). > The ResultSetMetaData.getColumnClassName(i) method return "java.lang.Short" > class. But Resultset.getObject(i) method return java.lang.Integer. > > This is corrected? > Why Resultset.getObject(i) method not return java.lang.Short class? That is correct. getObject() returns java.lang.Integer for SQL datatypes TINYINT, SMALLINT and INTEGER. See Section 14.2 in the main JDBC spec (not the Javadocs!). -- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) ========================================================================== TOPIC: I wrote my own Java in BASIC ! ! ! http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/29ec22b23b7d5d6d ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 1:30 pm From: steve <[EMAIL PROTECTED]> On Fri, 19 Nov 2004 05:37:45 +0800, Virgil Green wrote (in article <[EMAIL PROTECTED]>): > "KiLVaiDeN" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> "Hans-Marc Olsen" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> Java was too expensive for me, so I wrote my own Java in BASIC. >> >> I wrote my own BASIC in a HEX editor. So you are nothing to me. > > I wrote my own compiler and JVM by using a bar magnet on a string and > swinging it very precisely over a mound of metal filings. > > - Virgil > > yep well u think ur so clever. I made my own bar magnet, and i made the iron filings too. ========================================================================== TOPIC: External packages http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bae8c29cb5e57bba ========================================================================== == 1 of 2 == Date: Fri, Nov 19 2004 2:04 pm From: "I.L.B." <[EMAIL PROTECTED]> Hi , I got several source code Java files to compile... They import both standard java class libraries as "java.awt... etc" but also another private ones (included as external class files). When I try to compile with javac, it gives a lot of error because it cannot import the "special" class libraries. I got those class libraries as class files in a folder, but I don't know how to "install" them into my java in order that they're recognized when it comes to compile java files into class files. Thanks !! == 2 of 2 == Date: Fri, Nov 19 2004 2:30 pm From: "Mike B" <[EMAIL PROTECTED]> I.L.B. <[EMAIL PROTECTED]> wrote: > Hi , > > I got several source code Java files to compile... They import both > standard java class libraries as "java.awt... etc" but also another > private ones (included as external class files). When I try to > compile with javac, it gives a lot of error because it cannot import > the "special" class libraries. > > I got those class libraries as class files in a folder, but I don't > know how to "install" them into my java in order that they're > recognized when it comes to compile java files into class files. Put them in the same folder as your source code. -- Mike B ========================================================================== TOPIC: Mars Rescue Mission Challenge http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9531033f5615f411 ========================================================================== == 1 of 2 == Date: Fri, Nov 19 2004 2:20 pm From: Frank Buss <[EMAIL PROTECTED]> A new challenge: http://www.frank-buss.de/marsrescue/index.html Have fun! Now you can win real prices. -- Frank Buß, [EMAIL PROTECTED] http://www.frank-buss.de, http://www.it4-systems.de == 2 of 2 == Date: Fri, Nov 19 2004 2:46 pm From: "Howard" <[EMAIL PROTECTED]> "Frank Buss" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >A new challenge: > > http://www.frank-buss.de/marsrescue/index.html > > Have fun! Now you can win real prices. > > -- > Frank Bu_, [EMAIL PROTECTED] > http://www.frank-buss.de, http://www.it4-systems.de Would those be retail prices or wholesale prices? Oh, never mind. It's off-topic here. ========================================================================== TOPIC: UnsupportedEncodingException http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f05a57f2fc1fbd14 ========================================================================== == 1 of 2 == Date: Fri, Nov 19 2004 2:38 pm From: "Bill Lattery via JavaKB.com" <[EMAIL PROTECTED]> I am using java 1.4.2 with Sun One Studio 5. I am using a getBytes() function: String mac = "1.2.3.4" byte[] bv = mac.getBytes("UTF-16"); When I try to compile I get this message: "unreported exception java.io.UnsupportedEncodingException; must be caught or declared to be thrown" Why do I get this? Please help. Thanks. _____________________ Message posted via http://www.javakb.com == 2 of 2 == Date: Fri, Nov 19 2004 3:01 pm From: "Ann" <[EMAIL PROTECTED]> "Bill Lattery via JavaKB.com" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I am using java 1.4.2 with Sun One Studio 5. > > I am using a getBytes() function: > > String mac = "1.2.3.4" > byte[] bv = mac.getBytes("UTF-16"); > > When I try to compile I get this message: > > "unreported exception java.io.UnsupportedEncodingException; must be caught or declared to be thrown" > > Why do I get this? You need a semicolon on the first line. ========================================================================== TOPIC: converting unicode to UTF-8 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a237715716e67cc1 ========================================================================== == 1 of 1 == Date: Fri, Nov 19 2004 2:48 pm From: Steve Horsley <[EMAIL PROTECTED]> peter10 wrote: > Hi everybody, > > I would like to convert unicode text (coming from a swing JTextPane - > I think that is unicode by default!?) to UTF-8. I tried the code > underneath, but the xml-database I am using still complains about > wrong characters (error message: "Invalid byte 2 of 3-byte UTF-8 > sequence"). > > ByteArrayOutputStream out = new ByteArrayOutputStream(); > DataOutputStream dataOut = new DataOutputStream(out); > dataOut.writeUTF(text_input); > String text_output = out.toString("UTF-8"); > > Can anybody tell me what the mistake is that I am making??? > > Thanks a lot for your help! > > Peter Look closely at the docs for writeUTF and you will find that it also writes a 2-byte binary length indicator at the front. I guess this is the problem. I suggest that you use an OutputStreamWriter instead, like this: ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStreamWriter out = new OutputStreamWriter(baos); out.write(text_input); Steve ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
