Nick Neidig

Greenhorn
+ Follow
since Aug 29, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Nick Neidig

Thanks again Lu
I got the results to show up in the database. I experimented with including setAutoCommit(true) and the closing statements in my class and found that the results show up correctly with or without the setAutoCommit(true).
The class runs without exception, but the values 55 and CD Player do not appear in the Access table Customer1 after I run the class. Thanks for your help.
Nick
package be314;
import java.sql.*;
public class TestUpdate {
public static void main (String args []) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection(
"jdbc dbc:Music");
Statement s = c.createStatement();
s.executeUpdate ("INSERT INTO Customer1 VALUES (55, 'CD Player')");
System.exit(0);
} catch (SQLException bb) {
System.out.println(bb);
System.exit(0);
} catch (ClassNotFoundException cc) {
System.out.println(cc);
System.exit(0);
}
}
}
Thank you Lu. I went ahead and printed out the error message and you were absolutely correct.
The class runs fine when I omit s.executeUpdate(). I am unsure of what the problem might be. I am using Windows XP and connecting to an Access database. Thanks for your help.
Nick
package be314;
import java.sql.*;
public class Fordate1 {
public static void main (String args []) {
try {
Class.forName(
"sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection(
"jdbc dbc:Music");
System.out.println("A success");
Statement s = c.createStatement();
s.executeUpdate (
"CREATE TABLE Customer (CustomerID INTEGER, Address VARCHAR
(25))");
ResultSet r =
s.executeQuery(
"SELECT Albums.Album FROM Albums WHERE Albums.Album)
Between 'A' And 'B')");
while(r.next()) {
System.out.println(
r.getString("Album"));
}
System.exit(0);
} catch (Exception) {
System.exit(0);
}
}
}
I was able to run GradesApplet with the following HTML text file. Both the HTML file and the GradesApplet.class are stored in a directory named grades. I have been unable to run GradesApplet since I placed GradesApplet into a package named grades. I am guessing that I have to change the <PARAM NAME = CODE VALUE = "GradesApplet.class">. I would appreciate any help that you could provide me.
Thanks
Nick
<HTML>
<BODY>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = "1200" HEIGHT = "1200"
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME = CODE VALUE = "GradesApplet.class" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="false">
</OBJECT>
</BODY>
</HTML>
20 years ago
What do I in order for this file to be converted into HTML by the Converter. Do I need to write some tags for the converter?
package grades;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class GradesApplet extends JApplet {
public void init() {
DrawGUI x = new DrawGUI();
x.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
}
});
}
}
Thanks for your help.
Nick
20 years ago
The program worked fine when I followed your advice. Thanks Dirk.
20 years ago
I have been unable to run the following class. I was able to compile Roma by entering javac mygame\partner\*.java at the command prompt.
package mygame.partner;
import mygame.client.Justy;
public class Roma extends Justy {
//main thread
}
Justy is a public class and the error I keep getting at the command prompt is NoClassDefFoundError. There is no directory before mygame on my computer. I have C:\mygame\client and C:\mygame\partner. Are mygame.client and mygame.partner appropriate package names? If you could be show me exactly how to run Roma from the command prompt that would be extremely helpful.
Thanks for your help
Nick
20 years ago
Thanks for your post Stan. I was not able to figure out how to get the Roma class to run. There is no directory before mygame on my computer. I have C:\mygame\client and C:\mygame\partner. Are mygame.client and mygame.partner appropriate package names? If you could show me exactly how to run Roma from the command prompt that would be extremely helpful.
I would greatly appreciate any further help.
20 years ago
I have been unable to run the following class. I was able to compile Roma by entering javac mygame\partner\*.java at the command prompt.
package mygame.partner;
import mygame.client.Justy;
public class Roma extends Justy {
//main thread
}
Note: Justy is a public class and the error I keep getting at the command prompt is NoClassDefFoundError.
Thanks for your help
Nick
20 years ago
Thanks Maulin and Dirk for responding to my question. I was able to compile both of the classes.
21 years ago
I have been unable to compile or run classes that import custom made packages. How do I, using a JVM version 1.4, compile and run class Client in package mygame.client, when it is importing class Utilities in package mygame.shared? I am using Windows XP and the directory mygame is stored directly on my hard drive. If you could write out what the command line instructions to the JVM would be to compile and run the Client class I would greatly appreciate it.
Thanks for your time.
21 years ago