I get this error in Netbeans:

我在Netbeans中得到这个错误:

java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/

How is this caused and how can I solve it?

这是如何造成的,我该如何解决?

16 个解决方案

#1


22

java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/

java.sql。SQLException:没有找到适合jdbc的驱动程序:derby://localhost:1527/。

This exception has two causes:

这个例外有两个原因:

  • The driver is not loaded.
  • 驱动程序没有加载。
  • The JDBC URL is malformed.
  • 这个JDBC URL是错误的。

In your case, I'd expect to see a database name at the end of the connection string. For example (use create=true if you want the database to be created if it doesn't exist):

在您的示例中,我希望在连接字符串的末尾看到一个数据库名称。例如(如果希望数据库不存在,则使用create=true):

jdbc:derby://localhost:1527/dbname;create=true

Databases are created by default in the directory where the Network Server was started up. But you can also specify an absolute path to the database location:

数据库是在启动网络服务器的目录中默认创建的。但您也可以指定数据库位置的绝对路径:

jdbc:derby://localhost:1527//home/pascal/derbyDBs/dbname;create=true

And just in case, check that derbyclient.jar is on the class path and that you are loading the appropriate driver org.apache.derby.jdbc.ClientDriver when working in server mode.

为了以防万一,检查一下derbyclient。jar在类路径上,并且在服务器模式下加载适当的驱动程序org.apache.derby.jdbc.ClientDriver。

更多相关文章

  1. PHP基础教程十四之使用MySqli操作数据库
  2. Java向MySQL数据库插入时间类型Date数据时需要注意的问题
  3. 第15天(就业班) 课程回顾、mysql安装、管理数据库、管理表、增删
  4. Mysql数据库学习笔记(一)
  5. vs2010下vc调用sqlite3数据库以及配置
  6. 一个mysql数据库的问题啊,我都摸索两天了,还没解决,今天再不搞定
  7. 在Linux环境下,将Solr部署到tomcat7中,导入Mysql数据库数据, 定时更
  8. Jmeter—8 连接microsoft sql server数据库取数据
  9. 基于Sqlcipher和GreenDao的数据库加密

随机推荐

  1. XML交互入门教程
  2. XmlTextWriter函数定义与用法汇总
  3. DTD详解的内容推荐
  4. 有关XMLSerializer的文章推荐8篇
  5. 有关真可的文章推荐10篇
  6. 关于-----------XML的10篇文章推荐
  7. 有关文档大小的文章推荐8篇
  8. 增、删、改的实例汇总
  9. 关于XSLT讲解的10篇文章推荐
  10. 有关语音合成的文章推荐