sqlserver 由于文件不可访问_通过JDBC访问数据库

dc62e1c59d7a9dc78fc57ca0231d9f88.png

通过JDBC访问数据库

MySql数据库

1a2d032eed569be95dc09c9c6d4b2cf2.png

MySQL是一种开放源代码的关系型数据库管理系统(RDBMS),使用最常用的数据库管理语言-结构化查询语言(SQL)进行数据库管理。

使用JSP文件访问MySql数据库

默认用户名:root

端口号:3306

【代码】

Connection con=DriverManager.

getConnection("jdbc:mysql://localhost:3306/student","root","123456");

Statement stmt = con.createStatement();

%>

// student 为数据库名称,123456为用户密码

5471a3bea895060d048020b5ae3803b6.png

SQL Server数据库

2a60255f3084a31b2fd60d31e79d4551.png

SQL Server数据库的应用,能够有效提升数据请求与返回的速度,有效应对复杂任务的处理,是提升工作效率的关键。

使用JSP文件访问SQL Server数据库

默认用户名:sa

端口号:1433

【代码】

Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver);

String url="jdbc:microsoft:sqlserver://

localhost:1433;

DatabaseName=pubs";

String user="sa";

String password="123456";

Connection conn = DriverManager.

getConnection(url,user,password);

Statement stmt = conn.createStatement()

%>

94b0aec392baaaf6c156e70b5ecd1159.png

Oracle数据库

f00f57a00bc72bd7ed6f5c7537d46c2a.png

Oracle Database是甲骨文公司的一款关系数据库管理系统,系统可移植性好、使用方便、功能强,适用于各类大、中、小、微机环境。它是一种高效率、可靠性好的、适应高吞吐量的数据库方案。

使用JSP文件访问Oracle数据库

用户名:user

端口号:1521

【代码】

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","user","password");

Statement stmt = con.createStatement();

%>

// orcl是数据库名称

2020e17fecea838cd7aa7223a721cee4.png

Database

MySQL is an open source relational database management system (RDBMS) that uses the most commonly used database management language-Structured Query Language (SQL) for database management.

The application of SQL Server database can effectively improve the speed of data request and return, and effectively deal with the processing of complex tasks, which is the key to improving work efficiency.

Oracle Database is a relational database management system of Oracle Corporation. The system has good portability, convenient use, and strong functions. It is suitable for all kinds of large, medium, small and microcomputer environments. It is a highly efficient, reliable, and high-throughput database solution.

47ee5a87eab2c8979d3d5fa0e35129b5.png

END

参考资料:Google翻译,百度百科

本文由LearningYard学苑原创,部分文字、图片来源于网络,如有侵权,请联系删除!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值