Galera,
estou com este erro na hora de compilar o programa abaixo, alguem poderia me ajudar?
import java.sql.;
import java.io.;
import java.util.*;
class TestaConexaoOracle
{
public static void main (String args []) throws SQLException, IOException
{
String user, password, servidor, porta, banco, strSQL;
String strSQLdef = “select SYSDATE from dual”;
String databaseURL;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
System.out.println (“Entre com as informacoes para TESTAR a conexao com o DATABASE”);
// Dados para a Conexao
servidor = readEntry ("SERVIDOR: ");
banco = readEntry("BANCO: ");
user = readEntry ("USUARIO: ");
password = readEntry ("SENHA: ");
porta = readEntry ("PORTA (default 1521): ");
strSQL = readEntry ("STRING ‘SQL’: ");
if ( strSQL == null || strSQL.equals("") )
{
strSQL = strSQLdef;
}
databaseURL = “jdbc:oracle:thin:@” + servidor + “:” + porta + “:” + banco;
System.out.print ("Conectando-se ao Banco … ");
System.out.flush ();
Connection conn = DriverManager.getConnection (databaseURL, user, password);
System.out.println (" conectado … ");
// Create a statement
Statement stmt = conn.createStatement ();
// ResultSet rset = stmt.executeQuery (“select SYSDATE from dual”);
ResultSet rset = stmt.executeQuery(strSQL);
while (rset.next ())
{
System.out.println (" -> Resultado do SELECT: " + rset.getString (1));
}
System.out.println (“Conexao JDBC ok.”);
}
// Function para ler as informações de entrada
static String readEntry (String prompt)
{
try
{
StringBuffer buffer = new StringBuffer ();
System.out.print (prompt);
System.out.flush ();
int c = System.in.read ();
while (c != 'n' && c != -1)
{
buffer.append ((char)c);
c = System.in.read ();
}
return buffer.toString ().trim ();
} catch (IOException e) {
return "";
}
}
}
:?: :?: :?: