Article View: es.comp.lenguajes.java
Article #552re: hace rato mande un post aqui tengo bien lo que debi haber puesto
From: GRUPOS DE JAVA
Date: Sat, 31 Mar 2007 23:40
Date: Sat, 31 Mar 2007 23:40
106 lines
4394 bytes
4394 bytes
ANTERIOR:
HOLA AMIGOS DEL GRUPO PUES TENGO UN PROBLEMA QUE ME TIENE ATORADO EN
EL AVANCE DE MI PROYECTO ESTO ES QUE TENGO VARIAS CLASES TODAS
DEPENDEN DE UNA UNICA CLASE QUE ES UNA CONEXION A UNA BD Y LAS QUIERO
EMPAQUETAR EN UN PAQUETE X, PERO EL PROBLEMA ES QUE CUANDO QUIERO
COMPILAR UNA CLASE QUE MANDA A LLAMAR OTRA DEL MISMO PAQUETE ME MARCA
QUE NO EXISTE LA CLASE AQUI ESTA UNA PARTE DE CADA CLASE LA QUE ME
CAUSA CONFLICTO AL COMPILAR ES LA CLASE MULTIIUSOS.JAVA:
* la clase Conexion
package sacip;
import java.sql.*;
public class Conexion {
public Conexion() {
}
public final static Connection getConexion
(String URLBd, String login, String password) throws
Exception {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
return DriverManager.getConnection
(URLBd,login,password);
}
catch(Exception ex) {
System.out.println(ex.toString());
return null;
}
}
}
* la clase Multiusos
package X;
import java.sql.*;
public class MultiUsos {
/*declaracion de variables para conexion con la BD y para usuario de
mysql.*/
private final static String log = "log";
private final static String pswd = "password";
private final static String Bd = "sistema";
private final static String URL = "jdbc:mysql://localhost:
3306/"+Bd;
private Connection con = null;
private ResultSet rs = null;
private Statement stmt = null;
private Conexion conexion = null;
EN ESTA ULTIMA LINEA ME MARCA ERROR O SEA ESTO:
cannot find symbol
private Conexion conexion = null;
Symbol: class Conexion
Location:class.sacip.Multiusos;
1 error.
todas las clases ESTAN DENTRO DE UN DIRECTORIO LLAMADO X, SE QUE DEBEN
DE IR DENTRO PERO NO SE CUAL ES LA RAZON DE QUE ME MARQUE ESO.
AGRADECERIA MUCHO SI ME AYUDAN A RESOLVER ESTA DUDA.SALUDOS.
NUEVO:
ok, aqui esta lo corregido porque no lo habia puesto bien,
* Clase Conexion
package X;
import java.sql.*;
public class Conexion {
public final static Connection getConexion
(String URLBd, String login, String password) throws
Exception {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
return DriverManager.getConnection
(URLBd,login,password);
}
catch(Exception ex) {
System.out.println(ex.toString());
return null;
}
}
}
* Clase MultiUsos
package X;
import java.sql.*;
import X.*;
public class MultiUsos {
/*declaracion de variables para conexion con la BD y para usuario de
mysql.*/
private final static String log = "log";
private final static String pswd = "password";
private final static String Bd = "sistema";
private final static String URL = "jdbc:mysql://localhost:
3306/"+Bd;
private Connection con = null;
private ResultSet rs = null;
private Statement stmt = null;
private Conexion conexion = null;
y tambien he probado la ultima linea como : private X.Conexion
conexion = null;
Y ME SIGUE MARCANDO EL MISMO ERROR, SABEN PORQUE?, todas los archivos
estan en la misma carpeta llamada X.
Technical Details
Message-ID:
<1175384410.517939.132920@e65g2000hsc.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!e65g2000hsc.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,f4166d2dffee50fc,start X-Google-Attributes: gid1116f3,public X-Google-Language: SPANISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!e65g2000hsc.googlegroups.com!not-for-mail From: "GRUPOS DE JAVA" <omm1979@gmail.com> Newsgroups: es.comp.lenguajes.java Subject: re: hace rato mande un post aqui tengo bien lo que debi haber puesto Date: 31 Mar 2007 16:40:10 -0700 Organization: http://groups.google.com Lines: 107 Message-ID: <1175384410.517939.132920@e65g2000hsc.googlegroups.com> NNTP-Posting-Host: 189.131.78.136 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1175384412 5270 127.0.0.1 (31 Mar 2007 23:40:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 31 Mar 2007 23:40:12 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e65g2000hsc.googlegroups.com; posting-host=189.131.78.136; posting-account=SUVqDAwAAACMYIJlcEhY29h6VjIQnh1_