Resultados 1 a 2 de 2
  1. #1
    Newbie Avatar de thia
    Data de Ingresso
    Oct 2010
    Posts
    83

    Thumbs up abrindo conexao mysql e jsp

    Amigo eu fiz um arquivo em jsp de logim mais esta dando erro a conexao com o banco eu nao sei mais o que fazer or favor me ajude e mostre para mim o que estou fazendo de errado por favor o codigo esta ai embaixo

    <%@ page contentType="text/html; charset=utf-8" language="java"


    import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Documento sem título</title>
    <style type="text/css">
    <!--
    body {
    background-color: #000;
    color: #F00;
    }
    .Login {
    color: #F00;
    }
    .Login {
    color: #F00;
    }
    -->
    </style></head>
    <body>
    //Abrindo uma conexão
    <%
    try{
    String url = "jdbc.odbc:algumDSN";
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection ExConn = DriverManager.getConnection(url,"usuario","Senha") ;
    out.println("Conexao com sucesso");


    }catch(java.lang.Exception ex) {
    ex.printStackTrace
    }

    }
    }
    %>
    <table width="100%" height="637" border="1">
    <tr>
    <td height="92"><div align="center"><img src="images.jpg" width="1000"


    height="194" /></div></td>
    </tr>
    <tr>
    <td height="257" bgcolor="#000000"><div align="center">
    <table width="200" border="1">
    <tr>
    <td colspan="2" bgcolor="#000000"><div align="center"><font


    color="#FF0000">Acessar ao meu Sistema</font></div></td>
    </tr>
    <tr>
    <td class="Login">Login</td>
    <td><form id="form1" name="form1" method="post" action="">
    <label>
    <input type="text" name="login" id="login" />
    </label>
    </form></td>
    </tr>
    <tr>
    <td bgcolor="#000000">Senha</td>
    <td><form id="form2" name="form2" method="post" action="">
    <label>
    <input type="password" name="Senha" id="Senha" />
    </label>
    </form></td>
    </tr>
    <tr>
    <td colspan="2"><form id="form3" name="form3" method="post"


    action="">
    <label>
    <div align="center">
    <input type="submit" name="Acessar" id="Acessar"


    value="Acessar" />
    </div>
    </label>
    <div align="center">
    <input type="reset" name="Limpar" id="Limpar" value="Limpar" />
    </div>
    </form></td>
    </tr>
    </table>
    </div></td>
    </tr>
    <tr>
    <td height="154"><div align="center"><img src="images.jpg" width="1000"


    height="194" /></div></td>
    </tr>
    </table>
    </body>
    </html>

    valeu e até mais!!!!!!!!!!!!!!!!!!!!!

  2. #2
    Cara para de floodar o fórum,você já abriu 3 tópicos sobre a mesma coisa.
    MP Com dúvidas e pedidos de ajudas serão IGNORADAS
    "Mentes fracas não pensam,corpos fracos não lutam."

    Microsoft Technology Associate: Software Development Fundamentals (C#
    )

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •