Tutorials to .com

Tutorials to .com » Jsp » Xml » Web Application Framework for JDBC-ODBC configuration

Web Application Framework for JDBC-ODBC configuration

Print View , by: iSee ,Total views: 7 ,Word Count: 417 ,Date: Mon, 20 Apr 2009 Time: 11:19 PM


Not all databases have a jdbc driver, so sometimes we need to use jdbc-odbc bridge driver as a database. Specific configuration is as follows:
1.windows-> start-> settings-> Control Panel, open the administrativ Tools-> Data Sources (ODBC);
2. In the ODBC Data Source Administrator in the "System DSN" added to the system data source (S), it must be noted that the system must (DSN) data sources, users can not use (DSN) data source, as is the pseudo-system servlet (DSN), all of the jsp, servlet procedures need to connect jdbc-odbc driver, then the system can only be used (DSN) data sources, users can not use (DSN) Data Source. Here, I SqlServer2000 drive is configured.
3. Open the java one studio, in the runtime environment -> Databases-> Drivers-> JDBC-ODBC Bridge, the right-click mouse -> connection method ..., in the database URL (A) column, write: jdbc: odbc: SqlServer2000, note that in the high-level, the option to choose dbo. Choose OK, then exit.
4. JATO works to create, set up and configuration -> Design Resources -> JDBC data source, the increase of JDBC data sources, will be jdbc: odbc: Sqlserver2000 add up.
5. File system directory on the main level, ... AppServletBase category to find and open the java class, in addition to the Notes, there is no line process. Add the following code in which:

/ / database connection code to initialize static
(
/ / Change the JNDI lookup for the DriverManager
SQLConnectionManagerBase.setUsingJNDI (false);
try
(
/ / Load JDBC-ODBC driver Class.forName ( "sun.jdbc.odbc.JdbcOdbcDriver");
)
catch (ClassNotFoundException e)
(
e.printStackTrace ();
)
SQLConnectionManagerBase.addDataSourceMapping ( "jdbc / JdbcOdbc",
"jdbc: odbc: Sqlserver2000");
)

6. The future can be the jdbc-odbc driver as data source to ordinary use.


Java and XML Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.