Click to See Complete Forum and Search --> : Jdbc Help...its Nt Working..help


garimat
09-02-2008, 02:46 PM
hi
guys im really tired of trying out this JDBC...i have done evrything bt its not working.....got mysql, microsoft sql sever...n wt nt....i dnt knw where im going wrong...i have visisted several site read around 20 25 tutoriaals n codes...bt there's something still wrong...plz plz help...the code i tried last in a JSP file is:

<%@ page language="java"%>
<%@ page contentType="text/html"%>
<%@ page import="java.sql.*"%>
<%
Class.forName("com.mysql.jdbc.Driver");
Statement stmt;
String url="jdbc:mysql://localhost:80/mysql";
try{
Connection con=DriverManager.getConnection(url,"root","admin");
System.out.println("URL: "+url);
System.out.println("CONNECTION: "+con);
stmt = con.createStatement();
stmt.executeUpdate("create database myproject");
con.close();
}

catch(Exception e){
e.printStackTrace();
}
%>

chazzy
09-02-2008, 02:59 PM
plz plz plz you can post the stack trace from the exception.

Khalid Ali
09-02-2008, 11:58 PM
lol...chazzy....
and for the original poster, yes we NEED to see what is the error u are getting