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 Configuring database on local machine 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 "Configuring database on local machine" Watch "Configuring database on local machine" New topic
Author

Configuring database on local machine

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
Hi guys!
Scenario:
I am having two machines A and B. I am compiling my servlet.java files on machine A and copy-pasting the servlet.class files on the machine B. Obviously
Machine A is client
Machine B is server.... running tomcat server.

Now,
Query:
I have a servlet that manipulates databases. Machine A(i.e. client itself) has MS SQL Server. How can I configure my server (Machine B) through ODBC to connect to my local SQL Server and run the servlet.
1. Is it necessary that SQL Server and Tomcat be running on same machine.
2. If no, then how can ODBC be configured to work things up.

Thanks in advance.
[ October 20, 2005: Message edited by: Akhil Trivedi ]

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I am moving this to the JDBC forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Samuel Cox
Ranch Hand

Joined: Nov 16, 2004
Posts: 96

It is not necessary to have Tomcat and SQLServer on the same machine.

If you just need access to SQLServer from a java servlet, why don't you use the MS SQLServer JDBC driver? You can download it here: http://www.microsoft.com/sql/default.mspx. In the <whereever you install dir>\Microsoft SQL Server 2000 Driver for JDBC\books\ directory, there is a resource that details connecting to the database through the driver. Basically, you just need to specify the ip address to hookup to the other computer.
[ October 20, 2005: Message edited by: Samuel Cox ]
 
Consider Paul's rocket mass heater.
 
subject: Configuring database on local machine
 
Similar Threads
JDBC Connection to MS SQL with Windows Authentication
Servlet as an rmi client
For those who eat java, think java and drink java
Plz give the solution for this code......
File Uploading