java - How to handle Symbol not find Error? -
I am writing a program for registration forms in Java and I have created separate connection classes. But while compiling my register Java Class I Found Icons Not Found Error Please check that anyone can help.
This is the code for my connection class.
import java.sql. *; Square JDBCConnection {connection con = null; Public connection getConnection () {try {class.forName ("oracle.jdbc.driver.OracleDriver"); Thief = DriverManager.getConnection ("JDBC: Oracle: thin: @localhost: 1521: XE", "cloud", "cloud"); } Catch (Klassnotfundexstation CE) {impressions. } Hold (eskectionation SKE) {sqe.printStackTrace (); } With return; }} and the code for the register class is as follows:
import javax.servlet.http. *; Import java.io * *; Import java.sql *; Import java.util. *; Public Class Register 1 HTTPSViewlet {Public Zero (HTTPEVERTT REQUEST RICK, HTTPSVR Response Ridge) throws IOException {printWriter out = res.getWriter (); String str = req.getParameter ("first"); String str1 = req.getParameter ("last"); String str2 = req.getParameter ("Uname"); String str3 = req.getParameter ("month"); String Day = RIK. Jap parameter ("days"); String Year = Reich Jap parameter ("year"); String str4 = req.getParameter ("General"); String str5 = req.getParameter ("phone"); String str6 = req.getParameter ("mail"); out.println ("& lt; html>"); Out.println ("k & lt; body & gt;"); out.println ("& lt; form action = \" ../ page (1). html \ "& gt;"); JDBCConnecting Ozz = New JDBCCC (); Connection con = obj.getConnection (); String Query = "Insert Register values (?,?,?,?,?,?,?,?,?)"; Int i = 0; {Try PrepateStatement ps = con.prepareStatement (query); Ps.setstring (1, str); Ps.setstring (2, str1); Ps.setstring (3, str2); Ps.StStString (4, day); Ps.setString (5, str3); ps.setString (6, year); ps.setString (7, str4); ps.setstring (8, str5); ps.setstring (9, str6); I = ps.executeUpdate (); } Hold (exception e) {e.printStackTrace (); } If (i == 1) {res.sendRedirect ("../ page (1) .html"); } Out.println ("& lt; / html>"); Out.println ("& lt; / body & gt;"); out.println ("& lt; / form & gt;"); }} The following is the error as follows:
register1.java:32:error: symbol can not be found JDBCConnection obj = new JDBCConnection () ; ^ Icons: Class JDBCConnection Location: Class Register1 Register 1.java: 32: error: Icon JDBCConnection obj = new JDBCConnection (); ^ Symbol: Class JDBCConnection Location: Class Register 1 2 Errors
Java automatically included The current current directory is specified in a classpath when a dependent JAR is specified, so it must be added.
javac -cp .: Servlet-api.jar * .java
Comments
Post a Comment