|
Author |
Topic: JDBC in applet (Read 516 times) |
|
dixbear
|
JDBC in applet
« on: Aug 14th, 2003, 6:29pm » |
|
I created an applet using JDeveloper which imports the BApplet class and then deployed to a .jar file. But I always get a java.lang.noClassDefFound error when I try to run the applet in IE. But the jar includes BApplet. Here's my mod of the bounce program example: import java.applet.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; import java.net.*; import java.text.*; import java.util.*; import java.util.zip.*; import BApplet; import BFont; import java.sql.*; public class bounce extends BApplet { // Bounce // by REAS <http://www.groupc.net> // When the shape hits the edge of the window, it reverses its direction // Updated 1 September 2002 int size = 60; // Width of the shape float xpos, ypos; // Starting position of shape float xspeed = 1.8f; // Speed of the shape float yspeed = 1.2f; // Speed of the shape int xdirection = 1; // Left or Right int ydirection = 1; // Top to Bottom private Connection conn; private String Query; private String SQLerr; Statement stmt; ResultSet rset; private String[] mnames; int x = 1; int i = 0; BFont f = loadFont("CenturySchbk.vlw.gz"); void setup() { try { DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); conn = DriverManager.getConnection ("jdbcracle:thin:@10.9.9.99:1521:research", "userid", "passwd"); } catch (Exception e) { e.printStackTrace(); } Query = "select fname from bctcnames" ; try { stmt = conn.createStatement(); rset = stmt.executeQuery (Query); // mycount = rset.getFetchSize(); if ((rset = stmt.getResultSet()) != null) { while (rset.next()) { mnames[x] = rset.getString(1); x = x + 1; } } } // end try catch (SQLException e) { SQLerr = "SQL Error:" + e.getMessage(); } setFont(f, 50); size(200, 200); background(102); noStroke(); // Set the starting position of the shape xpos = width/2; ypos = height/2; } void loop() { // Update the position of the shape xpos = xpos + ( xspeed * xdirection ); ypos = ypos + ( yspeed * ydirection ); // Test to see if the shape exceeds the boundaries of the screen // If it does, reverse its direction by multiplying by -1 if (xpos > width-size || xpos < 0) { xdirection *= -1; } if (ypos > height-size || ypos < 0) { ydirection *= -1; } // Draw the shape if (i == x) { i = 1; } else { i = i + 1; } ellipse(xpos, ypos, size, size); text(mnames[i], xpos, ypos); } }
|
« Last Edit: Aug 14th, 2003, 6:30pm by dixbear » |
|
Dixon Berry Oracle DBA/Developer Baruch College New York, NY
|
|
|
fry
|
Re: JDBC in applet
« Reply #2 on: Sep 18th, 2003, 3:33pm » |
|
fixed in 59.
|
|
|
|
|