id
stringlengths 36
36
| text
stringlengths 1
1.25M
|
---|---|
2afc130f-6379-4448-be02-a20fe3c0663d | public void setRender(boolean render) {
this.render = render;
} |
5aecf894-9234-461d-8ace-7f43ef5d3cb4 | public RegistroInmueblesBean() {
// TODO Auto-generated constructor stub
} |
eca286f9-a3b6-4a13-9f0c-216a19cca7bd | public void registroInmuebles(ActionEvent evento) {
if (evento.getComponent().getId().equals("guardar")) {
Inmuebles Inm = new Inmuebles(0, Comments, Comments, Comments, Comments);
InmueblesDao InmD = new InmueblesDao();
Conexion conexion = new Conexion();
Inm.setINMNOM(this.nombre);
Inm.setINMDIR(this.direccion);
Inm.setINMTEL(this.telefono);
Inm.setINMVENOARR(this.VentOArr);
Inm.setINMNEGOC(this.TipNeg);
Inm.setINCCOMMENTS(this.Comments);
//Inm.setIdusuario(this.idusuario);
InmD.crearInmueble(Inm, conexion);
clear();
}
} |
4e42b07a-d581-4f72-92df-9ac33518815f | public void clear(){
this.nombre="";
this.direccion="";
this.telefono="";
this.VentOArr="";
this.TipNeg="";
this.Comments="";
} |
249a7fa0-e502-49a6-97b0-e5637c35baad | public void consultain(){
//if (evento.getComponent().getId().equals("guardar")) {
InmueblesDao InmD = new InmueblesDao();
Inmuebles Inm = new Inmuebles(0,nombre ,direccion ,telefono ,TipNeg);
Conexion conexion = new Conexion();
usuario.setId(this.id);
Inm.getId();
Inm.getINMNOM();
Inm.getINMDIR();
Inm.getINMTEL();
Inm.getINMNEGOC();
System.out.println(usuario.getId());
InmD.consultarInmueble(id);
} |
bcab2149-eded-4e0a-8d4a-e5aba55f8a2d | public int getId() {
id=idn.getId();
return id;
} |
73291fb0-4ab3-42b4-8981-c5879bdfbd92 | public void setId(int id) {
this.id = id;
} |
6c76324c-adaa-4650-8f3f-03e430fb603d | public String getidusuario() {
return idusuario;
} |
8c0fe5a0-f6e5-47d2-8fb7-52c5f3036f10 | public String setidusuario(String idusuario) {
return idusuario;
} |
efc833ab-3c78-4967-b64a-4e51740252ef | public String getNombre() {
return nombre;
} |
f1e4e48b-7875-48a7-8cc3-1ccf2fd69c61 | public void setNombre(String nombre) {
this.nombre = nombre;
} |
b7654aee-dc1a-4e80-be60-ce61ee17cce0 | public String getDireccion() {
return direccion;
} |
8ef291eb-4908-434e-afaf-d23457c3ff65 | public void setDireccion(String direccion) {
this.direccion = direccion;
} |
c2bab656-b631-4945-8e80-ec9d4517eb86 | public String getTelefono() {
return telefono;
} |
1be409cd-7910-4b0b-a426-167e3cec4ddb | public void setTelefono(String telefono) {
this.telefono = telefono;
} |
4874f236-d4e9-4e6a-a681-d4e9c6651653 | public String getVentOArr() {
return VentOArr;
} |
c424d174-c7ec-4a7a-adda-e418470019a2 | public void setVentOArr(String ventOArr) {
VentOArr = ventOArr;
} |
eaa95d7a-e8f7-42a5-b287-cb94a4e7cf96 | public String getTipNeg() {
return TipNeg;
} |
ec14c7df-8a3e-43f5-b3f2-13954fdb1374 | public void setTipNeg(String tipNeg) {
TipNeg = tipNeg;
} |
95b3ec44-1518-42c0-a7ea-1ef16b846e3f | public String getComments() {
return Comments;
} |
1bedfdc9-00f1-418f-8d19-37d68fad3346 | public void setComments(String comments) {
Comments = comments;
} |
a2d9cd94-9974-443f-a7e9-54901e8a879b | public ArrayList<Inmuebles> getLista() {
InmueblesDao inmuebledao = new InmueblesDao();
lista = inmuebledao.consultarInmueble(idn.getId());
return lista;
} |
ebccde41-e5ea-4d25-a0e2-3d07a092ab1d | public void setLista(ArrayList<Inmuebles> lista) {
this.lista = lista;
} |
43bcd1c3-da21-4a50-8711-4a99db0768c6 | public Usuario() {
// TODO Auto-generated constructor stub
} |
3547e930-d482-4a20-a438-7caefd9f949c | public int getId() {
return id;
} |
04ccb993-5b95-4f3f-ad4c-ac50428ea7ff | public void setId(int id) {
this.id = id;
} |
d554ed5c-2e70-43f9-9e2f-e25e68780471 | public String getUsuario() {
return usuario;
} |
790f2a5d-5d26-4e3f-a30f-21819aacc3ff | public void setUsuario(String usuario) {
this.usuario = usuario;
} |
107136b6-f4e8-4b3c-8ca1-768357535b87 | public String getPassword() {
return password;
} |
6fdd6ab6-abdd-4a7c-9c69-1013585045ff | public void setPassword(String password) {
this.password = password;
} |
28210653-b508-4008-86f5-fe8f97e01671 | public String getNombres() {
return nombres;
} |
38703a97-96a6-4106-8126-35e488998251 | public void setNombres(String nombres) {
this.nombres = nombres;
} |
6b909a20-25f5-4719-9b09-e2f760e491b1 | public String getApellidos() {
return apellidos;
} |
0caaa0f5-0217-40f2-a463-0d276cb5225d | public void setApellidos(String apellidos) {
this.apellidos = apellidos;
} |
6751b73a-92e4-4794-b115-5e884a64615c | public String getEmail() {
return email;
} |
bd651264-5548-4a42-b9bc-7399c55b07f9 | public void setEmail(String email) {
this.email = email;
} |
5cf04d78-63ae-497f-8e74-a27625dcb6f3 | public boolean validarUsuario(Usuario usuario) {
boolean resp = false;
Conexion conexion = new Conexion();
try {
Connection con = conexion.getInstance().crearConexion();
Statement st = con.createStatement();
String sql = "SELECT id,COUNT(1) FROM USUARIOS WHERE usuario = '"
+ usuario.getUsuario() + "' and password ="
+ usuario.getPassword();
ResultSet res = st.executeQuery(sql);
if (res.next()) {
int a = res.getInt("id");
usuario.setId(a);
if (res.getInt(1)!=0) {
resp = true;
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
conexion.cerrarConn();
}
return resp;
} |
75211e37-dbc2-4974-989d-a98c2546b3c6 | public void guardar(Usuario usuario) {
Conexion conexion = new Conexion();
try {
Connection con = conexion.getInstance().crearConexion();
Statement st = con.createStatement();
String sql = "INSERT INTO USUARIOS ( USUARIO, PASSWORD, NOMBRES, APELLIDOS, EMAIL) VALUES ('"
+ usuario.getUsuario()
+ "','"
+ usuario.getPassword()
+ "','"
+ usuario.getNombres()
+ "','"
+ usuario.getApellidos()
+ "','"
+ usuario.getEmail()
+ "')";
st.executeUpdate(sql);
} catch (Exception e) {
e.printStackTrace();
} finally {
conexion.getInstance().cerrarConn();
}
} |
a6909f41-d21c-4e2a-9a97-2b9a1935e886 | public Inmuebles(int id, String b, String c, String d, String f) {
this.id=id;
this.INMNOM=b;
this.INMDIR=c;
this.INMTEL=d;
this.INMNEGOC=f;
} |
4a102b01-11f6-4b43-bd80-a8ee2babacf4 | public int getId() {
return id;
} |
313121a2-af72-4799-9446-834e72325e94 | public void setId(int id) {
this.id = id;
} |
a8242ca9-e3bb-4ab7-accc-e4e873eadb84 | public String getINMNOM() {
return INMNOM;
} |
22e3e317-9e45-4031-ba95-ec1b91056b84 | public void setINMNOM(String iNMNOM) {
INMNOM = iNMNOM;
} |
7f8ccf51-a991-48c7-a71b-3138da6cb0d1 | public String getINMTEL() {
return INMTEL;
} |
8db4b1f7-ba50-4645-9157-f5bd2844a2c4 | public void setINMTEL(String iNMTEL) {
INMTEL = iNMTEL;
} |
12767a08-5e0d-420c-8ee9-5b70b56b9a87 | public String getINMDIR() {
return INMDIR;
} |
465da66e-8466-4b89-bbca-bfccf4d84523 | public void setINMDIR(String iNMDIR) {
INMDIR = iNMDIR;
} |
1c1c10c9-3988-473f-a473-27b39e47cb84 | public String getINMVENOARR() {
return INMVENOARR;
} |
dfdc02d3-9218-4840-a47e-1ce17ee92e42 | public void setINMVENOARR(String iNMVENOARR) {
INMVENOARR = iNMVENOARR;
} |
efb836d1-c62f-4362-848b-ccc90698986c | public String getINMNEGOC() {
return INMNEGOC;
} |
6572c45b-13ad-4508-8872-5b43f33ec1ed | public void setINMNEGOC(String iNMNEGOC) {
INMNEGOC = iNMNEGOC;
} |
4ad25b29-9052-46da-8e8b-f075a240f00f | public String getINCCOMMENTS() {
return INCCOMMENTS;
} |
58994445-1b0d-4d60-bac2-a000b1dafe71 | public void setINCCOMMENTS(String iNCCOMMENTS) {
INCCOMMENTS = iNCCOMMENTS;
} |
2d0dd431-db6c-429b-8ee7-bd5ca267dbe2 | public String getIdusuario() {
return idusuario;
} |
433b534b-6793-463c-9538-f1caff8d396b | public void setIdusuario(String idusuario) {
this.idusuario = idusuario;
} |
cf365276-f1a2-4615-a493-b3317e81799f | public Conexion() {
crearConexion();
} |
1c7ffd56-8946-4f11-87b9-24954b9dbc36 | public Connection crearConexion() {
try {
// Properties propiedades = new Properties();
// propiedades.load(new FileInputStream(
// "/PersistenceResource.properties"));
//
// this.bd = propiedades.getProperty("bd");
// this.url = propiedades.getProperty("url");
// this.pass = propiedades.getProperty("pass");
// this.ususario = propiedades.getProperty("usuario");
Class.forName("com.mysql.jdbc.Driver");
conexion = DriverManager.getConnection("jdbc:mysql://localhost/gerencia","root", "123456");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conexion;
} |
9cb14fcb-4d78-4f97-b6c3-249e54c54e05 | public void cerrarConn() {
try {
conexion.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
6edb8070-6f64-4fa1-bdb7-008406b34751 | public Conexion getInstance() {
if (instance != null) {
return instance;
} else {
return new Conexion();
}
} |
fbf873e8-4521-463f-ab46-16effe6818e0 | public void crearInmueble(Inmuebles Inm, Conexion conexion) {
try {
Connection con = conexion.getInstance().crearConexion();
Statement st = con.createStatement();
String sql ="INSERT INTO inmueble (nombre,direccion,telefono,estado,negocio,comentarios,id)"+" VALUES("+"'"+
Inm.getINMNOM()+"',"
+ "'"+Inm.getINMDIR()+"',"
+ "'"+Inm.getINMTEL()+"',"
+ "'"+Inm.getINMVENOARR()
+"','"+Inm.getINMNEGOC()+"'"
+",'"+Inm.getINCCOMMENTS()+"'"
//+",1);";
+","+idn.getId()+");";
System.out.println(sql);
st.executeUpdate(sql);
} catch (Exception e) {
e.printStackTrace();
} finally {
conexion.getInstance().cerrarConn();
}
} |
4213c3fb-fca2-47b3-8a4a-4485141a2288 | public ArrayList<Inmuebles> consultarInmueble(int id) {
Conexion conexion = new Conexion();
try {
int a;
String b;
String c;
String d;
String f;
Connection con = conexion.getInstance().crearConexion();
Statement st = con.createStatement();
//Statement comando = conexion.createStatement();
String sql = "SELECT idin,nombre,direccion,telefono,negocio FROM inmueble WHERE id="+id+";";
//+ Inm.getId();
//"+usuario.getId()+"
ResultSet resultado = st.executeQuery(sql);
while (resultado.next()) {
a = resultado.getInt("idin");
b = resultado.getString("nombre");
c = resultado.getString("direccion");
d = resultado.getString("telefono");
f = resultado.getString("negocio");
//lista.add(a);
//lista.add(b);
//lista.add(c);
//ista.add(d);
//lista.add(f);
//Objeto del tipo Usuario
Inmuebles e = new Inmuebles(a,b,c,d,f);
lista.add(e);
for(int i = 0; i < lista.size(); i++) {
// System.out.println(lista.get(i).getId());
// System.out.println(lista.get(i).getINMNOM());
//System.out.println(lista.get(i).getINMDIR());
//System.out.println(lista.get(i).getINMTEL());
//System.out.println(lista.get(i).getINMNEGOC());
}
}
// TODO: REALIZAR LA INSERCION EN LA BASE DE DATOS, ES DECIR USTED
// DEBE PONER LA ESTRUCTURA DE INSERCION DE MYSQL QUE NOS BRINDA
// JAVA, COMO LO HACE BUSQUE EN INTERNET COMO CREAR UN METODO DE
// INSERCION EN MYSQL IMPORTANTE NO SE LE VA A PASAR LA CONEXION
} catch (Exception e) {
e.printStackTrace();
} finally {
conexion.getInstance().cerrarConn();
}
return lista;
} |
152e9795-d2fe-479f-abfd-cd25d36ed686 | public JSONArray() {
this.myArrayList = new ArrayList();
} |
9fe74a54-8c23-4122-9507-0386312f3fb9 | public JSONArray(JSONTokener x) throws JSONException {
this();
if (x.nextClean() != '[') {
throw x.syntaxError("A JSONArray text must start with '['");
}
if (x.nextClean() != ']') {
x.back();
for (;;) {
if (x.nextClean() == ',') {
x.back();
this.myArrayList.add(JSONObject.NULL);
} else {
x.back();
this.myArrayList.add(x.nextValue());
}
switch (x.nextClean()) {
case ',':
if (x.nextClean() == ']') {
return;
}
x.back();
break;
case ']':
return;
default:
throw x.syntaxError("Expected a ',' or ']'");
}
}
}
} |
25c7eeb7-9f8f-4800-949d-63cca2540b40 | public JSONArray(String source) throws JSONException {
this(new JSONTokener(source));
} |
73da02d4-f69f-4e9c-9ca5-2bca69f7d5df | public JSONArray(Collection collection) {
this.myArrayList = new ArrayList();
if (collection != null) {
Iterator iter = collection.iterator();
while (iter.hasNext()) {
this.myArrayList.add(JSONObject.wrap(iter.next()));
}
}
} |
9f3ab912-7453-4017-b811-4c116fd2012f | public JSONArray(Object array) throws JSONException {
this();
if (array.getClass().isArray()) {
int length = Array.getLength(array);
for (int i = 0; i < length; i += 1) {
this.put(JSONObject.wrap(Array.get(array, i)));
}
} else {
throw new JSONException("JSONArray initial value should be a string or collection or array.");
}
} |
b4fa4b9a-30c8-48f1-8ebe-8314bfc9833f | public Object get(int index) throws JSONException {
Object object = this.opt(index);
if (object == null) {
throw new JSONException("JSONArray[" + index + "] not found.");
}
return object;
} |
6a8c327f-c5a3-40cd-b731-2fe8eb4e3180 | public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.TRUE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("true"))) {
return true;
}
throw new JSONException("JSONArray[" + index + "] is not a boolean.");
} |
e0f436c9-bbbb-4aed-b197-7057c087cd2f | public double getDouble(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).doubleValue()
: Double.parseDouble((String) object);
} catch (NumberFormatException e) {
throw new JSONException("JSONArray[" + index + "] is not a number.");
}
} |
b6ba7d6e-e839-4a1a-84fa-f97a494f3acf | public int getInt(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).intValue()
: Integer.parseInt((String) object);
} catch (NumberFormatException e) {
throw new JSONException("JSONArray[" + index + "] is not a number.");
}
} |
74402174-c624-4cd1-bcc7-e5de4134347c | public JSONArray getJSONArray(int index) throws JSONException {
Object object = this.get(index);
if (object instanceof JSONArray) {
return (JSONArray) object;
}
throw new JSONException("JSONArray[" + index + "] is not a JSONArray.");
} |
fa881d93-5827-4542-a143-1fb0c1f707ae | public JSONObject getJSONObject(int index) throws JSONException {
Object object = this.get(index);
if (object instanceof JSONObject) {
return (JSONObject) object;
}
throw new JSONException("JSONArray[" + index + "] is not a JSONObject.");
} |
623c26ef-bd17-4190-9e3a-f5b96eaf3ab4 | public long getLong(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).longValue()
: Long.parseLong((String) object);
} catch (NumberFormatException e) {
throw new JSONException("JSONArray[" + index + "] is not a number.");
}
} |
f039b1ee-7a50-458d-8469-a5942d0064f8 | public byte getByte(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).byteValue()
: Byte.parseByte((String) object);
} catch (NumberFormatException e) {
throw new JSONException("JSONArray[" + index + "] is not a number.");
}
} |
213882cc-558c-4958-8601-cc71ee931304 | public String getString(int index) throws JSONException {
Object object = this.get(index);
if (object instanceof String) {
return (String) object;
}
throw new JSONException("JSONArray[" + index + "] not a string.");
} |
0aa91b5d-ecc6-4aa8-ae26-cec7f189a37d | public boolean isNull(int index) {
return JSONObject.NULL.equals(this.opt(index));
} |
db7997ab-72bd-41f0-b7fd-9a8bd6c997b7 | public String join(String separator) throws JSONException {
int len = this.length();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < len; i += 1) {
if (i > 0) {
sb.append(separator);
}
sb.append(JSONObject.valueToString(this.myArrayList.get(i)));
}
return sb.toString();
} |
1cc59786-0dcc-47f1-a811-9e4597ca5506 | public int length() {
return this.myArrayList.size();
} |
b483823e-8efa-4f75-b6f1-ef9f1ac2cd43 | public Object opt(int index) {
return (index < 0 || index >= this.length()) ? null : this.myArrayList
.get(index);
} |
334735cd-0ea1-41d5-aa13-b271b2b47ac4 | public boolean optBoolean(int index) {
return this.optBoolean(index, false);
} |
e7f7830e-fc01-4ced-9851-d90c6df61490 | public boolean optBoolean(int index, boolean defaultValue) {
try {
return this.getBoolean(index);
} catch (JSONException e) {
return defaultValue;
}
} |
895eb41d-546b-48be-8430-e33cfbde04c9 | public double optDouble(int index) {
return this.optDouble(index, Double.NaN);
} |
7e9ca591-43c9-47d2-94d8-3f9d656c92fc | public double optDouble(int index, double defaultValue) {
try {
return this.getDouble(index);
} catch (JSONException e) {
return defaultValue;
}
} |
407b14de-e96c-403d-9258-6b8c767fad9e | public int optInt(int index) {
return this.optInt(index, 0);
} |
7dd92e9b-5fba-4a0f-82b2-7f24a237f079 | public int optInt(int index, int defaultValue) {
try {
return this.getInt(index);
} catch (JSONException e) {
return defaultValue;
}
} |
9a4586a5-b542-426f-8460-85ef7517f9d9 | public JSONArray optJSONArray(int index) {
Object o = this.opt(index);
return o instanceof JSONArray ? (JSONArray) o : null;
} |
fd6dbcb8-5cab-426a-ad75-d366d0d7cbc0 | public JSONObject optJSONObject(int index) {
Object o = this.opt(index);
return o instanceof JSONObject ? (JSONObject) o : null;
} |
2d06136b-3036-4122-bf62-7b70eda1d9ff | public long optLong(int index) {
return this.optLong(index, 0);
} |
5a18574e-0f01-464d-baf2-0d514a9406e9 | public long optLong(int index, long defaultValue) {
try {
return this.getLong(index);
} catch (JSONException e) {
return defaultValue;
}
} |
39436667-fed1-417b-8ba5-f67a9cedc320 | public String optString(int index) {
return this.optString(index, "");
} |
8c534ef2-7f1a-443a-841a-08db40a52782 | public String optString(int index, String defaultValue) {
Object object = this.opt(index);
return JSONObject.NULL.equals(object) ? defaultValue : object
.toString();
} |
4f9f717f-6669-46f0-b361-eff5d7f4928c | public JSONArray put(boolean value) {
this.put(value ? Boolean.TRUE : Boolean.FALSE);
return this;
} |
2e43c40a-54f8-4315-bde2-268f598076f3 | public JSONArray put(Collection value) {
this.put(new JSONArray(value));
return this;
} |
127759cb-adaa-491a-b87e-a24a619ed9a9 | public JSONArray put(double value) throws JSONException {
Double d = new Double(value);
JSONObject.testValidity(d);
this.put(d);
return this;
} |
41489fc9-cc6f-4555-b978-86e039bf0bc0 | public JSONArray put(int value) {
this.put(new Integer(value));
return this;
} |
ba0ead3a-4db7-46b1-bc03-9fd49d632bde | public JSONArray put(long value) {
this.put(new Long(value));
return this;
} |
5e5d6d18-654d-4883-9acc-a917b5874d87 | public JSONArray put(Map value) {
this.put(new JSONObject(value));
return this;
} |
d32c982a-165e-4aa5-bd42-903b15b719c1 | public JSONArray put(Object value) {
this.myArrayList.add(value);
return this;
} |
59eb20b2-271d-4b8a-ba49-ec902996e8d5 | public JSONArray put(int index, boolean value) throws JSONException {
this.put(index, value ? Boolean.TRUE : Boolean.FALSE);
return this;
} |
bf344abf-c63b-47a9-9dd5-6e98304d143a | public JSONArray put(int index, Collection value) throws JSONException {
this.put(index, new JSONArray(value));
return this;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.