The TAR archive contains the latest 12.2.0.1 JDBC Thin driver (ojdbc8.jar), Universal Connection Pool (ucp.jar), other companion jars, and README that has more information about the contents of the tar file. OR Unzipped JDBC Driver and Companion JARs. Sun.jdbc.odbc.JdbcOdbcDriver, JdbcOdbcDriver, sun.jdbc.odbc, class, JAR file, findJAR, serFISH This page shows details for the Java class JdbcOdbcDriver contained in the package sun.jdbc.odbc. All JAR files containing this class file are listed.
This topic provides detailed information on configuring JDBC/ODBCdrivers for your database or external system connection. It includesthe following sections:
Drivers are uniquely different in what they do and the typeof functions they support. The JDBC/ODBC Adapter allows you to pickand choose which driver is best suited for your application environment.There can be significant differences and limitations between drivers.The performance and functionality of the JDBC/ODBC Adapter dependson the selected driver(s). Certain drivers may not support all JDBCfeatures. Consult the documentation for your respective drivers formore information.
While any standards compliant JDBC/ODBC database driver maybe used, the drivers covered in this chapter are used more frequently.For runtime, only drivers that support Connection Pool Data Sourceand XA Data Source are supported. Connection Pool Data Source takesadvantage of the Integration Service’s connection pooling inorder to improve performance. For the OTD Wizard, the driver ManagerClass will work. However, not all drivers support all metadata discoverymethods, some of which are needed to build the OTD. Additionally,not all drivers support Updatable ResultSets, Stored Procedures, orStored Procedures with ResultSets. Check with your driver vendor forwhat is supported. The ConnectionPoolDataSource should only be usedfor Outbound Adapters. The Inbound Adapter uses native JDBC and mustuse Driver Manager.
It is recommended that you use the Oracle eWay when using thenative Oracle driver. The JDBC eWay does not support some of the functionsavailable in the Oracle eWay such as creating an OTD from a PreparedStatement, using a Stored Procedure with ResultSets, and CLOB support.
It is also recommended that you use the SQL Server eWay. TheJDBC driver available for download from the Microsoft web site maynot contain the latest version from the vendor.
Not all drivers support Updatable ResultSets. However, it doesallow standard Insert and Update operations when used with the PreparedStatement feature:
Insert into employee (empno) values(?);
Remember to ensure that the input parameter data types matchthe data types specified in the database table targeted by the PreparedStatements as some drivers always return the data type as a string.Optionally, you may perform the data conversion in the Collaboration.
This document provides database configuration information andenvironment properties specifications for specific JDBC/ODBC drivers.You should use the information listed in the included tables to definevalues for required input parameters.
OTD Wizard: Database Connection Information
To connect to AS/400, use the information provided in Table 1–1 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard. To access DB2, it isrecommended to use the DB2 eWay Adapter or the DB2 Connect eWay Adapter.
Table 1–1 AS/400 Database ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | jt400.jar |
Driver Java Class Name | com.ibm.as400.access.AS400JDBCDriver |
URL Connection String | jdbc:as400://server-name:server-port/ Note – NOTE: Default server port is 446. |
User Name | Login name of the account used to access the AS/400 database. |
Password | Password associated with the login account name used to connectto the AS/400 database. |
Environment Properties
Use Table 1–2 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–2 AS/400 Database EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ibm.as400.access.AS400JDBCConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note – NOTE: Default server port is 446. |
DatabaseName | |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
OTD Wizard: Database Connection Information
To connect to Attunity, use the information provided in Table 1–3 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard.
Table 1–3 Attunity Driver Database ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | nvjdbc2.jar |
Driver Java Class Name | com.attunity.jdbc.NvDriver |
URL Connection String | jdbc:attconnect://server-name;DefTdpName=database-logical-name; OneTdpMode=1 Note – The database-logical-name iscreated in the Attunity server. |
User Name | Leave password field blank. Value configured when the databaseentry is created in the Attunity Server. |
Password | Leave password field blank. Value configured when the databaseentry is created in the Attunity Server. |
Environment Properties
Use Table 1–4 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–4 Attunity Driver Database EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.attunity.jdbc.NvXADataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note – NOTE: Default server port is 2551. |
DatabaseName | <database-name> |
User | Leave user field blank. Value configured when the database entryis created in the Attunity Server. |
Password | Leave password field blank. Value configured when the databaseentry is created in the Attunity Server. |
DriverProperties | setDefTdpName#database-logical-name##setWorkspace#Navigator## |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
OTD Wizard: Database Connection Information
To connect to MYSQL, use the information provided in Table 1–5 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard.
Table 1–5 MySQL Connector/J Driver DatabaseConnection InformationParameter | Value |
---|---|
Driver Jar Files | mysql-connector-java-3.0.11-stable-bin.jar |
Driver Java Class Name | com.mysql.jdbc.Driver |
URL Connection String | jdbc:mysql://server-name:server-port/database-name Note – NOTE: Default server port is 3306 |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–6 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–6 MySQL Connector/J Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | ccom.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note – NOTE: Default server port is 3306. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for MySQL.
OTD Wizard: Database Connection Information
To connect to SQL, use the information provided in Table 1–7 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard. To access SQL, it isrecommended to use the SQL Server eWay Adapter.
Table 1–7 PostgreSQL Driver ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | postgresql-8.0-310.jdbc3.jar |
Driver Java Class Name | org.postgresql.Driver |
URL Connection String | jdbc:postgresql://server-name:server-port/database-name Note – NOTE: Default server port is 5432. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–8 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–8 PostgreSQL Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | org.postgresql.jdbc3.Jdbc3ConnectionPool |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note – NOTE: Default server port is 5432. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for PostgreSQL.
OTD Wizard: Database Connection Information
To connect to Sybase, use the information provided in Table 1–9 to complete the Connectto Database step of the JDBC/ODBC OTD Wizard. To access Sybase, itis recommended to use the Sybase eWay Adapter.
Table 1–9 Sybase JConnect Driver DatabaseConnection InformationParameter | Value |
---|---|
Driver Jar Files | jconn2.jar |
Driver Java Class Name | com.sybase.jdbc2.jdbc.SybDriver |
URL Connection String | jdbc:sybase:Tds:server-name:server-port Note – NOTE: Default server port is 4100. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–10 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–10 Sybase JConnect Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note – NOTE: Default server port is 4100. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for Sybase.
OTD Wizard: Database Connection Information
The settings in Table 1–11 describehow to use the DataDirect Sequelink JDBC/ODBC bridge with the JDBC/ODBCeWay. This information demonstrates how Sequelink can be used to interfacewith the ODBC driver. To connect to an Informix database, it is recommendedto use the Informix eWay Adapter.
Table 1–11 Sequelink DataDirect InformixODBC Driver Database Connection InformationParameter | Value |
---|---|
Driver Jar Files | sljc.jar |
Driver Java Class Name | com.ddtek.jdbc.sequelkink.SequeLinkDriver |
URL Connection String | jdbc:sequelink://server-name:server-port Note – NOTE: Default server port is 19996. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
![Jar Jar](http://www.fontes.pro.br/educacional/materialpaginas/java/arquivos/jdbc/netbeansnovocdriver2.jpg)
Environment Properties
Use Table 1–12 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–12 Sequelink DataDirect InformixODBC Driver Environment PropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ddtek.jdbcx.sequelkink.SequeLinkDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting Sequelink. |
PortNumber | server-port Note – NOTE: Default server port is 19996. |
DatabaseName | |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for Sequelink DataDirectInformix ODBC.
OTD Wizard: Database Connection Information
To connect to Microsoft Access, via the Microsoft Access ODBCdriver, use the information provided in Table 1–13 to complete the Connect to Database step of the JDBC/ODBCOTD Wizard.
Table 1–13 MS Access ODBC Driver DatabaseConnection InformationParameter | Value |
---|---|
Driver Jar Files | sljc.jar |
Driver Java Class Name | com.ddtek.jdbc.sequelink.SequeLinkDriver |
URL Connection String | jdbc:sequelink://server-name:server-port Note – NOTE: Default server port is 19996. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–14 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–14 MS Access ODBC Driver EnvironmentProperties Parameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ddtek.jdbcx.sequelkink.SequeLinkDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting Sequelink. |
PortNumber | server-port Note – NOTE: Default server port is 19996. |
DatabaseName | |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 0. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
It is not mandatory to enter driver properties in theOutbound JDBC eWay Environment properties for Sequelink DataDirectMS Access ODBC.
OTD Wizard: Database Connection Information
To connect to Teradata, via the Teradata driver, use the informationprovided in Table 1–15 tocomplete the Connect to Database step of the JDBC/ODBC OTD Wizard.
Table 1–15 Teradata Driver Database ConnectionInformationParameter | Value |
---|---|
Driver Jar Files | teradata.jar |
Driver Java Class Name | com.ncr.teradata.TeraDriver |
URL Connection String | jdbc:teradata://server-name:server-port/database-server-name Note – NOTE: Default server port is 6666 forthe Type-3 driver Gateway. |
User Name | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
Environment Properties
Use Table 1–16 toconfigure the environment properties for the specified JDBC/ODBC driver.
Table 1–16 Teradata Driver EnvironmentPropertiesParameter | Value |
---|---|
Description | JDBC Connection Pool Datasource |
ClassName | com.ncr.teradata.TeraConnectionPoolDataSource |
ClassNamefor OtherInterfaces | |
ServerName | Server name of the machine hosting the database. |
PortNumber | server-port Note – NOTE: Default server port is 6666 forthe Type-3 driver Gateway. |
DatabaseName | database-name |
User | Login name of the account used to access the database. |
Password | Password associated with the login account name used to connectto the database. |
DriverProperties | setURL#jdbc:teradata://server-name:server-port/database-server-name ##setDSName#database-server_name## |
Delimiter | The default is #. |
DataSourceName | |
MinPoolSize | The default is 2. |
MaxPoolSize | The default is 10. |
MaxIdleTime | The default is 0. |
Refer to the following when troubleshooting Driver issues.
- The ReceiveOne operation in BPEL is not supportedwhen using inbound functions with some drivers.
- Some drivers do not support Updatable ResultSets.If you find this to be the case, use a Prepared Statement to Update,Insert, and Delete data.
- Not all drivers provide metadata information suchas column names and data types. If your table does not have columnnames and data types, add them before saving the OTD.
The database drivers specified in your projects need to be installedon both the Enterprise Designer machine and the Logical host machine.When installing the drivers on the Enterprise Designer machine, youmust specify the absolute path to the driver. When installing thedrivers on the Logical Host, place the driver into the Logical Host
where JavaCAPS51 is the locationof your Sun Java Composite Application Platform Suite installation.
The driver file must be copied to the latter folder if you arerunning multiple domains and wish to specify a driver for each domain.Otherwise, you only need to copy the driver file to the former folderaddress.
For procedures on how to install database drivers,see Configuring JDBC/ODBC Drivers
Ranch Hand
posted 13 years agoHi guys,
I have a Tomcat 5.X running and Im trying to connect to a MS Access database, I know I need a JDBC driver from what I can gather from the info I have been reading, my question
i) which driver(s) do I need?
ii) Where do i find them>? I've been on MS's website and all that comes up is a SQL Server 2000 jdbc driver.
Thanks in advance for your time/advice
Regards
Zein
I have a Tomcat 5.X running and Im trying to connect to a MS Access database, I know I need a JDBC driver from what I can gather from the info I have been reading, my question
i) which driver(s) do I need?
ii) Where do i find them>? I've been on MS's website and all that comes up is a SQL Server 2000 jdbc driver.
Thanks in advance for your time/advice
Regards
Zein
Ranch Hand
posted 13 years agoyou don't need to download any driver.
There is one driver that comes with j2sdk. Type 1 Jdbc-Odbc Bridge Driver
Its complete path is...
sun.jdbc.odbc.JdbcOdbcDriver
You need to write following code to make a database connection
dsn you have to create from control panel/odbc.
Naseem
[ June 28, 2006: Message edited by: Naseem Khan ]
There is one driver that comes with j2sdk. Type 1 Jdbc-Odbc Bridge Driver
Its complete path is...
sun.jdbc.odbc.JdbcOdbcDriver
You need to write following code to make a database connection
dsn you have to create from control panel/odbc.
Naseem
[ June 28, 2006: Message edited by: Naseem Khan ]
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Ranch Hand
posted 13 years agoThanks for your reply Naseem, but I mentioned I'm using Tomcat, but forgot to state I am also using JNDI etc.. hence for I need a .jar file that I put in the ...common/lib folder.
MySQL and other DB's have drivers, I assumed that MS Access would also have one??
Am on the right lines guys?
Thanks
Zein
MySQL and other DB's have drivers, I assumed that MS Access would also have one??
Am on the right lines guys?
Thanks
Zein
Ranch Hand
posted 13 years agoOriginally posted by Zein Nunna:
Thanks for your reply Naseem, but I mentioned I'm using Tomcat, but forgot to state I am also using JNDI etc.. hence for I need a .jar file that I put in the ...common/lib folder.
MySQL and other DB's have drivers, I assumed that MS Access would also have one??
Am on the right lines guys?
Thanks
Zein
Thanks for your reply Naseem, but I mentioned I'm using Tomcat, but forgot to state I am also using JNDI etc.. hence for I need a .jar file that I put in the ...common/lib folder.
MySQL and other DB's have drivers, I assumed that MS Access would also have one??
Am on the right lines guys?
Thanks
Zein
Most people use the JDBC-ODBC bridge, which is built into Java; no seperate driver required.
http://java.sun.com/products/jdbc/faq.html
There are some commercial drivers for MS Access out there; I've never used one and don't know any particular names.
Ranch Hand
posted 13 years agoRead Tomcat documentation for that from your http://localhost:8080/.
It provides complete description of jndi datasource. Tomcat provides read only jndi datasource object.
You need to expose your dsn by jndi datasource which you can do from your <Context> tag of Server.xml.
Again you don't need to download any extra driver for that irrespective of how you are getting database connection object.
Naseem
It provides complete description of jndi datasource. Tomcat provides read only jndi datasource object.
You need to expose your dsn by jndi datasource which you can do from your <Context> tag of Server.xml.
Again you don't need to download any extra driver for that irrespective of how you are getting database connection object.
Naseem
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Ranch Hand
posted 13 years agoHey guys thanks for your responses so far,
Stu - jdbc-odbc is used when your not using JNDI - hence cant use it now that I am wanting to use JNDI
Naseem - I have followed the Tomcat instructions for configurig JNDI, so changed the web.xml and server.xml accordingly [adding the context tag, then resource etc..] still no luck though.
I have a funny feeling that MS Access is not JNDI compatible - I came across this in another javaranch forum:
If there is anybody out there who has got this combination working [MS Access + Tomcat + JNDI], let me know please. Thanks
Oh btw I'm using Tomcat 5.5
Regards
Stu - jdbc-odbc is used when your not using JNDI - hence cant use it now that I am wanting to use JNDI
Naseem - I have followed the Tomcat instructions for configurig JNDI, so changed the web.xml and server.xml accordingly [adding the context tag, then resource etc..] still no luck though.
I have a funny feeling that MS Access is not JNDI compatible - I came across this in another javaranch forum:
If there is anybody out there who has got this combination working [MS Access + Tomcat + JNDI], let me know please. Thanks
Oh btw I'm using Tomcat 5.5
Regards
Ranch Hand
posted 13 years ago>If there is anybody out there who has got this combination working [MS Access + Tomcat + JNDI]
How to set up HXTT Access with Tomcat4.1 as PoolableConnection?
But it's a commercial MS Access jdbc driver.
How to set up HXTT Access with Tomcat4.1 as PoolableConnection?
But it's a commercial MS Access jdbc driver.
Ranch Hand
posted 13 years agoAsking Smart Questions FAQ - How To Put Your Code In Code Tags
Ranch Hand
posted 13 years agoOn Tomcat 5.5.8, do it like this...
Add the Context tag in the Server.xml within the <Host> tag.
db1 is data source name which you have to create from control panel.
You don't need to put any entry for jndi in your web.xml.
Now with above Context tag in server.xml, here is a code snippet which will return Connection object from Connection pool.
I tested this on my machine, it worked.
Regards
Naseem
Add the Context tag in the Server.xml within the <Host> tag.
db1 is data source name which you have to create from control panel.
You don't need to put any entry for jndi in your web.xml.
Now with above Context tag in server.xml, here is a code snippet which will return Connection object from Connection pool.
I tested this on my machine, it worked.
Regards
Naseem
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Ranch Hand
posted 13 years agoOk guys here's what I have done, I still get an error when I call the
I registerd my DB via control panel and the add to systemDSN (this points to the DB on my Tomcat).
The server.xml is as below (keyt snippets)
[the servlet i'm calling is packagless hence ive used '/', the database is in the root/DB folder]
myDB - is my MS Access Database
My serlvet is as below
I still get an error, the log reads as follow:
Any ideas? Thanks in advance for looking at my questions
Regards
Zein
I registerd my DB via control panel and the add to systemDSN (this points to the DB on my Tomcat).
The server.xml is as below (keyt snippets)
[the servlet i'm calling is packagless hence ive used '/', the database is in the root/DB folder]
myDB - is my MS Access Database
My serlvet is as below
I still get an error, the log reads as follow:
Any ideas? Thanks in advance for looking at my questions
Regards
Zein
Ranch Hand
posted 13 years agowhat exact version of Tomcat you are using? I mean Tomcat 5.x.x? is it 5.5.8
second create user dsn not system dsn.
third why you are not creating a seperate web application for that with following structure....
Waiting for your reply
Naseem
[ June 30, 2006: Message edited by: Naseem Khan ]
second create user dsn not system dsn.
third why you are not creating a seperate web application for that with following structure....
Waiting for your reply
Naseem
[ June 30, 2006: Message edited by: Naseem Khan ]
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Ranch Hand
posted 13 years agoNaseem,
Sorry for the late reply I was away for the weekend
Ok the exact Tomcat is 5.5.17,
Now that I've chnaged the DSN from system to user, I get less errors, the error I do get is as follows:
Does this make sense to anyone? Seems like I've not done something, where the context needs to be set?
Thanks in advance, regards
Zein
Sorry for the late reply I was away for the weekend
Ok the exact Tomcat is 5.5.17,
Now that I've chnaged the DSN from system to user, I get less errors, the error I do get is as follows:
Does this make sense to anyone? Seems like I've not done something, where the context needs to be set?
Thanks in advance, regards
Zein
Ranch Hand
posted 13 years agoJust I downloaded Tomcat 5.5.17 and it worked on this version under same setting. Same as that of 5.5.8
1. Context tag in server.xml under <Host> tag
2. db1 user datasource name.
3. Invoke Servlet in /ValidationRND/WEB-INF/classes/com/example
4. Mapped it by url pattern *.servlet in web.xml
This much entry I have made. Nothing else.
If you follow these steps, you will be able to insert the data in database by following url...
http://localhost:8080/test/*.servlet
Naseem
1. Context tag in server.xml under <Host> tag
2. db1 user datasource name.
3. Invoke Servlet in /ValidationRND/WEB-INF/classes/com/example
4. Mapped it by url pattern *.servlet in web.xml
This much entry I have made. Nothing else.
If you follow these steps, you will be able to insert the data in database by following url...
http://localhost:8080/test/*.servlet
Naseem
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Ranch Hand
posted 13 years agoHey Naseem/ everybody else,
In the previous post I noticed a inconsistency, (it might not be!)
db1 = the DSN name,
resource name = TestDB
In your servlet-code you refer to TestDB
?? If you look at one of your above posts, the name of the resource and DSN name were the same?
--------------------------------------------
I still have the problem above outstanding, I'm temporarily using classforname....etc. I still howevere want to solve this JNDI problem.
So just to go through this step by step
<Context path='/test' docBase='F:NaseemKhanj2ee_projectsValidationRND
what is the /test ?? I have the directory name where my web app is, e.g
'/DB', absolute path is C:Program FilesApache Software FoundationTomcat 5.5webappsDB
What abt the docBase?? I have the base directory where all the different web applications i'm working on are
e.g. C:Program FilesApache Software FoundationTomcat 5.5webapps
My resources tag in the server.xml <Resource name='jdbc/db1'...
[is this the dsn-name you give your database resource?]
the url reads --> url= 'jdbc:odbc:db1'
My MS Access database is on my desktop and is added via DSN--> system, called db1 - real file name is testMyDb.mdb [DSN --> system, works for classforname�..]
The servlet code is as follow
It all seems ok to me? Why am I then having a problem? Error is something along the lines of JDBC is not bound in the context.
I�ve been reading the web and people advice to create a file called context.xml � is that necessary?
Is this an environmental problem or a coding problem? I call all my servlets directly by enabling the invoker servlet via conf/web.xml
Thanks in advance for your advice/views
Regards
Zein
[added line breaks so page doesn't wrap]
[ July 06, 2006: Message edited by: Jeanne Boyarsky ]
In the previous post I noticed a inconsistency, (it might not be!)
db1 = the DSN name,
resource name = TestDB
In your servlet-code you refer to TestDB
?? If you look at one of your above posts, the name of the resource and DSN name were the same?
--------------------------------------------
I still have the problem above outstanding, I'm temporarily using classforname....etc. I still howevere want to solve this JNDI problem.
So just to go through this step by step
<Context path='/test' docBase='F:NaseemKhanj2ee_projectsValidationRND
what is the /test ?? I have the directory name where my web app is, e.g
'/DB', absolute path is C:Program FilesApache Software FoundationTomcat 5.5webappsDB
What abt the docBase?? I have the base directory where all the different web applications i'm working on are
e.g. C:Program FilesApache Software FoundationTomcat 5.5webapps
My resources tag in the server.xml <Resource name='jdbc/db1'...
[is this the dsn-name you give your database resource?]
the url reads --> url= 'jdbc:odbc:db1'
My MS Access database is on my desktop and is added via DSN--> system, called db1 - real file name is testMyDb.mdb [DSN --> system, works for classforname�..]
The servlet code is as follow
It all seems ok to me? Why am I then having a problem? Error is something along the lines of JDBC is not bound in the context.
I�ve been reading the web and people advice to create a file called context.xml � is that necessary?
Is this an environmental problem or a coding problem? I call all my servlets directly by enabling the invoker servlet via conf/web.xml
Thanks in advance for your advice/views
Regards
Zein
[added line breaks so page doesn't wrap]
[ July 06, 2006: Message edited by: Jeanne Boyarsky ]
Ranch Hand
posted 13 years agoOhh there was some more preceding code in the servlet that I forgot to post, as below
Rancher
posted 13 years agoJust as a side note, be aware that the JDBC/ODBC bridge is not meant to be used in a multi-threaded enviromnent like a web application. It has serious shortcomings in this regard (as does Access itself). Make sure you only ever have a single thread using it.