Ir para conteúdo
Fórum Script Brasil

bolomaster

Veteranos
  • Total de itens

    827
  • Registro em

  • Última visita

Sobre bolomaster

  • Data de Nascimento 16/01/1983

Contatos

  • MSN
    rm_designer@hotmail.com
  • ICQ
    174721876
  • Yahoo
    rafapicu@yahoo.com.br

Perfil

  • Gender
    Male
  • Location
    paracatu
  • Interests
    mulheres e informatica

bolomaster's Achievements

0

Reputação

  1. bolomaster

    problemas com upload

    Pessoal resolvi continuar pesquisando e vejam so eu achei um script que faz mas está dando outro erro alguém poderia me ajudar os arquivos são estes oh <?php $pasta = $_REQUEST['dir']; $troca = str_replace("\\", "/", $pasta); $nome = $_REQUEST['nome']; ?> <style type="text/css"> <!-- .style12 { color: #FFFFFF; font-weight: bold; } --> </style> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="3" cellpadding="0" class="link"> <tr> <td valign="middle"><div align="right"></div></td> </tr> <tr> <td width="34%" bgcolor="#1B3E78"><div align="center" class="style12">ASSISTENTE PARA GERAR NOVO ARTEFATO (ETAPA 1 SELECIONAR ARQUIVOS)</div></td> </tr> <tr> <td><form action="addarquivos.php" method="post" enctype="multipart/form-data" name="form1"> <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#1B3E78" bgcolor="#FFFFFF" class="link"> <tr> <td width="23%"><div align="left">Selecionar Arquivo::</div></td> <td width="77%"><label> <input type="file" name="arquivo" id="arquivo"> <input name="pasta" type="hidden" id="pasta" value="<?php echo $pasta;?>" /> <input name="nome" type="hidden" id="nome" value="<?php echo $nome;?>" /> </label></td> </tr> <tr> <td colspan="2">Arquivos Selecionados:<br /> <?php $count = 0; if ($handle = opendir('./'.$troca)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") {$count++; echo '<loc>'.$file.'</loc> <br />'; } } closedir($handle); } ?> </td> </tr> <tr> <td colspan="2"><div align="right"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div align="left"> <label></label> </div></td> <td><div align="center"> <input type="image" name="imageField" id="imageField" src="imagens/ADDFILE.gif"> </div></td> </tr> </table> </div></td> </tr> <tr> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"><a href="conteudo.php?pag=artefatos"><img src="imagens/botaocancelar.gif" alt="CANCELAR" width="186" height="43" border="0"></a></div></td> <td><div align="center"><a href="conteudo.php?pag=adicionarusuario"><img src="imagens/BOTAOEXPORTARART.gif" alt="CANCELAR" width="186" height="46" border="0"></a></div></td> </tr> </table></td> </tr> </table> </form> </td> </tr> </table></td> </tr> </table> agora o arquivo de upload alterado <?php //nome da pasta onde vao ficar armazenados os arquivos $dir = str_replace(" ", "%20", $_POST['pasta']."/"); $componente = $_POST['nome']; $uploaddir = './'.$dir;//<----This is all I changed $uploadfile = $uploaddir . basename($_FILES['arquivo']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; echo $dir."<br>"; echo $componente; ?> e agora o erro . Warning: move_uploaded_file(./artefatos/calendario%20Fauno/comprovanet.pdf) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home4/albernaz/public_html/sisgear/addarquivos.php on line 9 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpq5TFRy' to './artefatos/calendario%20Fauno/comprovanet.pdf' in /home4/albernaz/public_html/sisgear/addarquivos.php on line 9 Possible file upload attack! Here is some more debugging info:Array ( [arquivo] => Array ( [name] => comprovanet.pdf [type] => application/pdf [tmp_name] => /tmp/phpq5TFRy [error] => 0 => 183151 ) ) artefatos/calendario%20Fauno/ calendario Fauno por favor se alguém souber o porque me ajude ok!! abraços
  2. Pessoal, é o seguinte não sei porque cargas d'aguas não estou conseguindo fazer esse upload funcionar a ideia é que ele faca o up do arquivo em um local especifico, não dá erro mas também não envia o arquivo alguém sabe me dizer o porque segue o codigo de upload
  3. Olá pessoal bom dia a todos estou com um pqno problema e gostaria da ajuda de voces <script language="javascript"> function listdados( valor ) { http.open("GET", "campoprodutor.asp?id=" + valor, true); http.onreadystatechange = handleHttpResponse; http.send(null); } function handleHttpResponse(){ campo_select = document.forms[0].campo; if (http.readyState == 4) { campo_select.options.length = 0; results = http.responseText.split(","); for( i = 0; i < results.length; i++ ) { string = results[i].split( "|" ); campo_select.options[i] = new Option( string[0], string[1] ); } } } function listdados2( valor2 ) { http2.open("GET", "veiculotransportadora.asp?id2=" + valor2, true); http2.onreadystatechange = handleHttpResponse2; http2.send(null); } function handleHttpResponse2() { campo_select2 = document.forms[0].veiculo; if (http2.readyState == 4) { campo_select2.options.length = 0; results2 = http2.responseText.split(","); for( y = 0; y < results2.length; y++ ) { string2 = results2[y].split( "|" ); campo_select2.options[y] = new Option( string2[0], string2[1] ); } } } function getHTTPObject() { var req; try { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); if (req.readyState == null) { req.readyState = 1; req.addEventListener("load", function () { req.readyState = 4; if (typeof req.onReadyStateChange == "function") req.onReadyStateChange(); }, false); } return req; } if (window.ActiveXObject) { var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; for (var i = 0; i < prefixes.length; i++) { try { req = new ActiveXObject(prefixes[i] + ".XmlHttp"); return req; } catch (ex) {}; } } } catch (ex) {} alert("XmlHttp Objects not supported by client browser"); } var http = getHTTPObject(); // Logo após fazer a verificação, é chamada a função e passada // o valor à variável global http. </script> <table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td><table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#273F27"> <tr> <td bgcolor="#000033"><div align="center" class="style1">ASSISTENTE PARA ADICIONAR NOVO AGENDAMENTO / ETAPA 1 (NOVO)</div></td> </tr> <tr> <td height="242"> <form name="form1" method="post" action="etapa1agendamento.asp"> <table width="95%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <td class="style2"><div align="right">PRODUTOR:</div></td> <td><label> <% sqlpro = "select codigoprodutor, nomerazaoprodutor from tb_produtores order by nomerazaoprodutor ASC" set rspro = db.execute(sqlpro) %> <select name="produtor" id="produtor" onchange="listdados( this.value )"> <option></option> <% do while not rspro.eof %> <option value="<%=rspro.fields("codigoprodutor")%>"><%=rspro.fields("nomerazaoprodutor")%></option> <%rspro.movenext loop%> </select> </label></td> </tr> <tr> <td class="style2"><div align="right">CAMPO:</div></td> <td><label> <select name="campo"> </select> </label></td> </tr> <tr> <td class="style2"><div align="right">TRANSPORTADORA:</div></td> <td> <label> <% sqltran = "select codigotransportadora, nomerazaotransportadora from tb_transportadoras order by nomerazaotransportadora ASC" set rstran = db.execute(sqltran) %> <select name="transportadora" id="transportadora" onchange="listdados2( this.value )"> <option></option> <% do while not rstran.eof %> <option value="<%=rstran.fields("codigotransportadora")%>"><%=rstran.fields("nomerazaotransportadora")%></option> <%rstran.movenext loop%> </select> </label></td> </tr> <tr> <td class="style2"><div align="right">VEICULO:</div></td> <td> <label> <select name="veiculo" > </select> </label></td> </tr> <tr> <td width="43%" class="style2"><div align="right">FABRICA:</div></td> <td width="57%"><label> <% sqlfab = "select codigofabrica, nomerazaofabrica from tb_fabricas order by nomerazaoFabrica ASC" set rsfab = db.execute(sqlfab) %> <select name="fabrica" id="fabrica"> <option></option> <%do while not rsfab.eof%> <option value="<%=rsfab.fields("codigofabrica")%>"><%=rsfab.fields("nomerazaofabrica")%></option> <%rsfab.movenext loop%> </select> </label></td> </tr> <tr> <td><label> <div align="center" class="style1"> <div align="center"><a href="tela.asp?item=novoagendamento"><img src="imagens/limpar.gif" alt="LIMPAR SELECAO" width="22" height="15" border="0" /><br /> <span class="style6">CANCELAR</span></a></div> </div> <div align="right"> </label> <label> </label> </div></td> <td><div align="center" class="style1"> <label> <input type="image" name="imageField" id="imageField" src="imagens/avancar2.gif" /> </label> </div></td> </tr> <tr> <td>&nbsp;</td> <td><div align="right"><a href="tela.asp?item=agendamentos"><img src="imagens/voltar.gif" alt="retornar" width="22" height="16" border="0" /> RETORNAR </a></div></td> </tr> </table> </form> </td> </tr> </table></td> </tr> </table></td> </tr> </table> Este codigo acima representa um pagina se selecao de dados dai tenho dois combos dinamicos, so que apenas o compo campo carrega os dados o combo veiculo não carrega já verifiquei no banco e está tudo ok, o problema está relacionado com o meu javascript será que voces poderiam me ajudar? Abraços a todos do Forum
  4. Agora deu esse erro type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Exception in JSP: /listarClientes.jsp:54 51: <td align=center><a href="">Alterar</a></td> 52: <td align=center><a href="">Apagar</a></td> 53: </tr> 54: <%for(int i=0;i<ua1.size();i++) { %> 55: <tr bgcolor=white> 56: <td align=center><%=ua1.get(i).getId_Cliente()%></td> 57: <td align=center><%=ua1.get(i).getId_TipoCliente()%></td> Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.jsp.listarClientes_jsp._jspService(listarClientes_jsp.java:101) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
  5. tem não eu so tenho esses arquivos...
  6. E ai pessoal eu novamente veja se vocês podem me ajudar.. este é o erro que minha pagina HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.jsp.listarClientes_jsp._jspService(listarClientes_jsp.java:101) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs. ---------------------------------- segue abaixo os arquivos listarClientes.jsp <%@page import="negocio.UsuarioNegocio"%> <%@page import="negocio.Usuario"%> <%@page import="negocio.ClientesNegocio"%> <%@page import="negocio.Clientes"%> <%@page import="java.util.ArrayList"%> <% ClientesNegocio un1 = new ClientesNegocio(); UsuarioNegocio un = new UsuarioNegocio(); String nick = (String) session.getAttribute("nick"); String senha = (String) session.getAttribute("senha"); int valida = un.autenticarUsuario(nick, senha); if(valida == 0 )response.sendRedirect("telaerro.jsp?msg=usuário inválido"); ArrayList<Clientes> ua1 = un1.listaClientes(); %> <html> <head> <title>Menu de opções</title> </head> <body bgcolor=white> <form name=acesso action="principal.jsp" method=get> <table width=60% align=center bgcolor=red border=1> <tr bgcolor=white> <td align=center><a href="listarClientes.jsp">Listar Clientes</a></td> <td align=center><a href="procurarclientes.jsp">Procurar Clientes</a></td> <td align=center><a href="inserirclientes.jsp">Inserir Clientes</a></td> <td align=center><a href="inserirtipocliente.jsp">Inserir Tipo de Clientes</a></td> <td align=center><a href="principal.jsp"><< VOLTAR</a></td> </tr> </table> <br> <br> <table width=60% align=center bgcolor=red border=1> <tr bgcolor=white> <td align=center colspan="10">Lista de Clientes</td> </tr> <tr> <td align=center>ID</td> <td align=center>Tipo de Cliente</td> <td align=center>Nome</td> <td align=center>CPF</td> <td align=center>RG</td> <td align=center>Endereço</td> <td align=center>Cidade</td> <td align=center>Estado</td> <td align=center><a href="">Alterar</a></td> <td align=center><a href="">Apagar</a></td> </tr> <%for(int i=0;i<ua1.size();i++) { %> <tr bgcolor=white> <td align=center><%=ua1.get(i).getId_Cliente()%></td> <td align=center><%=ua1.get(i).getId_TipoCliente()%></td> <td align=center><%=ua1.get(i).getNome()%></td> <td align=center><%=ua1.get(i).getCpf()%></td> <td align=center><%=ua1.get(i).getRg()%></td> <td align=center><%=ua1.get(i).getEndereco()%></td> <td align=center><%=ua1.get(i).getCidade()%></td> <td align=center><%=ua1.get(i).getUf()%></td> <td align=center><a href="">Alterar</a></td> <td align=center><a href="">Apagar</a></td> </tr> <% } %> </table> <br> <br> </form> </body> </html> Cliente.java package negocio; public class Clientes { private int id_Cliente; private int id_TipoCliente; private String nome; private String cpf; private String rg; private String endereco; private String cidade; private String uf; public Clientes(int id_TipoCliente, String nome, String cpf, String rg, String endereco, String cidade, String uf) { this.id_TipoCliente = id_TipoCliente; this.nome = nome; this.cpf = cpf; this.rg = rg; this.endereco = endereco; this.cidade = cidade; this.uf = uf; this.id_Cliente =0; } public Clientes (String cpf, String rg) { this.cpf = cpf; this.rg = rg; this.id_Cliente = 0; } public int getId_TipoCliente() { return id_TipoCliente; } public String getNome() { return nome; } public String getCpf() { return cpf; } public String getRg() { return rg; } public String getEndereco() { return endereco; } public String getCidade() { return cidade; } public String getUf() { return uf; } public int getId_Cliente() { return id_Cliente; } public void setId_Cliente(int id_Cliente) { this.id_Cliente = id_Cliente; } } ClienteNEgocio.JAVA package negocio; import java.util.ArrayList; import persistencia.ClientesDAO; public class ClientesNegocio { public int verificarCliente(int Id_TipoCliente, String nome, String cpf, String rg, String endereco, String cidade, String uf) { Clientes cliente = new Clientes(cpf, rg); ClientesDAO uDAO = new ClientesDAO(); cliente = uDAO.verificarCliente(cliente); if(cliente.getId_Cliente() == 0 ) { System.out.println("Este Cliente já existe em nosso banco de dados"); return 0; } else { System.out.println("Cliente Cadastrado com sucesso em nosso banco de dados"); return 1; } } public ArrayList<Clientes> listaClientes() { ClientesDAO uDAO = new ClientesDAO(); return uDAO.verificarCliente("", ""); } public int inserirClientes(int id_TipoCliente,String nome, String cpf, String rg, String endereco, String cidade, String uf ) { if(id_TipoCliente == 0 || nome == "" || cpf == "" || rg == "" || endereco == "" || cidade == "" || uf == "")return 0; ClientesDAO uDAO = new ClientesDAO(); //verifica cliente existente ArrayList<Clientes> ua = uDAO.verificarCliente("CPF = '" + cpf + "'", ""); if(ua.size()>0) return 0; else { //insere cliente Clientes cliente = new Clientes(id_TipoCliente, nome, cpf, rg, endereco, cidade, uf); uDAO.inserirCliente(cliente); return 1; } } } CLientesDAO package persistencia; import negocio.Clientes; import java.util.ArrayList; import java.sql.*; public class ClientesDAO { public void inserirCliente (Clientes cliente) { try { Connection con = Banco.getConexao(); Statement stmt = con.createStatement(); String query = "INSERT INTO tb_cliente(id_TipoCliente, nome, cpf, rg, endereco, cidade, uf)" + " VALUES "+ "("+ cliente.getId_TipoCliente() + ","+ "'"+ cliente.getNome() + "',"+ "'"+ cliente.getCpf() +"'," + "'"+ cliente.getRg() + "'," + "'"+ cliente.getEndereco() + "',"+ "'"+ cliente.getCidade() + "',"+ "'"+ cliente.getUf() + "') "; stmt.executeUpdate(query); stmt.close(); con.close(); } catch (SQLException e) { System. out.println("Erro = "+e.getMessage()); } } public Clientes consultaClientePK(int id) { try { Connection con = Banco.getConexao(); Clientes cliente = null; Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_cliente where id_Cliente = "+id); if(res.next()) { cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"), res.getString("cidade"),res.getString("uf")); cliente.setId_Cliente(id); } return cliente; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } public Clientes consultaTodosClientes() { try { Connection con = Banco.getConexao(); Clientes cliente = null; Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_cliente"); if(res.next()) { cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"), res.getString("cidade"),res.getString("uf")); } return cliente; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } public Clientes verificarCliente(Clientes cliente) { try { cliente.setId_Cliente(0); Connection con = Banco.getConexao(); Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_clientes where cpf = '"+cliente.getCpf() + "',and rg='"+cliente.getRg() + "'"); if(res.next()) { cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"), res.getString("cidade"), res.getString("uf")); cliente.setId_Cliente(res.getInt("id_Cliente")); } return cliente; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } public ArrayList<Clientes> verificarCliente(String filtro, String ordem) { ArrayList<Clientes> ua = new ArrayList<Clientes>(); try { if(filtro.compareTo("") != 0) filtro = " where " + filtro; if(ordem.compareTo("") != 0) ordem = " Order By " + ordem; Connection con = Banco.getConexao(); Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_clientes " + filtro + " " + ordem); while(res.next()) { Clientes cliente; cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"),res.getString("cidade"), res.getString("uf")); cliente.setId_Cliente(res.getInt("id_Cliente")); ua.add(cliente); } return ua; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } }
  7. bolomaster

    ECLIPSE + JSP

    beleza ok .. muito obrigado tive de instalar o wtp mesmo ... abraços
  8. bolomaster

    ECLIPSE + JSP

    eu vi um professor uma vez ensinar como configurar o eclipse para desenvolver em ambiente web sem utilizar plugin ... so que não me lembro como faz alguém poderia ajudar ?????? abraços
  9. bolomaster

    Ajuda com JAVA

    beleza resolvido ... obrigado a todos
  10. bolomaster

    Ajuda com JAVA

    mais ou menos.... mas vou tentar aqui
  11. bolomaster

    Ajuda com JAVA

    Pessoal, estou pouco familiarizado com JAVA e ontem fazendo um trabalho de desenvolvimento por camadas surgiu o seguinte erro que não consegui resolver vou postar os .java da camada de negocio e persistencia.. Camada de negocio Arquivo Clientes.java package negocio; public class Clientes { private int id_Cliente; private int id_TipoCliente; private String nome; private String cpf; private String rg; private String endereco; private String cidade; private String uf; public Clientes(int id_TipoCliente, String nome, String cpf, String rg, String endereco, String cidade, String uf) { this.id_TipoCliente = id_TipoCliente; this.nome = nome; this.cpf = cpf; this.rg = rg; this.endereco = endereco; this.cidade = cidade; this.uf = uf; this.id_Cliente =0; } public Clientes (String cpf, String rg) { this.cpf = cpf; this.rg = rg; this.id_Cliente = 0; } public int getId_TipoCliente() { return id_TipoCliente; } public String getNome() { return nome; } public String getCpf() { return cpf; } public String getRg() { return rg; } public String getEndereco() { return endereco; } public String getCidade() { return cidade; } public String getUf() { return uf; } public int getId_Cliente() { return id_Cliente; } public void setId_Cliente(int id_Cliente) { this.id_Cliente = id_Cliente; } } camada de negocio clientesNegocio.java camada de persistencia arquivo ClientesDAO.java package persistencia; import negocio.Clientes; import java.util.ArrayList; import java.sql.*; public class ClientesDAO { public void inserirCliente (Clientes cliente) { try { Connection con = Banco.getConexao(); Statement stmt = con.createStatement(); String query = "INSERT INTO tb_cliente(id_TipoCliente, nome, cpf, rg, endereco, cidade, uf)" + " VALUES "+ "("+ cliente.getId_TipoCliente() + ","+ "'"+ cliente.getNome() + "',"+ "'"+ cliente.getCpf() +"'," + "'"+ cliente.getRg() + "'," + "'"+ cliente.getEndereco() + "',"+ "'"+ cliente.getCidade() + "',"+ "'"+ cliente.getUf() + "') "; stmt.executeUpdate(query); stmt.close(); con.close(); } catch (SQLException e) { System. out.println("Erro = "+e.getMessage()); } } public Clientes consultaClientePK(int id) { try { Connection con = Banco.getConexao(); Clientes cliente = null; Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_cliente where id_Cliente = "+id); if(res.next()) { cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"), res.getString("cidade"),res.getString("uf")); cliente.setId_Cliente(id); } return cliente; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } public Clientes consultaTodosClientes() { try { Connection con = Banco.getConexao(); Clientes cliente = null; Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_cliente"); if(res.next()) { cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"), res.getString("cidade"),res.getString("uf")); } return cliente; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } public Clientes verificarCliente(Clientes cliente) { try { cliente.setId_Cliente(0); Connection con = Banco.getConexao(); Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_clientes where cpf = '"+cliente.getCpf() + "',and rg='"+cliente.getRg() + "'"); if(res.next()) { cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"), res.getString("cidade"), res.getString("uf")); cliente.setId_Cliente(res.getInt("id_Cliente")); } return cliente; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } public ArrayList<Clientes> verificarCliente(String filtro, String ordem) { ArrayList<Clientes> ua = new ArrayList<Clientes>(); try { if(filtro.compareTo("") != 0) filtro = " where " + filtro; if(ordem.compareTo("") != 0) ordem = " Order By " + ordem; Connection con = Banco.getConexao(); Statement stat = con.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM tb_clientes " + filtro + " " + ordem); while(res.next()) { Clientes cliente; cliente = new Clientes(res.getInt("id_TipoCliente"), res.getString("nome"), res.getString("cpf"), res.getString("rg"), res.getString("endereco"),res.getString("cidade"), res.getString("uf")); cliente.setId_Cliente(res.getInt("id_Cliente")); ua.add(cliente); } return ua; } catch(SQLException e) { System.out.println("Erro = "+e.getMessage()); return null; } } } o erro está onde eu marquei de vermelho e dá a seguinte msg : This method must return a result of type int até o momento eu entendi que o metodo não pode retornar um tipo inteiro, mas tenho outro conjunto de classes para usuarios e está funcionando desta mesma forma... alguém tem alguma sugestão ? Agradeço a ajuda de todos...
  12. Pessoal Consegui resolver e vou postar como eu resolvi ok Moderador já pode fechar esse post
  13. E ai pessoal ninguém tem uma sugestão para esse problema não ?
  14. <!-- #include file ="configuracoes.ini") --> <html> <head> <title><%=titulo%></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <% campo = request.querystring("campo") if campo = "" then campo="foto1" response.write("você deve selecionar uma foto") end if %> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <% id = 62 sql = "select * from conteudo where id = " &id& "" set rs = db.execute(sql) do while not rs.eof %> <table width="640" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> <img src="<%=img%><%=rs.fields(campo)%>" width="640" height="480"> </td> </tr> <tr> <% for i = 1 to 60 campo = "foto"&i next %> <td><div align="center"> <a href="fotos.asp?campo=foto<%=i-1%>">&lt;&lt; Anterior</a></div></td> <td><div align="center"><a href="fotos.asp?campo=foto<%=i+1%>">Pr&oacute;ximo &gt;&gt; </a></div></td> </tr> </table> <% rs.movenext loop %> </body> </html> Eu estou quereno navegar entre as fotos que estao em um registro as fotos vao de 1 a 60 to tentando ir de uma foto para a outra so que não estou conseguindo quem puder ajudar dá uma mão o link para acessar o que eu estou tentando fazer é www.dgraus.com/fotos.asp ok abraços
×
×
  • Criar Novo...