This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Problem in Connecting to remote database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem in Connecting to remote database" Watch "Problem in Connecting to remote database" New topic

Problem in Connecting to remote database

Varma dandu

Joined: Apr 29, 2005
Posts: 16
Hi dudues,

I am using the following code in connecting to remote sqlserver 7 database on windows platform.I am on linux platform.I was able to ping remote ip.

<%@ page import="java.sql.*" %>


<% Connection conn = DriverManager.getConnection
("jdbc dbc:QUIZTV://","quiz_u","yiaphlup");
Statement stmt = conn.createStatement();
ResultSet columns = stmt.executeQuery("select * from CallQueue");
String cli= columns.getString("cli");
String status= columns.getString("status");

I am getting the following exception :

root cause


Just wondering whether anyone could help me in this regard.

Varma Dandu.
Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
do you have odbc drivers installed and configured on the linux box.

Jeremy Wilson
Amarender Reddy
Ranch Hand

Joined: May 12, 2005
Posts: 54

can anyone explain me the above <%=cli%> stmt


David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Originally posted by amarender reddy:
can anyone explain me the above <%=cli%> stmt

This is JSP syntax, used to reduce the amount of Java code mixed with HTML code.
It is equivalent to the following:

... where 'out' is the output stream being sent to the client.
If you have any follow-up questions you should ask them in the JSP forum.

Varma dandu

Joined: Apr 29, 2005
Posts: 16
Thanx geremey for ur reply,

I've got the windows box now and had created datasource for remote database using control panel.

I have used this datasource(ds) and used the url "jdbcdbcs" and i was able to make the connection now.

Should we use the same procedure if i had to work on linux box.
if so, how do i configure odbc drivers on linux box.

Thanx in advance.
Varma dandu.

[edited to disable smilies]
[ May 16, 2005: Message edited by: Jeanne Boyarsky ]
slav agui

Joined: Jan 15, 2008
Posts: 4
Did you find a solution to your problem?
I am experiencing exactly same problem.
Works perfect on my pc but when it is deployed in a unix box I am getting same error.

Any help is appreciated....
Consider Paul's rocket mass heater.
subject: Problem in Connecting to remote database
Similar Threads
I can not for the life of me figure out what is causing this
help needed with tomcat/requestDispatcher - example form HeadFirst servlets and jsp
Please Help:Access to Sql Server from servlet
HTTP Status 500 - error running servlet with JSP
database conn. jsp tomcat Oracle9i thin driver