Emma,
I guess you are confused with .class file and .java file. To make things clearer , A java file is just a normal file which when compiled using javac (JVM provided in JDK) converts to class file. So whenever you say to call/access the java file or class file it typically means you call "class"( not class file , not java file ) , but the "class" created on compiling java file.
It always better to refer them as "classes".
How do I call the class file from my jsp file.
If you still want to use scriptlets in JSP for learning purpose , you can proceed.So how do you import classes in servlet ? similarly import them to JSP using <@%page import="" %> atttribute.
This is main method , which can be run standalone. When you run from JSP , you dont require it be standalone. JSP Container takes care of calling the required method.
Also , you can see Connection object is a local variable which created inside main , and once main method ends , Connection object is lost. ( no reference to it). So how do you use connection object to make query ?
You got to change your ConnectOracle class to be useful inside JSP/servlet or any other means.
1) Define static Connection conn object outside the method.
2) Change the main method to take no args ,( otherwise you got to pass dummy useless
String array whenever you call main()) ,and change the return type to return conn object.
2) initialise the conn inside the main like you did. ( dont close the connection object) .check if the conn is already there and return , else initialise
3) Define a new method to close the connection object.