惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Latest news
Latest news
C
Check Point Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
H
Heimdal Security Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
W
WeLiveSecurity
G
Google Developers Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
C
CERT Recently Published Vulnerability Notes
aimingoo的专栏
aimingoo的专栏
D
DataBreaches.Net
PCI Perspectives
PCI Perspectives
The Register - Security
The Register - Security
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
H
Hacker News: Front Page
Google DeepMind News
Google DeepMind News
有赞技术团队
有赞技术团队
The Last Watchdog
The Last Watchdog
GbyAI
GbyAI
L
Lohrmann on Cybersecurity
B
Blog
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
N
Netflix TechBlog - Medium
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LangChain Blog
J
Java Code Geeks
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
P
Privacy & Cybersecurity Law Blog

博客园 - 空空色色

转一篇,CentOS后台服务配置 linux kernel 2.6.36 编译升级 linux的UPNP支持(转) UPNP协议细节(转) UPnp协议 from wikipedia 考察智力zz JScollPane以及JPanel相关 bmp文件格式 java中对图象文件的处理(读写以及转换) Java媒体框架(JMF),个人很欣赏.... 常用颜色对照表 YUV/YIQ色彩空间的转换 关于Swing实现透明窗体的。我也很喜欢,收藏! A*以及迭代加深的A*算法(IDA*) 我的兄弟们之袋鼠篇 深度优先状态搜索法 我的兄弟们之温J篇 java中的图象处理技术基础 经典搜索算实现之一,广度优先.
java中的数据库程序应用
空空色色 · 2006-12-01 · via 博客园 - 空空色色

      简单的,分两步讨论。
(一)
      1.数据的准备,比较常用的是windows下的Acess工具,首先建立一个你自己的数据库文件,例如我们取名为datebase.mdb,打开后在里面创建表,一个或者多个(具体如何创建依自己喜好)。
      2.加载数据源,表建好之后,并不意味着一切已经完事,下面,打开我的电脑,控制面板,管理工具。数据源(ODBC),单击添加按钮,选择Microsoft Acess Driver(*mdb),单击完成。在弹出的对话框中键入你的数据源名mydata(可以任意)以及说明,然后单击选择按钮,找到你所创建的datebase.mdb文件并单击确定。并一路确定下去。这样。一个数据源就配置好了。
(二)
      java的连接数据库操作(以下为程序片段):
String str;
try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}//生成odbc数据库驱动实例
 catch(ClassNotFoundException e){}//捕捉异常
 Connection  con=DriverManager.getConnection("jdbc:odbc:mydata");//连接数据库
 Statement sql=con.createStatement();//生成操作对象
 ResultSet rs=sql.executeQuery(str);//数据库查询语句
 while(rs.next())//移动浮标
 {
    String id=rs.getString(3);//取当前浮标项的第三属性值并保存在id中 
   //添加其他代码………………
}
rs.close();//关闭浮标
值得注意之处在于,getConnection(datasource,user,passwords)如果有需要,我们要在参数中加入用户和密码两个值。

posted on 2006-12-01 22:12  空空色色  阅读(241)  评论()    收藏  举报