Use of javadb and table bind in netbeans

Source: Internet
Author: User
Tags glassfish netbeans

Yesterday I made a small database management system, mainly used to manage the Import and Export of Goods and statistics.
I used MySQL and Java for my graduation project. I plan to use the built-in javadb in JDK tonight.
To achieve this, founder is relatively simple and strives to win the game in two hours.
Hoho ~~~

I failed to do this last night. I spent one night, ah... Very Spam
It took me some time to read help.
Oh, my God, I am a miserable child. I spent a lot of labor writing.
It could have been done with ease. It's really a progress of society.
I cannot keep up with myself. I am old...

First, I checked javadb and connected it, But the strange thing is that drivers cannot be used,
Is everything right? Yes...
Ah, it turns out that the configuration is retained after you reinstall netbeans.
Because the glassfish-v2ur2 is installed to replace the previous glassfish-v2, this path is not correct
Of course, the jar package of the driver has an error, so it cannot be used, so the configuration is OK.

Although OK, but JAVA DB (embedded) connection has some problems

If you don't want to talk about it, let's start building databases. First, get the five tables.
Oh, there is a problem...
The table created in java db cannot be deleted if it is wrong. Haha, the restart is OK. It turns out that I deleted the file first...

Shit
Connect
12:39:01 org. jdesktop. application. Application $1 run
Severe: Application class repertorysys. repertorysysapp failed to launch
Local exception Stack:
Exception [TOPLINK-4002] (Oracle toplink essentials-2.1 (build b23-fcs (02/28/2008): Oracle. toplink. Essentials. Exceptions. databaseexception
Internal exception: COM. mySQL. JDBC. exceptions. jdbc4.mysqlsyntaxerrorexception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL Server version for the right syntax to use near 'add, fax, phone, connect, name, remark from business 'at line 1
Error code: 1064
Call: Select bid, add, fax, phone, connect, name, remark from business
Query: reportquery (repertorysys. Business)
At oracle. toplink. Essentials. Exceptions. databaseexception. sqlexception (databaseexception. Java: 319)
At oracle. toplink. Essentials. Internal. databaseaccess. databaseaccessor. basicexecutecall (databaseaccessor. Java: 566)
At oracle.toplink.essential tials.internal.databaseaccess.databaseaccessor.exe cutecall (databaseaccessor. Java: 452)
At oracle.toplink.esstials.threetier.serversession.exe cutecall (serversession. Java: 473)
At oracle.toplink.esstials.internal.queryframework.javascecallquerymachism.exe cutecall (fig. Java: 228)
At oracle.toplink.esstials.internal.queryframework.javascecallquerymachism.exe cutecall (fig. Java: 214)
At oracle.toplink.esstials.internal.queryframework.javascecallquerymachism.exe cuteselectcall (fig. Java: 285)
At oracle. toplink. Essentials. Internal. queryframework. Fig. selectallrows (fig. Java: 615)
At oracle. toplink. Essentials. Internal. queryframework. expressionquerymechanic. selectallrowsfromtable (expressionquerymechanic. Java: 2416)
At oracle. toplink. Essentials. Internal. queryframework. expressionquerymechanic. selectallreportqueryrows (expressionquerymechanic. Java: 2382)
At oracle.toplink.essential tials.queryframework.reportquery.exe cutedatabasequery (reportquery. Java: 802)
At oracle.toplink.essential tials.queryframework.databasequery.exe cute (databasequery. Java: 628)
At oracle.toplink.essential tials.queryframework.objectlevelreadquery.exe cute (objectlevelreadquery. Java: 692)
At oracle.toplink.essential tials.queryframework.objectlevelreadquery.exe cuteinunitofwork (objectlevelreadquery. Java: 746)
At oracle. toplink. Essentials. Internal. Sessions. unitofworkimpl. internalexecutequery (unitofworkimpl. Java: 2248)
At oracle.toplink.essential tials.internal.sessions.abstractsession.exe cutequery (abstractsession. Java: 952)
At oracle.toplink.essential tials.internal.sessions.abstractsession.exe cutequery (abstractsession. Java: 924)
At oracle.toplink.essentials.internal.ejb.cmp3.base.ejbqueryimpl.exe cutereadquery (ejbqueryimpl. Java: 367)
At oracle. toplink. Essentials. Internal. EJB. cmp3.base. ejbqueryimpl. getresultlist (ejbqueryimpl. Java: 478)
At repertorysys. repertorysysview. initcomponents (repertorysysview. Java: 201)
At repertorysys. repertorysysview. <init> (repertorysysview. Java: 29)
At repertorysys. repertorysysapp. startup (repertorysysapp. Java: 19)
At org. jdesktop. application. Application $ 1.run( application. Java: 171)
At java. AWT. event. invocationevent. Dispatch (invocationevent. Java: 209)
At java. AWT. eventqueue. dispatchevent (eventqueue. Java: 597)
At java. AWT. eventdispatchthread. pumponeeventforfilters (eventdispatchthread. Java: 273)
At java. AWT. eventdispatchthread. pumpeventsforfilter (eventdispatchthread. Java: 183)
At java. AWT. eventdispatchthread. pumpeventsforhierarchy (eventdispatchthread. Java: 173)
At java. AWT. eventdispatchthread. pumpevents (eventdispatchthread. Java: 168)
At java. AWT. eventdispatchthread. pumpevents (eventdispatchthread. Java: 160)
At java. AWT. eventdispatchthread. Run (eventdispatchthread. Java: 121)
Caused by: COM. mySQL. JDBC. exceptions. jdbc4.mysqlsyntaxerrorexception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL Server version for the right syntax to use near 'add, fax, phone, connect, name, remark from business 'at line 1
At sun. Reflect. nativeconstructoraccessorimpl. newinstance0 (native method)
At sun. Reflect. nativeconstruct%cessorimpl. newinstance (nativeconstruct%cessorimpl. Java: 39)
At sun. Reflect. delegatingconstruct%cessorimpl. newinstance (delegatingconstruct%cessorimpl. Java: 27)
At java. Lang. Reflect. constructor. newinstance (constructor. Java: 513)
At com. MySQL. JDBC. util. handlenewinstance (util. Java: 406)
At com. MySQL. JDBC. util. getinstance (util. Java: 381)
At com. MySQL. JDBC. sqlerror. createsqlexception (sqlerror. Java: 1031)
At com. MySQL. JDBC. sqlerror. createsqlexception (sqlerror. Java: 957)
At com. MySQL. JDBC. mysqlio. checkerrorpacket (mysqlio. Java: 3376)
At com. MySQL. JDBC. mysqlio. checkerrorpacket (mysqlio. Java: 3308)
At com. MySQL. JDBC. mysqlio. sendcommand (mysqlio. Java: 1837)
At com. MySQL. JDBC. mysqlio. sqlquerydirect (mysqlio. Java: 1961)
At com.mysql.jdbc.connectionimpl.exe csql (connectionimpl. Java: 2543)
At com.mysql.jdbc.preparedstatement.exe cuteinternal (preparedstatement. Java: 1737)
At com.mysql.jdbc.preparedstatement.exe cutequery (preparedstatement. Java: 1888)
At oracle.toplink.essential tials.internal.databaseaccess.databaseaccessor.exe cuteselect (databaseaccessor. Java: 726)
At oracle. toplink. Essentials. Internal. databaseaccess. databaseaccessor. basicexecutecall (databaseaccessor. Java: 501)
... 29 more
Exception in thread "AWT-EventQueue-0" Java. Lang. Error: Application class repertorysys. repertorysysapp failed to launch
At org. jdesktop. application. Application $ 1.run( application. Java: 177)
At java. AWT. event. invocationevent. Dispatch (invocationevent. Java: 209)
At java. AWT. eventqueue. dispatchevent (eventqueue. Java: 597)
At java. AWT. eventdispatchthread. pumponeeventforfilters (eventdispatchthread. Java: 273)
At java. AWT. eventdispatchthread. pumpeventsforfilter (eventdispatchthread. Java: 183)
At java. AWT. eventdispatchthread. pumpeventsforhierarchy (eventdispatchthread. Java: 173)
At java. AWT. eventdispatchthread. pumpevents (eventdispatchthread. Java: 168)
At java. AWT. eventdispatchthread. pumpevents (eventdispatchthread. Java: 160)
At java. AWT. eventdispatchthread. Run (eventdispatchthread. Java: 121)
Caused by: exception [TOPLINK-4002] (Oracle toplink essentials-2.1 (build b23-fcs (02/28/2008): Oracle. toplink. Essentials. Exceptions. databaseexception
Internal exception: COM. mySQL. JDBC. exceptions. jdbc4.mysqlsyntaxerrorexception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL Server version for the right syntax to use near 'add, fax, phone, connect, name, remark from business 'at line 1
Error code: 1064
Call: Select bid, add, fax, phone, connect, name, remark from business
Query: reportquery (repertorysys. Business)
At oracle. toplink. Essentials. Exceptions. databaseexception. sqlexception (databaseexception. Java: 319)
At oracle. toplink. Essentials. Internal. databaseaccess. databaseaccessor. basicexecutecall (databaseaccessor. Java: 566)
At oracle.toplink.essential tials.internal.databaseaccess.databaseaccessor.exe cutecall (databaseaccessor. Java: 452)
At oracle.toplink.esstials.threetier.serversession.exe cutecall (serversession. Java: 473)
At oracle.toplink.esstials.internal.queryframework.javascecallquerymachism.exe cutecall (fig. Java: 228)
At oracle.toplink.esstials.internal.queryframework.javascecallquerymachism.exe cutecall (fig. Java: 214)
At oracle.toplink.esstials.internal.queryframework.javascecallquerymachism.exe cuteselectcall (fig. Java: 285)
At oracle. toplink. Essentials. Internal. queryframework. Fig. selectallrows (fig. Java: 615)
At oracle. toplink. Essentials. Internal. queryframework. expressionquerymechanic. selectallrowsfromtable (expressionquerymechanic. Java: 2416)
At oracle. toplink. Essentials. Internal. queryframework. expressionquerymechanic. selectallreportqueryrows (expressionquerymechanic. Java: 2382)
At oracle.toplink.essential tials.queryframework.reportquery.exe cutedatabasequery (reportquery. Java: 802)
At oracle.toplink.essential tials.queryframework.databasequery.exe cute (databasequery. Java: 628)
At oracle.toplink.essential tials.queryframework.objectlevelreadquery.exe cute (objectlevelreadquery. Java: 692)
At oracle.toplink.essential tials.queryframework.objectlevelreadquery.exe cuteinunitofwork (objectlevelreadquery. Java: 746)
At oracle. toplink. Essentials. Internal. Sessions. unitofworkimpl. internalexecutequery (unitofworkimpl. Java: 2248)
At oracle.toplink.essential tials.internal.sessions.abstractsession.exe cutequery (abstractsession. Java: 952)
At oracle.toplink.essential tials.internal.sessions.abstractsession.exe cutequery (abstractsession. Java: 924)
At oracle.toplink.essentials.internal.ejb.cmp3.base.ejbqueryimpl.exe cutereadquery (ejbqueryimpl. Java: 367)
At oracle. toplink. Essentials. Internal. EJB. cmp3.base. ejbqueryimpl. getresultlist (ejbqueryimpl. Java: 478)
At repertorysys. repertorysysview. initcomponents (repertorysysview. Java: 201)
At repertorysys. repertorysysview. <init> (repertorysysview. Java: 29)
At repertorysys. repertorysysapp. startup (repertorysysapp. Java: 19)
At org. jdesktop. application. Application $ 1.run( application. Java: 171)
... 8 more
Caused by: COM. mySQL. JDBC. exceptions. jdbc4.mysqlsyntaxerrorexception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL Server version for the right syntax to use near 'add, fax, phone, connect, name, remark from business 'at line 1
At sun. Reflect. nativeconstructoraccessorimpl. newinstance0 (native method)
At sun. Reflect. nativeconstruct%cessorimpl. newinstance (nativeconstruct%cessorimpl. Java: 39)
At sun. Reflect. delegatingconstruct%cessorimpl. newinstance (delegatingconstruct%cessorimpl. Java: 27)
At java. Lang. Reflect. constructor. newinstance (constructor. Java: 513)
At com. MySQL. JDBC. util. handlenewinstance (util. Java: 406)
At com. MySQL. JDBC. util. getinstance (util. Java: 381)
At com. MySQL. JDBC. sqlerror. createsqlexception (sqlerror. Java: 1031)
At com. MySQL. JDBC. sqlerror. createsqlexception (sqlerror. Java: 957)
At com. MySQL. JDBC. mysqlio. checkerrorpacket (mysqlio. Java: 3376)
At com. MySQL. JDBC. mysqlio. checkerrorpacket (mysqlio. Java: 3308)
At com. MySQL. JDBC. mysqlio. sendcommand (mysqlio. Java: 1837)
At com. MySQL. JDBC. mysqlio. sqlquerydirect (mysqlio. Java: 1961)
At com.mysql.jdbc.connectionimpl.exe csql (connectionimpl. Java: 2543)
At com.mysql.jdbc.preparedstatement.exe cuteinternal (preparedstatement. Java: 1737)
At com.mysql.jdbc.preparedstatement.exe cutequery (preparedstatement. Java: 1888)
At oracle.toplink.essential tials.internal.databaseaccess.databaseaccessor.exe cuteselect (databaseaccessor. Java: 726)
At oracle. toplink. Essentials. Internal. databaseaccess. databaseaccessor. basicexecutecall (databaseaccessor. Java: 501)
... 29 more

A bunch of exceptions, and the inserted Table bind cannot be deleted or restored to the previous version. I am exhausted, so I can only create new projects continuously, and a large amount of labor is wasted.
Later, we found that Ctrl + Z was available and then OK,
But an exception occurs when the table is bound to date.
After a hard job, I finally found a problem with database creation,
Keywords are used in the columns in the table, which are not found during MySQL creation, because there is no exception...

It's really dizzy ....
It is probably because the quotation marks are used, but there is no bind in it...
However, it is still because of myself that we are confused with any keywords.
After this bug is fixed, you can quickly fix it by referring to the automatically generated code,

Next I want to help me write down his seed system for 00...
Haha, I don't know if the four mothers need a fertilizer management system ???

But it's all a type of system...

Ah. I want to test the software. I haven't seen it yet.
When I think of my previous score, I want to see it without tears... However, the tests in the afternoon are the same ,,,
This time, I have to make a good review...

There are also four levels. Even more dizzy, I got two exams...
Planning my life in the future...
Reading English and Japanese in the morning
In the afternoon, browse the webpage and write the program...
Watch the soft configuration at night...

That's all

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.