简体   繁体   English

Derby + Netbeans Connect上不存在表/视图

[英]Table/View does not exist on Derby + Netbeans Connect

I am trying to make this connection with Derby in Netbeans for products registration. 我正在尝试与Netbeans中的Derby建立连接以进行产品注册。 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. 我试图验证区分大小写的名称没关系,尝试直接从Netbeans执行sql命令,该表显示其列。 (I'm not using the app in the dist folder, I'm executing from Netbeans) (我没有在dist文件夹中使用该应用程序,我正在从Netbeans执行)

My insert: 我的插入: 图像1 Here, in the connection no problem, it finds the BD: 在这里,在连接没问题,它找到BD: Imagem2 Executing a command from Netbeans table is okay: 从Netbeans表执行命令是可以的: Imagem3 Error in GUI: GUI中出错: Imagem4

You might be using two different Mercado databases. 您可能正在使用两个不同的Mercado数据库。 If you search your hard disk for a folder by the name 'Mercado', I believe you may find two of them: 如果您在硬盘上搜索名为'Mercado'的文件夹,我相信您可能会找到其中两个:

  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 . 当您使用Netbeans IDE连接时,您正在访问Derby Network Server,它在硬盘上的某个位置有一个“home”目录,并且它使用相对路径名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 当您运行独立程序时,您使用的是嵌入式驱动程序,而不是客户端/服务器驱动程序,因此您的独立程序使用相对路径名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 Network Server作为其数据库主目录使用的相同位置,否则您可能已创建了两个不同的Mercado数据库,即为什么你的数据是在其中一个而不是另一个中找到的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM