-3
C:\Users\PRAVEEN\Desktop>javac afterlogin.java
afterlogin.java:20: cannot find symbol
symbol  : class Connection
location: class afterlogin
                        Connection z=DriverManager.getConnection("jdbc:mysql://localhost:3306/db","root","root");
                        ^
afterlogin.java:20: cannot find symbol
symbol  : variable DriverManager
location: class afterlogin
                        Connection z=DriverManager.getConnection("jdbc:mysql://localhost:3306/db","root","root");
                                     ^
afterlogin.java:21: cannot find symbol
symbol  : class PreparedStatement
location: class afterlogin
                        PreparedStatement ps=z.PreparedStatement("insert into reg(fn,ln,pwd,email,mob)values(?????)");
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

1 Answers1

2

You should be having imports on your afterLogin.java to solve these errors you encounter during the compilation. Following are your imports that you need to add.

import java.sql.Connection;
import java.sql.DriverManager;

The compilation errors that you've posted is also incomplete. What I suggest you is to please follow a specific tutorial if you are new to programming around JDBC. There are tons of articles that can guide you through this process.

N00b Pr0grammer
  • 4,503
  • 5
  • 32
  • 46