I am a fairly new web designer and I have my sites hosted on a standard Unix box running Apache - they have enabled tomcat but there seems to be some problem with the jsp talking to mysql I get this error
javax.servlet.ServletException: Server configuration denies access to data source
I can access using Perl but not JSP.
The hosting site is giving me a tap dance about t all saying it is because it is not an NT server they would have to heaps of changes to mysql and it is very complicated Yada Yada - I don't know enough about servers with many sites on them but it all sounds like hogwash to me - any ideas and any suggestions much appreciated
Vix
code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%@ page import="java.sql.*" %>
<%
String name=request.getParameter("name"
String phone=request.getParameter("phone"
String mobile=request.getParameter("mobile"
String email=request.getParameter("email"
String design=request.getParameter("design"
String graphics=request.getParameter("graphics"
String flash=request.getParameter("flash"
String registration=request.getParameter("registration"
String hosting=request.getParameter("hosting"
String content=request.getParameter("content"
String comments=request.getParameter("comments"
Class.forName("org.gjt.mm.mysql.Driver".newInstance();
Connection con;
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbasename", "username","password"
String sql="insert into Quotes(name,phone,mobile,email,design,graphics,flash,registration,hosting,content,comments) values(?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement pst= con.prepareStatement(sql);
pst.setString(1,name);
pst.setString(2,phone);
pst.setString(3,mobile);
pst.setString(4,email);
pst.setString(5,design);
pst.setString(6,graphics);
pst.setString(7,flash);
pst.setString(8,registration);
pst.setString(9,hosting);
pst.setString(10,content);
pst.setString(11,comments);
pst.executeUpdate();
%>
<H3>Thank you for your information</h3>
</body>
</html>
javax.servlet.ServletException: Server configuration denies access to data source
I can access using Perl but not JSP.
The hosting site is giving me a tap dance about t all saying it is because it is not an NT server they would have to heaps of changes to mysql and it is very complicated Yada Yada - I don't know enough about servers with many sites on them but it all sounds like hogwash to me - any ideas and any suggestions much appreciated
Vix
code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%@ page import="java.sql.*" %>
<%
String name=request.getParameter("name"
String phone=request.getParameter("phone"
String mobile=request.getParameter("mobile"
String email=request.getParameter("email"
String design=request.getParameter("design"
String graphics=request.getParameter("graphics"
String flash=request.getParameter("flash"
String registration=request.getParameter("registration"
String hosting=request.getParameter("hosting"
String content=request.getParameter("content"
String comments=request.getParameter("comments"
Class.forName("org.gjt.mm.mysql.Driver".newInstance();
Connection con;
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbasename", "username","password"
String sql="insert into Quotes(name,phone,mobile,email,design,graphics,flash,registration,hosting,content,comments) values(?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement pst= con.prepareStatement(sql);
pst.setString(1,name);
pst.setString(2,phone);
pst.setString(3,mobile);
pst.setString(4,email);
pst.setString(5,design);
pst.setString(6,graphics);
pst.setString(7,flash);
pst.setString(8,registration);
pst.setString(9,hosting);
pst.setString(10,content);
pst.setString(11,comments);
pst.executeUpdate();
%>
<H3>Thank you for your information</h3>
</body>
</html>