tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Bremford" <mi...@paperx.com>
Subject RE: Splitting Web and database server - easy?
Date Tue, 24 Oct 2000 10:07:04 GMT
Shouldn't be. We're using Oracle and have done just this - it's easy as the
oracle connect string specifies the host and the port to connect to.

For bonus points, do something like this in your DB connection class to
identify automatically if you're running on your development machine or your
production machine - so you can run the same code on both.

String dbhost = "productionbox:1535:live";
String dbuser = "produser";
String dbpass = "prodpass";

try {
  String host = InetAddress.getLocalHost().getHostName();
  if (host.equals("developmentbox")) {
    dbhost = "developmentbox:1521:dev";
    dbuser = "devuser";
    dbpass = "devpass";
  }
} catch (Exception e) {}
try
{
  Class.forName("oracle.jdbc.driver.OracleDriver");
  dbCon =
DriverManager.getConnection("jdbc:oracle:thin:@"+dbhost,dbuser,dbpass);
}


Cheers... Mike

> -----Original Message-----
> From: Steven Barnes [mailto:s.barnes@qut.edu.au]
> Sent: 24 October 2000 03:25
> To: tomcat-user@jakarta.apache.org
> Subject: Splitting Web and database server - easy?
> Importance: High
>
>
>
> We have a web server running Apache & Tomcat.
>
> Are there any issues with running a database on the same server in
> development, then splitting the web and database servers in
> production?
>
> The actual scenario is...
>
> Web Server :
> 	Red Hat Linux 7
> 	Apache
> 	Tomcat
> Database Server
> 	Solaris
> 	Progress DB
>
> However, Progress may not be able to provide JDBC drivers for
> Linux as they
> said they would, so we may have to run web server and
> database server on
> Solaris in development. We would then split the web and database to
> separate servers in production - BOTH on Solaris.
>
> Best regards,
> Steve Barnes
> Web Architect
> Queensland University of Technology
> Australia
>
> Regards,
> Steve Barnes
> FIT Web 2000 project
>
> ph. (07) 3864 4375
> barness@fit.qut.edu.au
>
>


Mime
View raw message