Derby + Netbeans Connect上不存在表/视图 [英] Table/View does not exist on Derby + Netbeans Connect

查看:61
本文介绍了Derby + Netbeans Connect上不存在表/视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试与Netbeans中的Derby建立连接以进行产品注册.与数据库的连接似乎还可以,但是当我尝试在语句中插入对象时,它返回表/视图不存在错误.已经尝试在论坛中阅读相同错误的其他案例,但是看起来我的案例是不同的.我试图验证区分大小写的名称是可以的,并尝试直接从Netbeans执行sql命令,该表及其列随即出现.(我没有使用dist文件夹中的应用程序,而是从Netbeans执行)

I am trying to make this connection with Derby in Netbeans for products registration. Connection with Database seems okay, but when I try to insert an object in a statement it returns Table/View does not exist error. Already tried to read other cases of the same error in the forum, but looks that my case is different. I tried to verify case sensitive names it's okay, tried to execute an sql command directly from Netbeans, the table appears with its columns. (I'm not using the app in the dist folder, I'm executing from Netbeans)

我的插入:在这里,在连接没问题的情况下,它找到了BD:从Netbeans表执行命令是可以的:GUI错误:

My insert: Here, in the connection no problem, it finds the BD: Executing a command from Netbeans table is okay: Error in GUI:

推荐答案

您可能正在使用两个不同的 Mercado 数据库.如果您在硬盘上搜索名称为"Mercado"的文件夹,我相信您可能会找到其中两个:

You might be using two different Mercado databases. If you search your hard disk for a folder by the name 'Mercado', I believe you may find two of them:

  1. 使用Netbeans IDE进行连接时,您正在访问Derby Network Server,该服务器在硬盘上的某个位置具有主"目录,并且它使用相对路径名 Mercado 存储数据库.
  2. 运行独立程序时,您使用的是嵌入式驱动程序,而不是客户端/服务器驱动程序,因此您的独立程序正在使用相对路径名 Mercado
  3. 访问数据库
  1. When you connect with the Netbeans IDE, you are accessing the Derby Network Server, which has a "home" directory somewhere on your hard disk, and it is storing the database using the relative pathname Mercado.
  2. When you run your standalone program, you are using the Embedded Driver, not the Client/Server Driver, so your standalone program is accessing the database using the relative pathname Mercado

除非您非常仔细地确保独立测试程序的当前工作目录指向的位置与Derby Network Server使用的相同位置作为其数据库主目录,否则您可能已经创建了两个不同的 Mercado 数据库,这就是为什么在其中一个而不是另一个数据库中找到您的数据的原因.

Unless you have very carefully ensured that your standalone test program is running with its current working directory pointed at the same location that is being used by the Derby Network Server as its database home directory, then you have probably created two different Mercado databases and that is why your data is found in one of them and not the other.

这篇关于Derby + Netbeans Connect上不存在表/视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆