Click to See Complete Forum and Search --> : JSP and the remote database!


teeluck
04-24-2007, 10:57 AM
Hi,

I am trying to connect my JSP page(work laptop) to a remote database on a server(home pc).
The server at home is online on dsl connection and i am using a DNS to connect to it.

NOTES:

home pc:
DNS : john.somedns.com
MySQL installed
Apache Tomcat
MySQL odbc driver


work pc:
DNS : work.somedns.com
MySQL installed
Apache Tomcat
MySQL odbc driver

My code:

<%@ page import="java.sql.*" %>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = new String("john.somedns.com");
Connection databaseConnection = DriverManager.getConnection(sourceURL,"","");

Statement myStatement = databaseConnection.createStatement();

%>

What am I doing wrong?
What should I do?
Any suggestions and comments would be appreciated.

Thank You

Khalid Ali
04-24-2007, 02:06 PM
post the error you are getting...

teeluck
04-25-2007, 01:02 PM
no driver found....thats what i get....i realise what i was doin in my code...so i change the server address to the data source name.However in the odbc driver setting, i cant connect to the remote computer. it says server cannot be found. i'm using the DNS address as the server address.