I am trying to compile this class
i keep getting this error
C:\>javac JdbcTest.java
JdbcTest.java:14: cannot resolve symbol
symbol : variable currentThread
location: class java.lang.Thread
Thread.currentThread.sleep(2000);
^
1 error
Code:
import java.sql.*;
class JdbcTest1 {
public static void main (String[] args) {
try {
// Step 1: Load the JDBC driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Step 2: Establish the connection to the database.
String url = "jdbc:odbc:data413";
Connection conn = DriverManager.getConnection(url,"pilatdba","p1latdba");
Thread.currentThread.sleep(2000);
conn.close();
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
}
C:\>javac JdbcTest.java
JdbcTest.java:14: cannot resolve symbol
symbol : variable currentThread
location: class java.lang.Thread
Thread.currentThread.sleep(2000);
^
1 error