comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Programming Languages for the Java Virtual Machine - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dafae86cd33e6e7d * Get a String from an ASP via HttpUrlConnection Object - 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d856c72356529474 * Some Programing Required - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1ca4090cec7a67a * connecting to databace - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23535816cbb67a75 * JAR Files with Class Paths - 11 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/406a82f012791e11 * Java Swing DnD and Konqueror - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a684e494c13e8cf * java cross reference tools - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a13cece2b8209327 * Detect Java enabled browser - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eca70cec50baafd ============================================================================== TOPIC: Programming Languages for the Java Virtual Machine http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dafae86cd33e6e7d ============================================================================== == 1 of 2 == Date: Fri, Dec 24 2004 4:19 pm From: [EMAIL PROTECTED] Ian A. Mason <[EMAIL PROTECTED]> wrote: > Try googling for these: > > SKIJ > JScheme > SISC > Kawa > JLambda > SILK > > They should lead you to examples, and papers. For those who like Python, also check out "Jython". == 2 of 2 == Date: Fri, Dec 24 2004 11:06 am From: "[EMAIL PROTECTED]" In regards to original poster's phrasing: "When we talk about Programming Languages for the Java Virtual Machine" we are talking about what you describe: languages that when compiled will run when executed with the java command as that command is part of JRE -- Java Runtime Environment. I am going to take a deeper look at Jython as I've heard it produces .class files. ============================================================================== TOPIC: Get a String from an ASP via HttpUrlConnection Object http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d856c72356529474 ============================================================================== == 1 of 5 == Date: Fri, Dec 24 2004 9:42 am From: "guyzdancin" I am trying to get a string from an active server page via an HttpUrlConnection from a java application. Following code does not work although a browser will display the the string. ACTIVE SERVER PAGE CODE <%@ Language=VBScript %> <HTML> <HEAD> <META NAME="DbLog" Content="Log in Data for LPT Test"> </HEAD> <BODY> <% Response.write ("Hello World") %> </BODY> </HTML> JAVA APPLICATION CODE try{ connection = (HttpURLConnection)url.openConnection(); }catch(IOException iOE1){} String key = null; try{//get string key from web server connection.setFollowRedirects(true); BufferedReader in = new BufferedReader( new InputStreamReader(connection.getInputStream() ) ); key = in.readLine(); System.out.println(key); }catch(Exception e){} Thanks in advance for your help == 2 of 5 == Date: Fri, Dec 24 2004 7:07 pm From: ByteCoder guyzdancin wrote: > I am trying to get a string from an active server page via an > HttpUrlConnection from a java application. > > Following code does not work although a browser will display the the > string. 'a' browser would be Internet Explorer. Firefox and the like won't do anything with VBScript. > ACTIVE SERVER PAGE CODE > > <%@ Language=VBScript %> > <HTML> > <HEAD> > <META NAME="DbLog" Content="Log in Data for LPT Test"> > </HEAD> > <BODY> > <% > Response.write ("Hello World") > %> > > </BODY> > </HTML> > > > JAVA APPLICATION CODE > > try{ > connection = (HttpURLConnection)url.openConnection(); > }catch(IOException iOE1){} > > String key = null; > > try{//get string key from web server > connection.setFollowRedirects(true); > BufferedReader in = new BufferedReader( > new InputStreamReader(connection.getInputStream() ) ); > key = in.readLine(); > System.out.println(key); > }catch(Exception e){} A HttpURLConnection would download the source of the URL you connected it to. in.readLine() would only return the first line of the source code, which is <%@ Language=VBScript %> in your example. -- ------------- - ByteCoder - ...I see stupid people ------------- Curiosity *Skilled* the cat == 3 of 5 == Date: Fri, Dec 24 2004 11:36 am From: Chris Smith ByteCoder <[EMAIL PROTECTED]> wrote: > > Following code does not work although a browser will display the the > > string. > > 'a' browser would be Internet Explorer. Firefox and the like won't do > anything with VBScript. Actually, ASP is server-side, so pretty much any browser will display that string. However, the actual text returned would be something like: ---- <HTML> <HEAD> <META NAME="DbLog" Content="Log in Data for LPT Test"> </HEAD> <BODY> Hello World </BODY> </HTML> ---- And so (because there's a blank line at the top) the readLine() would probably return an empty string. The solution would be to read the entire response into an HTML parser, and then get the text of the page from that. For something this simple, just stripping the tags would be fine, and that can be done using regular expressions. However, a more elaborate task would require a full parser, and a plan for how to deal with certain HTML attributes that affect the text, such as bold or italics. It's worth noting that ASP doesn't *have* to be used to produce HTML. For example, if you have control over the ASP and don't intend to connect with a browser, you could use the following: <%@ Language=VBScript %><% Response.write ("Hello World") %> -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation == 4 of 5 == Date: Fri, Dec 24 2004 7:57 pm From: ByteCoder Chris Smith wrote: > ByteCoder <[EMAIL PROTECTED]> wrote: [...] > It's worth noting that ASP doesn't *have* to be used to produce HTML. > For example, if you have control over the ASP and don't intend to > connect with a browser, you could use the following: > > <%@ Language=VBScript %><% Response.write ("Hello World") %> > Ok, thanks. And I agree with the snipped part. ;) -- ------------- - ByteCoder - ...I see stupid people ------------- Curiosity *Skilled* the cat == 5 of 5 == Date: Fri, Dec 24 2004 11:57 am From: "guyzdancin" Thanks Guys. It did the job! ============================================================================== TOPIC: Some Programing Required http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1ca4090cec7a67a ============================================================================== == 1 of 2 == Date: Fri, Dec 24 2004 9:59 am From: [EMAIL PROTECTED] Thanks Andrew == 2 of 2 == Date: Fri, Dec 24 2004 10:00 am From: [EMAIL PROTECTED] Thanks Robert ============================================================================== TOPIC: connecting to databace http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23535816cbb67a75 ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 11:39 am From: Chris Smith ali <[EMAIL PROTECTED]> wrote: > well i have completed a java course but strange thing is we didnt learn > any thing about how to connect a java program with a database > > well i am very new to data base things > > so hope is some one can lead me to simple way to connect a java applet > or application with an access database Read the link Ryan gave you. Connecting an applet to an Access database is actually difficult. You can connect an application to an Access database using the ODBC bridge driver; or you can connect an applet to any database running on the web server that has a real JDBC driver (including SQL Server, which has a free personal edition, if you're going Microsoft here). -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== TOPIC: JAR Files with Class Paths http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/406a82f012791e11 ============================================================================== == 1 of 11 == Date: Fri, Dec 24 2004 10:50 am From: "Jonathan" Hello folks. I realize that problems with classpaths are a pretty common theme here, but I've been wrestling with this for days. I've been searching newsgroups and websites but I can't find an answer to my problem. I am trying to include the mysql JDBC driver with my application's JAR file. I've only succeeded to run the application with the driver by running the main class. I have tried to include the Class-Path with the JAR's manifest, like so: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.2 Created-By: 1.4.2_06-b03 (Sun Microsystems Inc.) Main-Class: Scheduler Class-Path: C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar However, when I include the Class-Path attribute, the JAR can no longer find the Scheduler main class. I've experimented with including the build and dist directories in the Class-Path, but it will not find the main class when the Class-Path attribute is included. The only time it works is when I remove the Class-Path attribute. So I've tried including the jar for the driver on the command-line instead, running with java -classpath C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar -jar dist\scheduler.jar Which runs, but cannot find the driver. It does find the driver when I do the same thing without the JAR file. Can anyone shed some light on this? Should I post my build file from ANT? I usually find my answers scouting the newsgroups but this time I can't seem to get anywhere. Thanks in advance. :( == 2 of 11 == Date: Fri, Dec 24 2004 7:55 pm From: ByteCoder Jonathan wrote: > Hello folks. > > I realize that problems with classpaths are a pretty common theme here, > but I've been wrestling with this for days. I've been searching > newsgroups and websites but I can't find an answer to my problem. > > I am trying to include the mysql JDBC driver with my application's JAR > file. I've only succeeded to run the application with the driver by > running the main class. > > I have tried to include the Class-Path with the JAR's manifest, like > so: > > Manifest-Version: 1.0 > Ant-Version: Apache Ant 1.6.2 > Created-By: 1.4.2_06-b03 (Sun Microsystems Inc.) > Main-Class: Scheduler > Class-Path: C:\physioclinic\mysql-connector-java-3.0.15-ga-bin.jar How about you put the mysql connector in the same directory as your jar file and run it with java -classpath . -jar Scheduler.jar -- ------------- - ByteCoder - ...I see stupid people ------------- Curiosity *Skilled* the cat == 3 of 11 == Date: Fri, Dec 24 2004 11:29 am From: "Jonathan" Sure. It doesn't work--any ideas? C:\physioclinic\dist>java -classpath . -jar scheduler.jar java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java.sql.SQLException: No suitable driver java.lang.NullPointerException C:\physioclinic\dist>dir Volume in drive C has no label. Volume Serial Number is D3C5-D3CD Directory of C:\physioclinic\dist 12/24/2004 02:41 PM <DIR> . 12/24/2004 02:41 PM <DIR> .. 12/24/2004 03:22 PM 75,404 scheduler.jar 09/04/2004 01:15 AM 235,712 mysql-connector-java-3.0.15-ga-bin.jar 2 File(s) 311,116 bytes 2 Dir(s) 6,225,215,488 bytes free C:\physioclinic\dist> == 4 of 11 == Date: Fri, Dec 24 2004 7:44 pm From: kjc How about putting the jar with contains com.mysql.jdbc.Driver on out classpath Jonathan wrote: > Sure. It doesn't work--any ideas? > > C:\physioclinic\dist>java -classpath . -jar scheduler.jar > > java.lang.ClassNotFoundException: com.mysql.jdbc.Driver > java.sql.SQLException: No suitable driver > java.lang.NullPointerException > > C:\physioclinic\dist>dir > Volume in drive C has no label. > Volume Serial Number is D3C5-D3CD > > Directory of C:\physioclinic\dist > > 12/24/2004 02:41 PM <DIR> . > 12/24/2004 02:41 PM <DIR> .. > 12/24/2004 03:22 PM 75,404 scheduler.jar > 09/04/2004 01:15 AM 235,712 > mysql-connector-java-3.0.15-ga-bin.jar > 2 File(s) 311,116 bytes > 2 Dir(s) 6,225,215,488 bytes free > C:\physioclinic\dist> > == 5 of 11 == Date: Fri, Dec 24 2004 12:04 pm From: "Jonathan" This doesn't seem to work? C:\physioclinic\dist>java -classpath mysql-connector-java-3.0.15-ga-bin.jar -jar scheduler.jar java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java.sql.SQLException: No suitable driver java.lang.NullPointerException == 6 of 11 == Date: Fri, Dec 24 2004 12:11 pm From: "Jonathan" The command-line I posted didn't come out right. I had scheduler.jar at the end of that, and the program couldn't find com.mysql.jdbc.Driver == 7 of 11 == Date: Fri, Dec 24 2004 8:30 pm From: kjc where is mysql-connector-java-3.0.15-ga-bin.jar located. Absolute path. Jonathan wrote: > This doesn't seem to work? > > C:\physioclinic\dist>java -classpath > mysql-connector-java-3.0.15-ga-bin.jar > -jar scheduler.jar > > java.lang.ClassNotFoundException: com.mysql.jdbc.Driver > java.sql.SQLException: No suitable driver > java.lang.NullPointerException > == 8 of 11 == Date: Fri, Dec 24 2004 12:35 pm From: "Jonathan" I printed the directory listing in a previous post. C:\physioclinic\dist\mysql-connector-java-3.0.15-ga-bin.jar The absolute path used on the classpath didn't work either. It only works when I run from the class file. == 9 of 11 == Date: Fri, Dec 24 2004 8:41 pm From: kjc C:\physioclinic\dist>java -cp C:\physioclinic\dist\mysql-connector-java-3.0.15-ga-bin.jar -jar scheduler.jar kjc wrote: > where is mysql-connector-java-3.0.15-ga-bin.jar > located. Absolute path. > > Jonathan wrote: > >> This doesn't seem to work? >> >> C:\physioclinic\dist>java -classpath >> mysql-connector-java-3.0.15-ga-bin.jar >> -jar scheduler.jar >> >> java.lang.ClassNotFoundException: com.mysql.jdbc.Driver >> java.sql.SQLException: No suitable driver >> java.lang.NullPointerException >> > == 10 of 11 == Date: Fri, Dec 24 2004 12:48 pm From: "Jonathan" 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 java.sql.SQLException: No suitable driver java.lang.NullPointerException at DBConnection.query(DBConnection.java:49) at DayPanel.<init>(DayPanel.java:123) at MonthTable.mouseClicked(MonthTable.java:176) at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) C:\physioclinic\dist> == 11 of 11 == Date: Fri, Dec 24 2004 1:14 pm From: kjc 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 > java.sql.SQLException: No suitable driver > java.lang.NullPointerException > at DBConnection.query(DBConnection.java:49) > at DayPanel.<init>(DayPanel.java:123) > at MonthTable.mouseClicked(MonthTable.java:176) > at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source) > at java.awt.Component.processMouseEvent(Unknown Source) > at java.awt.Component.processEvent(Unknown Source) > at java.awt.Container.processEvent(Unknown Source) > at java.awt.Component.dispatchEventImpl(Unknown Source) > at java.awt.Container.dispatchEventImpl(Unknown Source) > at java.awt.Component.dispatchEvent(Unknown Source) > at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown > Source) > at java.awt.LightweightDispatcher.processMouseEvent(Unknown > Source) > at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) > at java.awt.Container.dispatchEventImpl(Unknown Source) > at java.awt.Window.dispatchEventImpl(Unknown Source) > at java.awt.Component.dispatchEvent(Unknown Source) > at java.awt.EventQueue.dispatchEvent(Unknown Source) > at > java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) > > at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown > Source) > at java.awt.EventDispatchThread.pumpEvents(Unknown Source) > at java.awt.EventDispatchThread.pumpEvents(Unknown Source) > at java.awt.EventDispatchThread.run(Unknown Source) > C:\physioclinic\dist> > ============================================================================== TOPIC: Java Swing DnD and Konqueror http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a684e494c13e8cf ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 8:22 pm From: Timo Nentwig Hi! Has somebody been able to handle Konqueror DnD with Swing? javaFileListFlavor works perfectly with Windows' Explorer but not with Konqueror. ============================================================================== TOPIC: java cross reference tools http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a13cece2b8209327 ============================================================================== == 1 of 1 == Date: Fri, Dec 24 2004 7:58 pm From: Dirk Daems Hi, I'm looking for good Java cross reference tools. Are you familiar with such a tool? What are the (dis)advantages of it? Is it prepared for the new 1.5 Tiger release? Kind regards, Dirk ============================================================================== TOPIC: Detect Java enabled browser http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eca70cec50baafd ============================================================================== == 1 of 2 == Date: Fri, Dec 24 2004 2:11 pm From: "Ryan Stewart" 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? == 2 of 2 == Date: Fri, Dec 24 2004 1:17 pm From: "SPG" 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.. Steve import java.awt.*; import java.awt.event.*; import java.applet.*; public class VMDetect extends Applet { //Construct the applet public VMDetect() { } //Initialize the applet public void init() { String vmName = System.getProperty("java.vm.name"); String vVendor = System.getProperty("java.vm.vendor"); String vmVersion = System.getProperty("java.vm.version"); System.out.println("Name: " + vmName ); System.out.println("Vendor: " + vVendor ); System.out.println("Version: " + vmVersion ); } } "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? > ============================================================================== 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
