Subject | Re: [Firebird-Java] Re: jsp and InterClient |
---|---|
Author | Rick Fincher |
Post date | 2003-03-24T23:41:10Z |
Hi Vid,
Setting up the realm only lets you login to Tomcat. To use another database
in your JSP's you need to set up a data source. Tomcat has the instructions
for doing that in the docs.
You just use the same techniques as for other databases but use the JayBird
driver string and URL format.
After you start Tomcat you can get to the docs by using your browser to go
to http:www.yourdomain.com/index.jsp. The Tomcat instructions tell you to
do this to verify that Tomcat is running.
You should see the Tomcat welcome screen. Click on "Tomcat Documentation"
on that page. Then click on "JNDI DataSource How-To" and "JNDI Resources
How-To" and read those sections.
To use Firebird, you can follow the instructions for the other databases but
use the Firebird Driver names and connection URL formats.
To access the database you have to create a JSP page and a WEB-INF/web.xml
file for your web app. There are examples in the Tomcat docs of how to code
your Java to get at the data source.
Once you get the connection, you use it just like in a standard Java
program.
A better way is to install the Java Standard Tag Libraries in your web app.
It gives you a set of HTML-like tags for accessing the database once you
pass it your datasource.
You can go into the Tomcat Administrator to see which datasources are
configured properly.
However, to get access to the administrator you have to set up your realm
database with your username added to the role table as a manager.
You can access a database from a JSP the brute Force way by inserting the
Java code just like in a regular Java program, but that is not a good way to
do things.
Rick
Setting up the realm only lets you login to Tomcat. To use another database
in your JSP's you need to set up a data source. Tomcat has the instructions
for doing that in the docs.
You just use the same techniques as for other databases but use the JayBird
driver string and URL format.
After you start Tomcat you can get to the docs by using your browser to go
to http:www.yourdomain.com/index.jsp. The Tomcat instructions tell you to
do this to verify that Tomcat is running.
You should see the Tomcat welcome screen. Click on "Tomcat Documentation"
on that page. Then click on "JNDI DataSource How-To" and "JNDI Resources
How-To" and read those sections.
To use Firebird, you can follow the instructions for the other databases but
use the Firebird Driver names and connection URL formats.
To access the database you have to create a JSP page and a WEB-INF/web.xml
file for your web app. There are examples in the Tomcat docs of how to code
your Java to get at the data source.
Once you get the connection, you use it just like in a standard Java
program.
A better way is to install the Java Standard Tag Libraries in your web app.
It gives you a set of HTML-like tags for accessing the database once you
pass it your datasource.
You can go into the Tomcat Administrator to see which datasources are
configured properly.
However, to get access to the administrator you have to set up your realm
database with your username added to the role table as a manager.
You can access a database from a JSP the brute Force way by inserting the
Java code just like in a regular Java program, but that is not a good way to
do things.
Rick
----- Original Message -----
> Hi Rick,
>
> First, thank you for your reply, it looks I am at the right place.
>
> I am using Tomcat 4.1 as servlet container and I just downloaded and
> installed JayBird following instruction in FAQ. I modified
> tomcat4/conf/server.xml and added <Realm
> className="org.apache.catalina.realm.JDBCRealm"... as they suggested
> in JayBird FAQ. After I exported CLASSPATH, Tomcat starts and stops
> fine, so I am assuming everything is configured properly.
>
> Now, I am at the point where I need jsp example with the connection
> string to InterBase or Firebird database.
>
> Vid
>
> --- In Firebird-Java@yahoogroups.com, "Rick Fincher" <rnf@t...> wrote:
> > Hi Vid,
> >
> > You would be better off using JayBird rather than Interclient. If
> you
> > download JayBird from the Firebird project on SourceForge you can
> read the
> > FAQ there.
> >
> > Once you have that (or even with Interclient) the only that that
> really
> > changes is the driver name.
> >
> > What type of servlet container are you using for JSP's? (Tomcat?).
> Exactly
> > how you set things up depends on the server.
> >
> > Give us some more details and we can try to help.
> >
> > Rick
> > ----- Original Message -----
> >
> > > Hi,
> > >
> > > I hope this is the right place to post my question.
> > >
> > > I am trying to connect jsp pages to InterBase database using
> > > InterClient JDBC. It seams to me that internet resources are very
> > > reach when it comes to examples of how to make a connection
> between
> > > jsp and any other database (Oracle, MySQL,...) but when it comes
> to
> > > InterBase or Firebird (which in my opinion will be very similar
> if not
> > > the same) examples are not there at all. I hope that some of the
> > > folks here would be able to help me. What I am looking for is an
> > > example of jsp page that uses connection string to display data
> from
> > > InterBase or Firebird database.
> > >
> > > Thanks,
> > >
> > > Vid B.
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>