Oracle 10g 与 Java 的连接 [英] Oracle 10g connection with Java
本文介绍了Oracle 10g 与 Java 的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
用于连接 java for Desktop 应用程序的驱动程序是什么.我发现了很多类型,比如 tiny 和 all,但无法理解.请帮帮我
what are the drivers which are used to connect with java for Desktop application. i have found many types like tiny and all but was not able to understand. Please help me out
推荐答案
为了让您的生活更轻松,我建议您只使用 Oracle 的 Thin Driver.
To make your life easier, I would recommend just using Oracle's Thin Driver.
首先,从 Oracle 网站下载驱动程序:
First, download the driver from Oracle's site:
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
然后将 JAR 添加到您的项目并使用以下命令连接到数据库:
Then add JAR to your project and connect to database using:
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@//localhost:1521/orcl", "scott", "tiger");
当然,将这些参数替换为与您的数据库对应的参数.
Of course, replace these parameters with the ones corresponding to your DB.
这篇关于Oracle 10g 与 Java 的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文