How do I access the database in Tomcat 5.5? - odbc

I am currently taking over a web development project that was done 5 years ago. Basically, I was told to remote login to a web server running Windows Server 2003 and continue with the web development.
However, I want to access the backend database in order to perform SQL queries and see all the tables in my website.
I managed to find the .html, .jsp pages which is located at C:\Program Files\Apache Foundation\Tomcat5.5\webapps\root. I also managed to get snippets of the code which might be of help.
--
<%#page language="java" import="java.sql.*" %>
<%#page import="javax.servlet.*"%>
<%
String sDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr="jdbc:odbc:tutoring";
Connection conn=null;
ResultSet rs=null;
String username="username";
String password="heyicanttelluthepassword";
conn=DriverManager.getConnection(sConnStr,username,password);
Statement stmt=conn.createStatement();
%>
--
Any idea how the hell I can access the database? I don't even know if it uses MS SQL sever or MYSQL..Haha..

Related

asp codes wont be executed on server

I'm pretty new with ASP , but Im looking for an answer to this question and nothing found yet.
Im using an Apache server to upload my website on it. i write a very simple asp code like this:
<!DOCTYPE html>
<html>
<body>
<%
response.write("My first ASP script!")
%>
</body>
</html>
and save the file as file.asp & get this as result:
Is the problem Apache server or what? What Should I do?
You need to configure your server to process ASP pages.
Start with this Running ASP.Net on a Linux based server
If you are using old legacy ASP (not ASP.NET) then you may have trouble this platform is not actively developed from more than 10 years now. It would be better to switch to more modern framework e.g. ASP.NET.
Use a IIS web server rather. Moreover is it asp.net or classic asp? By any means if it results in <%response.write("My first ASP script!")%> that means web server somehow processing it a normal HTML and not understand the script block <% %> which can only happen if it's processed by ASP.NET dll or ASP dll.

ASP.NET IIS 6 deployment error - Cannot view XML input using XSL style sheet

I am working on an ASP.NET website. I am trying to deploy the website on Windows 2003 server, IIS 6. The website works fine when I run using Visual studio 2010. but I am not able to deploy on IIS 6 and access the website login page.
I published the website and created a new Virtual directory in IIS 6 pointing to the precompiled website folder under c:\Inetpub\wwwroot\App-name folder.
I get the below error message when i try to access the website login page.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
A name was started with an invalid character. Error processing resource
'http://myappservr.com/app-name/Login.aspx'. Line 1, Po...
<%# page language="C#" autoeventwireup="true" inherits="Login, App_Web_rmgltjnq" %>
-^
In IIS, under ASP.NET tab, I selected the ASP.NET version as v2.0. In IIS, under Web service extensions folder ASP.NET 2.0 is allowed.
Why the does the browser show the message is The XML page cannot be displayed Cannot view XML input using XSL style sheet when I access the aspx page from the IIS?
Please let me know how to fix this issue when access the website from IIS 6.0
Thanks
Ashok
The error you are receiving means that IIS is not processing the asp.net pages at all. It is simply displaying the HTML directly to the browser. The error you are getting is the same one you would receive if you opened the .aspx page directly in the browser from the file system.
Steps to make sure
the .net framework is actually installed on the server.
if it is, make sure it is enabled to be served. MS disabled many application development features by default to avoid servers becoming a potential viral attack vector.
Go to the Server Manager on the server
Select the Web Server (IIS) Role to show the details under the Role Services list ensure that the Web Server | Application Development | ASP.Net and .Net Extensibility nodes are Installed.
If not, select the Add Role Services options to add those and any other Application Development eatures you need.
If correct, you may need to run aspnet_regiis to update the mappings. Usually the -i or -ir options are most commonly selected.

ASP.NET web application: 404 error in the remote server when a common database connection string is used

I'm working with a project in c# asp.net..
When i created individual connection strings for accessing the database, the program runs properly in the local and remote servers..
But when i wrote the connection string commonly in a class and accessing those connection using an object, it works properly in the local server but while running in the remote server it shows a "404 error"..
Please help..
Are you create database in your server ?? and are you deploy all pages in your server ???
check below links
http://support.microsoft.com/kb/315122
It sounds more like a remote server problem in general than anything specific in your code. Are there other ASP.NET pages or sites already running on the remote server successfully? If not, it may be related to the way you've deployed the site than your code - are you sure IIS is set up to serve the ASP.NET site correctly?
I'd start by creating a "test.aspx" page with no dynamic content and try accessing that, and then work forward from there.

The FTP I'm using for school is not working with ANY given .aspx web pages

I tried uploading a simple .HTML webpage as well as a .PHP webpage. They both worked perfectly fine. But when using Visual Studio asp.net and making websites with visual basic, the WebForm.aspx pages created when I publish my projects don't work. I get the error:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'Assignment_1_MattAndrzejczuk.WebForm1'.
Source Error:
Line 1: <%# Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Assignment_1_MattAndrzejczuk.WebForm1" %>
This is for a school assignment, I know for a fact that the web server works and I've tested .HTML and .PHP pages on this web server, they work perfectly fine. But I don't know why I can't do the same with .aspx pages.
Have you set the root folder as an application in IIS? It appears that ASP.NET doesn't know where to go to get to the bin folder.
Schools generally offer Linux environment and their web servers only allow PHP (I think it is because both Linux and PHP are open source). There are plenty of free ASP.NET hostings online.
Regards.

ASP.NET "Could not Load Type" just on Server

I have a ASP.Net 3.5 host. I just opened a new, C# Web project in visual studio 2010. I changed customerror to None and delete authentication mode line and select None in server control panel. Project works on local machine and says Hello World when I build and deploy in to server via FTP, I get an error it says Could not Load Type '_Default'
<%# page language="C#" autoeventwireup="true" CodeFile="Default.aspx.cs" inherits="WebApplication._Default" %>
my namespace is WebApplication and in class name is _Default Default.aspx.cs,
It works when I start in ISS, but It cannot start on server.
The error might be coming because you are trying to publish two sites on a single server ftp. It can be solved if you upload it on a sub-domain.
This error is always related to a bad deployment. Either that code file wasn't published or your missing an assembly somewhere.
Also, you might want to check to verify the server does indeed have all of the 3.5 stuff loaded on it.

Resources