getting identifier expected error
can any1 plese help me out in solving the <identifier > expected error in the given code below
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
/*
<applet code="part1" width=500 height=500>
</applet>
*/
public class part1 extends Applet implements ActionListener
{
Class.forName("oracle.jdbc.driver.OracleDriver");//error coming here
Statement stmt;
Connection conn=null;
//Making the database connection
conn = DriverManager.getConnection("jdbc:Oracle:thin:bharat/bharat@mdrrcc");//here again the error is coming
stmt = conn.createStatement();//here again same error
ResultSet rs;
String query;
query = "SELECT * FROM BHARAT";//again here
rs = stmt.executeQuery(query);//here again
> i didnt get wht u r trying to say
> can u plzz make me understand that
> thanx
How ironic.
U nd 2 hv a ctor r mthd r wtever 2 put ur codez in.
Or, in very simple terms: you can't have code outside of any methods, because there wouldn't be anything to run it.
Go and read up on the Java basics. And maybe take some typing lessons.
This looks interesting. A total newbie to Java (apparently) is building an applet that will apparently connect to an oracle database and he doesn't even know that code must go inside a method or a constructor (or static/instance initializer block).
Great, I foresee great accomplishments for this person.
> Great, I foresee great accomplishments for this
> person.
I see capitalization opportunities. Account fraud, industrial espionage... To bad I was never really fond of that cra-cker business.