cual es el error?
Publicado por yelcamion (1 intervención) el 13/04/2007 06:28:24
cual es el error me marca
illegal start of expression
en la linea que dice---- public ConexionBd() {
import java.sql.*;
public class ConexionBd {
public String error=”";
public Connection con=null;
private Statement stt;
private ResultSet rSet;
public boolean conectaBd(){
boolean resp=false;
try{
Class.forName(”org.gjt.mm.mysql.Driver”).newInstance();
this.con=DriverManager.getConnection(”jdbc:mysql://localhost/bolsa_de_trabajo”,”root”,”23456789″);
System.out.print(”se conecto a la bd”);
resp=true;
}catch(Exception e){
System.out.println(”No se puede realizar la conexión”);
System.out.println(e);
}
return resp;
}
public ConexionBd() { <<<<---- EN ESTA LINEA ME MARCA EL ERROR???
super();
}
public int Inserta (String sentencia){
int dat=0;
if(conectaBd()){
try{
this.stt=this.con.createStatement();
dat=this.stt.executeUpdate(sentencia);
this.stt.close();
this.con.close();
}
catch(Exception e){
this.error=”no se puedo realizar el insert a la bd”;
}
}
return dat;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ConexionBd c = new ConexionBd();
c.conectaBd();
}
}
illegal start of expression
en la linea que dice---- public ConexionBd() {
import java.sql.*;
public class ConexionBd {
public String error=”";
public Connection con=null;
private Statement stt;
private ResultSet rSet;
public boolean conectaBd(){
boolean resp=false;
try{
Class.forName(”org.gjt.mm.mysql.Driver”).newInstance();
this.con=DriverManager.getConnection(”jdbc:mysql://localhost/bolsa_de_trabajo”,”root”,”23456789″);
System.out.print(”se conecto a la bd”);
resp=true;
}catch(Exception e){
System.out.println(”No se puede realizar la conexión”);
System.out.println(e);
}
return resp;
}
public ConexionBd() { <<<<---- EN ESTA LINEA ME MARCA EL ERROR???
super();
}
public int Inserta (String sentencia){
int dat=0;
if(conectaBd()){
try{
this.stt=this.con.createStatement();
dat=this.stt.executeUpdate(sentencia);
this.stt.close();
this.con.close();
}
catch(Exception e){
this.error=”no se puedo realizar el insert a la bd”;
}
}
return dat;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ConexionBd c = new ConexionBd();
c.conectaBd();
}
}
Valora esta pregunta


0