Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Shuaib Gill

Ranch Hand
+ Follow
since May 29, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shuaib Gill

Thank you for the link. Have you ever developed reports, charts using Java ?
17 years ago
Hello,
I was wondering if there is a Java API which I could use to create custom pie graphs, bar graphs and line graphs ? Please let me know if there is so I can do this. Did anyone ever create custom reports using Java?
javakid
17 years ago
I can compile a program called StartCube.java, but when I type
java StartCube
on the command line, it will open a window with nothing in it. However it works on the schools computer. What did I do wrong? Here is the code:
// creates a universe with nothing in it.
import java.awt.*;
import java.awt.event.*;
import javax.media.j3d.*;
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;
public class StartCube extends Frame {
public static void main(String[] args) {
StartCube frame = new StartCube("StartCube");
frame.setSize(300,200);
frame.setVisible(true);
}
public StartCube(String title) {
super(title);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
Canvas3D canvas = new Canvas3D(null);
add(canvas,"Center");
SimpleUniverse universe = new SimpleUniverse(canvas);
universe.getViewingPlatform().setNominalViewingTransform();
BranchGroup root = new BranchGroup();
ColorCube cube = new ColorCube(.5);
root.addChild(cube);
universe.addBranchGraph(root);
}
}
this code is right because it works on the computer at school. i have windows 2000 OS, using OpenGL java 3D API and Runtime environment.
please help.
thanks....
18 years ago
Hi,
I have an .htm file which has a form field that asks users to type in 10 numbers. Now if they type in anything that is not a number, I want to redirect them to an error page. I was wondering if there is an isDigit() function which tests to see if user input is a digit or is not a digit. Here is my .htm file and the servlet, SortItTest:
<html>
<head>
<title>
Bubble Sort Algorithm
</title>
</head>
<body>
<form name="bubblesort"action="http://mcs.ltu.edu/sgill/servlet/SortItTest"; method="get">
<table>
<tr>
<td colspan = 5 align="middle">
Please enter 10 numbers:
</td>
</tr>
<tr>
<td>
<input type = "text" name = "number1" size="5">
</td>
<td>
<input type = "text" name = "number2" size="5">
</td>
<td>
<input type = "text" name = "number3" size="5">
</td>
<td>
<input type = "text" name = "number4" size="5">
</td>
<td>
<input type = "text" name = "number5" size="5">
</td>
</tr>

<tr>
<td>
<input type = "text" name = "number6" size="5">
</td>
<td>
<input type = "text" name = "number7" size="5">
</td>
<td>
<input type = "text" name = "number8" size="5">
</td>
<td>
<input type = "text" name = "number9" size="5">
</td>
<td>
<input type = "text" name = "number10" size="5">
</td>
</tr>
<tr>
<td colspan = 5 align="middle">
<input type = "submit" name = "sort" value="Sort !">
</td>
</tr>
</table>
</form>
</body>
</html>
// now here is some code from SortItTest.java
String number1 = req.getParameter("number1");
String number2 = req.getParameter("number2");
String number3 = req.getParameter("number3");
String number4 = req.getParameter("number4");
String number5 = req.getParameter("number5");
String number6 = req.getParameter("number6");
String number7 = req.getParameter("number7");
String number8 = req.getParameter("number8");
String number9 = req.getParameter("number9");
String number10 = req.getParameter("number10");
18 years ago
I'm trying to install jakarta-tomcat-4.0.3.tar.gz on a Linux OS. I used the following command to unzip it:
tar xzvf jakarta-tomcat-4.0.3.tar.gz
and it gave me these errors:
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers

gunzip: jakarta-tomcat-4.0.3.tar.gz: invalid compressed data--crc error

gunzip: jakarta-tomcat-4.0.3.tar.gz: invalid compressed data--length error
tar: Error exit delayed from previous errors
Why would it do that? How do I uninstall this on Linux and has anyone ever come across this error before?
18 years ago
Anyone know any good links that provide detailed information on how to install j2sdk 1.3.1_03 on linux red hat OS? Please post the links and advice. Has anyone done this before?
18 years ago
how do you install the tomcat web server? What are the steps needed to start compiling servlets, and viewing JSP code on the browser. I tried to install tomcat but it does not reload the servlets, so I'll start from scratch.
Can someone give me some ideas?
18 years ago
I wrote a simple Hello World servlet , compiled it and had it working on the web browser, so far so good. Next I changed the servlet, recompiled it and clicked on the Refresh button on the browser, nothing, no change.
I have to shut down and restart the standalone Tomcat Apache engine each time I recompile the servlet, it is very tedious.
Someone please help.
18 years ago
Try using this website to run your servlets on a standalone Apache Tomcat servlet engine:
http://www.moreservlets.com/Using-Tomcat-4.html
18 years ago
I took that line out of server.xml, still no luck. Why would this happen anyways? I followed the instructions on this site to install and configure Tomcat on my machine.
http://www.moreservlets.com/Using-Tomcat-4.html
Hope you can help...
18 years ago
I added this line:
<DefaultContext reloadable="true"/>
below this block of code:
<!-- Define properties for each web application. This is only needed
if you want to set non-default properties, or have web application
document roots in places other than the virtual host's appBase
directory. -->
and inserted the following line just below it:
<DefaultContext reloadable="true"/>
This should let the servlet engine recompile new versions of the servlet.
[ February 11, 2002: Message edited by: Shuaib Gill ]
18 years ago
I have installed Tomcat 4.0, however I have to shutdown and restart Tomcat everytime I make a change to a servlet and recompile it. Why? I changed the xml file, server.xml but still I have to restart the servlet engine everytime I make a change to the servlet.
How can I fix this?
[ February 09, 2002: Message edited by: Shuaib Gill ]
18 years ago
It's been a long time since I've programmed using servlets, can someone tell me how I can compile servlets?
I am running Win2K and I have regualr applets working. How can I compile servlets? Which .jar file should I look for?
18 years ago
Thanks Bosun, I got it connected to the db and it is working now.
------------------
programmer77
Hi,
I want to write JDBC code to query data from an MS Access database. Now I have the database set up, the database is called sag.mdb, the table in this database is called emp( with fields 'first','last','age'). I am trying to run a select * from emp query, but I get errors. Here is the code:
import java.sql.*;
import java.io.*;
import java.util.*;
//import jdbc.obbc.JdbcOdbcDriver;
public class trySQL
{
public static void main(String args[])
{
String url, user, password;
url="jdbc dbc:emp";
user = null;
password = null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(url,user,password);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from demo");
while(rs.next())
{
String s1 = rs.getString(1);
System.out.println(s1);
}

}
catch(Exception e)
{System.out.println(e);}
}
}
The error reads : No data found.
Why? I have the database set up, the table is correct and it is on my localhost, the server is apache web server.
please help.