Article View: es.comp.lenguajes.java
Article #547LLAMADA A CLASE DENTRO DE PAQUETE NO FUNCIONA
From: GRUPOS DE JAVA
Date: Sat, 31 Mar 2007 20:55
Date: Sat, 31 Mar 2007 20:55
57 lines
3036 bytes
3036 bytes
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.
Technical Details
Message-ID:
<1175374531.701062.155720@q75g2000hsh.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!q75g2000hsh.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,b87246fcf45f6803,start X-Google-Attributes: gid1116f3,public X-Google-Language: SPANISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!q75g2000hsh.googlegroups.com!not-for-mail From: "GRUPOS DE JAVA" <omm1979@gmail.com> Newsgroups: es.comp.lenguajes.java Subject: LLAMADA A CLASE DENTRO DE PAQUETE NO FUNCIONA Date: 31 Mar 2007 13:55:31 -0700 Organization: http://groups.google.com Lines: 58 Message-ID: <1175374531.701062.155720@q75g2000hsh.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 1175374533 25762 127.0.0.1 (31 Mar 2007 20:55:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 31 Mar 2007 20:55:33 +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: q75g2000hsh.googlegroups.com; posting-host=189.131.78.136; posting-account=SUVqDAwAAACMYIJlcEhY29h6VjIQnh1_