It depends on what kind of drivers you want to use. You can use one of the four
types available, but the easiest for you (for the beginning) would be to use type 1
drives (jdbc:odbc bridge). After you make it work and run I would recommend
to migrate to either type 3 or four drivers, according to how large and scalable your
application should be... I have to add here that you might have to pay some money in
order to obtain any other drivers apart from the odbc:jdbc ones...
In order to use the jdbc:odbc drivers you have to do:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); This will load the drivers. In orde to
conenct to the database you can use: Connection con =
DriverManager.getConnection("jdbc:odbc:
<>database source name", "<username>", "<password>");
The "<database source name>" is the name of your ODBC data source. You have to
define one by doing (on Windows 2000) Start...Settings... Control
Panel...Administrative Tools...Data Sources(ODBC)....Add... and so on...
By using type 4 drivers you conenct straight to a specific database. I would
recommend this approach as it is faster (with ODBC you have to translate each call to
ODBC specific commands) and easier (with ODBC you have to configure the
ODBC bridge for every machine you want to use). The only drawback istaht you have to
find some kind of drivers. I am using the TDS drivers by I-net software
(unfortunatelly there do not come for free) and all I am doing to conenct is a
Class.forName("com.inet.tds.TdsDriver"); to just load the drivers. Then Connection
connection = DriverManager.getConnection("jdbc:inetdae:<my server, e.g.
localhost>:1433?database=<my database name, i.e. Access name>",
"<username>", "<password>");
Hope this helps...
15/01/2002 04:59:57, "Wilson E. Lozano R." <[EMAIL PROTECTED]> wrote:
>Hi Panagiostis, thanks for your help,
>Well but where can i find o how can i load the drivers?
>i don't understod when you write class.forName(<the whole path of the
>drivers here>); an the data base is host in the same PC, remembre ithe
>"plataform" is win98.
>Can you send me an example please?
>
>-----------------------------------
>Wilson Ernesto Lozano RolOn
>Ingeniero de Sistemas
>-----------------------------------
>
>On Tue, 15 Jan 2002, Panagiotis Konstantinidis wrote:
>
>> First of all you need to load the drivers. To do that you need:
>>
>> Class.forName(<the whole path of the drivers here>);
>>
>> After that the only thing you have to do is to open a connection with the
>speciffic DB server
>>
>> Connection con = DriverManager.getConnection(<url of your database server>,
>"<username- optional>", "<password - optional>");
>>
>> After that you can communicate with the server by just sending SQL statements.
>>
>>
>>
>> 15/01/2002 04:26:17, "Wilson E. Lozano R." <[EMAIL PROTECTED]> wrote:
>>
>> >Hi panos,
>> >thanks for your help.
>> >
>> >Hi everybody, i'm running tomcat4.0 with jdk1.3.1_02 in win 98.
>> >Bun now i need know how can i do to make a connection win a data base in
>> >Microsoft acces 97 trought any web page into my web site soported with
>> >tomcat 4.0.
>> >
>> >thanks in advanced.
>> >-----------------------------------
>> >Wilson Ernesto Lozano RolOn
>> >Ingeniero de Sistemas
>> >Universidad Industrial de Santander
>> >-----------------------------------
>> >
>> >On Mon, 14 Jan 2002, panos periorellis wrote:
>> >
>> >> If you're doing this from DOS it should work....
>> >>
>> >> Note that one of the directories inside the set
>> >> catalina_home=c:\tcat\jakarta-tomcat-4.0\ should be bin lib etc....
>> >>
>> >> in other words our directory should point to those
>> >> so if there is another directory inside jakarta-tomcat-4.0 before the bin
>> >> and lib directories then set the path to that ....
>> >>
>> >> the other thing i thought of is that the jakarta-tomcat-4.0 directory name
>> >> is a bit long...I remember i had to shorten mine .... I have renamed it as
>> >> jak..
>> >>
>> >> take care
>> >> panos
>> >>
>> >> ----- Original Message -----
>> >> From: Wilson E. Lozano R. <[EMAIL PROTECTED]>
>> >> To: <[EMAIL PROTECTED]>
>> >> Sent: Monday, January 14, 2002 09:38
>> >> Subject: Re: TOMCAT4.0 + win98 help!!!
>> >>
>> >>
>> >> > Hi Panos,
>> >> > Thanks but i was do it, however i don't use jrun
>> >> > in this version of tomcat the variable isn't tomcat_home, is
>> >> > catalina_home, and i does set catalina_home=c:\tcat\jakarta-tomcat-4.0\
>> >> > and i use jsdk and java_home=c:\jsdk1.3.1_02\ and my problem don't stop.
>> >> > ??
>> >> > Thanks in advanced.
>> >> > -----------------------------------
>> >> > Wilson Ernesto Lozano RolOn
>> >> > Ingeniero de Sistemas
>> >> > Universidad Industrial de Santander
>> >> > -----------------------------------
>> >> >
>> >> > On Mon, 14 Jan 2002, panos periorellis wrote:
>> >> >
>> >> > > you have to set the variables from DOS.
>> >> > >
>> >> > > i.e.
>> >> > >
>> >> > > set TOMCAT_HOME=c:\tomcat\jak\jak (this is on my machine ...replace with
>> >> the
>> >> > > direcotyr on yours.
>> >> > >
>> >> > > set JAVA_HOME=c:\jbuilder\jdk1.3 (if you rin jbuilder that is)
>> >> > >
>> >> > >
>> >> ===========================================================================
>> >> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>> >> JSP-INTEREST".
>> >> > > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>> >> DIGEST".
>> >> > > Some relevant FAQs on JSP/Servlets can be found at:
>> >> > >
>> >> > > http://archives.java.sun.com/jsp-interest.html
>> >> > > http://java.sun.com/products/jsp/faq.html
>> >> > > http://www.esperanto.org.nz/jsp/jspfaq.jsp
>> >> > > http://www.jguru.com/faq/index.jsp
>> >> > > http://www.jspinsider.com
>> >> > >
>> >> >
>> >> >
>> >> ===========================================================================
>> >> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>> >> JSP-INTEREST".
>> >> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>> >> DIGEST".
>> >> > Some relevant FAQs on JSP/Servlets can be found at:
>> >> >
>> >> > http://archives.java.sun.com/jsp-interest.html
>> >> > http://java.sun.com/products/jsp/faq.html
>> >> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
>> >> > http://www.jguru.com/faq/index.jsp
>> >> > http://www.jspinsider.com
>> >> >
>> >>
>> >> ===========================================================================
>> >> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>> >> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>> >> Some relevant FAQs on JSP/Servlets can be found at:
>> >>
>> >> http://archives.java.sun.com/jsp-interest.html
>> >> http://java.sun.com/products/jsp/faq.html
>> >> http://www.esperanto.org.nz/jsp/jspfaq.jsp
>> >> http://www.jguru.com/faq/index.jsp
>> >> http://www.jspinsider.com
>> >>
>> >
>> >===========================================================================
>> >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>> >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>> >Some relevant FAQs on JSP/Servlets can be found at:
>> >
>> > http://archives.java.sun.com/jsp-interest.html
>> > http://java.sun.com/products/jsp/faq.html
>> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
>> > http://www.jguru.com/faq/index.jsp
>> > http://www.jspinsider.com
>> >
>> __________________________________________
>> "It can only be attributed to human error"
>> 2001 A Space Odyssey
>>
>> ===========================================================================
>> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>> Some relevant FAQs on JSP/Servlets can be found at:
>>
>> http://archives.java.sun.com/jsp-interest.html
>> http://java.sun.com/products/jsp/faq.html
>> http://www.esperanto.org.nz/jsp/jspfaq.jsp
>> http://www.jguru.com/faq/index.jsp
>> http://www.jspinsider.com
>>
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
>
__________________________________________
"It can only be attributed to human error"
2001 A Space Odyssey
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com