🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.lenguajes.java
Article #551

Re: LLAMADA A CLASE DENTRO DE PAQUETE NO FUNCIONA

#551
From: GRUPOS DE JAVA
Date: Sat, 31 Mar 2007 23:09
45 lines
2567 bytes
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: <1175382586.911882.81370@e65g2000hsc.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!e65g2000hsc.googlegroups.com!not-for-mail
References: <1175374531.701062.155720@q75g2000hsh.googlegroups.com> <1vv2e4-qn6.ln1@Father.family>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1116f3,b87246fcf45f6803
X-Google-Attributes: gid1116f3,public
X-Google-Language: ENGLISH,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: LLAMADA A CLASE DENTRO DE PAQUETE NO FUNCIONA
Date: 31 Mar 2007 16:09:47 -0700
Organization: http://groups.google.com
Lines: 47
Message-ID: <1175382586.911882.81370@e65g2000hsc.googlegroups.com>
References: <1175374531.701062.155720@q75g2000hsh.googlegroups.com>
   <1vv2e4-qn6.ln1@Father.family>
NNTP-Posting-Host: 189.131.78.136
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1175382588 947 127.0.0.1 (31 Mar 2007 23:09:48 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 31 Mar 2007 23:09:48 +0000 (UTC)
In-Reply-To: <1vv2e4-qn6.ln1@Father.family>
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_