Correggo
codice:
import java.sql.*;
import java.io.*;
import sun.misc.*;
import java.util.*;
class Connessione {
public Connessione() {
System.out.println("Connessione al driver...");
String driverName = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@134.32.232.112:1521:Nome";
String userName = "user";
String password = "pwd";
conn = DriverManager.getConnection(url,userName,password);
}
public static void main(String args[]) {
Connessione connDB = new Connessione();
}
}
Pero conn come cavolo va dichiarato?
Mi dice questo errore
D:\java\Connessione\Connessione.java:16: cannot resolve symbol
symbol : variable conn
location: class myprojects.connessione.Connessione
conn = DriverManager.getConnection(url,userName,password) ;
Come mai?