I cannot ALTER table in Data Studio for last few days.. Nothing really was updated (I guess it is Eclipse environment error). Any ideas what's going on? Note: it happens when I do right-click on the table then select Alter. But it happens only to that one table. Is it because the table contains CLOB column?
I think you are right, it seems to be an eclipse environment error. Something in the .metadata has gone corrupt. This is most probably leading to a function being called recursively and consequently the StackOverflowError.
It might also be the case that you might have done some unrelated system cleanup during the time Data Studio was not being used. There might be some system file that it needs and now is unable to find.
I would suggest you use the data studio web console to monitor the health of the said database -
http://www.ibm.com/support/knowledgecenter/SS62YD_4.1.0/com.ibm.datatools.db.web.health.doc/topics/introducing.html
If it does not give any valid results, then i am afraid a reinstall is required.
I think, you have missed authorization issues. SYSADM or SYSCTRL authority is not properly set for you. So it causes the issue.
If you ALTER any object from the Data Source Explorer or embedded SQL within an application, you must have ownership of the object and at least one of the following: ALTERIN privilege for the schema or all schemas. So SYSADM or SYSCTRL authority is needed.
Another issue, I want to say you to use updated Data Studio, Version 4.1.1 or more.
because, they give some additional features -
New and Changed Features for the Data Studio, Version 4.1.2
Eclipse SDK Uplift to ensure shell sharing with InfoSphere Data
Architect, Rational Application Developer and Rational Developer for
z/OS
New and Changed Features for the Data Studio, Version 4.1.1
Support for Fix Pack 4 for DB2 for Linux, UNIX and Windows v10.5. This
includes: The latest BLU capabilities, such as the ability to alter
BLU tables by adding columns.
For more, you can study -
Best practices when using Data Studio
What's New and Changed in IBM Data Studio Version 4.1.x
Related
Over the last couple of years, I have been creating an app for a customer (also the reason that I unfortunately cannot share the code on here). The last version uploaded to the play store was targeted at API 25, and was published around July 2017.
I am currently testing a new update, and am finding that opening the database via the SQLiteOpenDatabase is causing the onCreate function to run. The data from the previous version of the app gets lost. I have installed the previous version of the app both via the play store and manually, but the upgrade is always performed directly from the new versions APK.
Data stored on intermediate development versions of the app doesn't get lost, but they all erase data from the currently released version.
The classes for managing the database haven't changed, and are using the same version code for the database. I have checked the certificates, and all versions have been signed with the same one.
Is anyone aware of other reasons that the database may be recreated? This is a serious issue, that is preventing the release of the application.
I'm trying to map some Java classes using the Hibernate JPA implementation. My problem is that I can't use hardcoded Strings als column namens. You can see the error message I get in the picture below.
I'm using OpenJPA as my Default JPA Provider and have already tried to change it.
IntelliJ Version 14.0.3
regards,
You have to associate your data source (create a data source in database view first - aka your real JDBC database connection) with a persistence unit or session factory (hibernate.cfg.xml).
Follow below steps and the warnings will disappear:
Open the Persistence tool window (View | Tool Windows |
Persistence).
Right-click the necessary module, persistence unit or
session factory, and select Assign Data Sources in the context menu.
In the Assign Data Sources dialog that opens, click the Data Source
field and select the necessary data source. (To remove the
association with the data source, select none.)
See here: Associating data sources with session factories and persistence units
For those who just want to disable this check, go to
Intellij IDEA -> Preferences -> Search "Unresolved database references in annotations" and uncheck it.
(macOS Mojave and Intellij Ultimate 2019.3)
This will disable the inspection and remove all the "Cannot resolve column…" errors on the #Column annotations. Intellij will stop checking if the String column names exist in the database tables. Do it at your own risk.
I found Panos' answer useful, but I didn't see anybody mention adding the database as a data source. Perhaps that's routine enough to be assumed, but if not, here's what I had to do:
Select View/Tool Windows/Database
The Database window usually appears on the top right.
In the Database window, click the green + sign and select Data Source/MySQL (or whatever flavor of Data Source you're using).
The Data Sources and Drivers window pops up.
If your database isn't listed there, use the empty form to add the following:
Host: usually localhost, but if your test database is living
on another machine, put that address in.
Username: for your database use.
Password: for your database user's password.
IDEA might need some fiddling to find the JDBC driver. I was told that in theory it should have found it in the maven build process for the project I was working on, but it did not. I reopened View/Tool Windows/Database and looked at my MySQL entry. At the bottom it had an error message next to Driver:, and also a MySQL link. I clicked the MySQL link and IDEA brought up a popup to fetch Connector/J.
Despite the fact that the checkboxes for Auto commit and Auto sync defaulted to checked and I left them that way, IDEA seemed to need a nudge. Or perhaps it was just taking a while and I was impatient.
In any event, first I double-clicked on the line for my database in Database. That seemed to do it, but I didn't realize I needed Persistence yet, and while sorting that out, at a coworker's suggestion, I also clicked the Synchronize button (two arrows in a circle) on Database.
You can also right-click on your database in Database and select Synchronize.
It may take a few seconds, but you should see IDEA filling in the database schema under the entry in Database.
Finally I found Panos's answer and fixed Persistence.
Select View/Tool Windows/Persistence
The Persistence window usually appears on the top left.
In the Persistence window, right-click on your project and select Assign Data Sources.
IDEA pops up a dialog with two columns, your project in the left column and in my case an empty cell in the right column. Click on the empty cell and IDEA should give you a dropdown that allows you to select the database you just added.
Again, it may take a few seconds for IDEA to finish analyzing the data source and redo all the inspections.
Just for anyone else whom this didn't solve and comes across via google (like myself) .. setting the table name via the #Table Annotation fixed it for me.
Actually this is not any error that prevents your code to compile. Probably your spell-checker is on and which gives you the spelling mistake. If you can compile your code then you may ignore these type of scenario.
Look you have not getting any error for other text like #Column, #GeneratedValue etc. That means jars using these kind of stuff are in your build path. So I think you can ignore these type of error.
maybe this solution also help someone...
Open Database dialog window from the right side of Intellij
Go to DB Data Source Properties (find it in top menu)
Go to Schemas
Uncheck "Default database"
Check your specific DB and inside also check Default schema(public)
Good luck!
If you are using the JPA, it is also important to set up the SQL Dialect as
HSQLDB instead of MySQL. This is often confusing because it feels like MySQL is the correct dialect, but in fact what you are dealing with hibernate is HSQL.
If you have just upgraded to IntelliJ 2017.13 or other derivatives of this version (e.g., Webstorm), or you've just re-imported your project, it might mess up the language injection and need to manually correct this.
This can be accomplished via the Project
Settings -> Languages and Frameworks
part of the IDE.
If there is no real mismatch and this warning happens just because of IDE, you can easily link your project with the data source that you connect. Intellij already suggests the way to do it.
I'm using Intellij and connecting DB by JPA. I've met problem just like you and this is my solution.
You need to connect your database following these steps:
View -> Tool Windows -> Database -> then add database you are using to Intellj
After connect your database, you need to assign data source to Intellj by following these
View -> Tool Windows -> Persistence -> then add data from database you just added from 1 step
OK. That's all!
P/s: make sure your code work well!
I have a long standing domino application that uses embedded views to display data. This application has been moved from a server 2003, 32 bit, domino 8.5 environment to a new server 2008 R2 64 bit domino 8.5.3 FP6 environment.
I have everything up and working as before with the exception of embedded views. They are giving a SecurityException "Missing required Permissions manifest attribute in main jar: http://*.com/domjava/nvapplet.jar".
I have confirmed that the actionbar.jar, editor.jar, nvapplet.jar, and outline.jar are the current version on the server. I have even replaced them with the version from the IBM download (http://www-01.ibm.com/support/docview.wss?uid=swg21662233).
I can get this to work by displaying the view as HTML instead of Java Applet, but I don't understand what the issue is with the java version?
There were major security changes to Java in relation to applets. You can download the latest applets here.
http://www-01.ibm.com/support/docview.wss?uid=swg21662233
You may need to clear your browser cache if it still persists after that.
[update] The question now mentions that you installed Fixpack 6, installed the Jars then uninstalled Fixpack 6.
When you uninstall a fix pack, it reverts the files it touches back to what they were before the fix pack was installed. Although I have no details on it, it is quite likely that the updated security applets were also added to fix pack 6 (as it's the last fix pack for R8.5.3).
So during the uninstall the applets look the same as FP6 and it reverts them.
To solve this, after the revert you would need to drop in the updated applets again.
If the issue still persists at this point, you need to open the Java Console on your browser and update your question with the logs it generates (as it pertains to the error).
Turns out this situation may have been a little unique, but I will post it here for future reference in case anyone else runs into this. The server was a fresh build of windows and domino all the way up to 8.5.3 FP6. The FP6 installer date stamps the jars in question with the install date of the system. So in my case I had people come to the site, download the jar with a file date newer than 1/17/2014, which is the date of the files IBM put in the fix mentioned above. Those files are a simple flat copy so they always maintain the 1/17/2014 date. Anyway, any user that came and picked up the newer date files 3/1/2014 for example would keep those files or rev date in their local java machine cache and ignore the 1/17/2014 file I had replaced them with, thus they continued to show the problem. Only by manually clearing their cache from the java were they able to pick up the 1/17/2014 file and no longer have the issue.
Actually from what I was told via IBM FP 6, does not include the fixed .jars. That was my main problem assuming it did.
How can I pack a Java application and MySQL installation files in a single exe file? Can I install the MySQL files automatically in background (or without any inputs from user)? This is just to simplify the installation procedure.
Java is cross platform, MySQL isn't, so you'd have to create various installers for multiple platforms with different MySQL binaries. If you want to include MySQL source code for non Windows systems, then that's another story... so I assume you want just an installation for Windows.
First of all, get an installation software that you'll feel comfortable with. There is a nice list of free and non free installers on Wikipedia.
Second thing, you can do a silent MySQL installation. How it's done is explained here.
But note that doing a silent MySQL installation without user's permission doesn't sound too good to me, since MySQL isn't exactly lightweight software and you might mess up something if a user already has MySQL somewhere installed.
So, by doing this, you have to be extra careful to check if port 3306 is already up and running (default MySQL port), and other sanity checks to see if there's a possibility of another instance lurking in the background.
It would be better if you at least informed your user that MySQL will be installed. Think about these details, because they might be dealbreakers so some of your users.
Use Java Web Start to launch the application.
JWS offers an ExtensionInstallerService that can be used for installing MySQL. Here is a small demo. of the ExtensionInstallerService.
on WIN XP SP3 and Netbeans 6.7.1 IDE,
I have installed Java SDK 6.17 which includes JavaDB. I set the JavaDB directory to ...\Java\JavaDB at the Java installation script with %DERBY_HOME% set accordingly and %PATH% including %DERBY_HOME%\bin
Later on I installed GlassFish-V3 Prelude which - surprise surprise - comes with its own JavaDB and silently installs that into a JavaDB directory under the GlassFish path.
Q's
I don't want to have duplicates. Can
I remove one of these installations
without spoiling Netbeans.
How can I verify which of the two
JavaDB's Netbeans is actually using
Can I eventually configure GlassFish
in a way to use the JavaDB I
installed as part of the SDK
Thanks for any hints (as on superuser.com I didn't get any replies :-( )
I don't want to have duplicates. Can I remove one of these installations without spoiling Netbeans.
If really you want to remove one of them, I'd suggest to remove the one that comes with your JDK and to leave the one bundled with GlassFish v3 (GlassFish expects it to be there when using some commands which can be extremely handy, e.g. during development). But honestly, I wouldn't spend too much time for the 4.5 MB extra space used.
How can I verify which of the two JavaDB's Netbeans is actually using
To verify, go to the Services tab, expand the Databases node and right-click on Java DB and select Properties.... You should get the following window:
alt text http://netbeans.org/images_www/articles/65/ide/java-db/javadb-props.png
As documented in Working with the Java DB (Derby) Database, "If you have the GlassFish Server registered in your NetBeans IDE installation, Java DB will already be registered for you."
Can I eventually configure GlassFish in a way to use the JavaDB I installed as part of the SDK
I don't know, but... why would you do that, why is it such a concern, don't you think you're wasting your time? Now, as I said, if this is really an issue, remove the version bundled with your JDK instead.
PS: GlassFish v3 is out, GlassFish v3 prelude is outdated, you should upgrade.
MikeD!
After many years, I am using NetBeans again. As I realized many features are included but others get "lost". I am planning to install several versions.
In NetBeans 6.7.1, to know what version of Java DB NetBeans is using, right click the Java DB node and ckeck the properties.
The path next to the label Java DB Installation tells you what installation is currently in use.
The path next to the label Database Location is used as the value for the property derby.system.home. This property tells Java DB where to create/find the individual databases folders. Besides, this folder holds two files called derby.properties and derby.log.
*derby.properties* establishes persistently system-wide properties.
Do not worry about duplicates. As you can see NetBeans uses 1 at a time. Nevertheless, as a recommendation, choose an installation and stick to it. During my tests I changed the path to the Java DB Installation several times and played with the user authentication properties inside derby.properties and eventually NetBeans could not create new databases in the regular way. So, I had to re-install NetBeans (I use the OS independent zip).
Regarding GlassFish, I have not experimented yet. But, it is reasonable to think that there is some limited set of options about using a different version of Java DB. For example, NetBeans 6.7.1 Java DB support fails if you set the netbeans_jdkhome property so that it points to a JDK version equal or higher than 1.7.0. That tells us something, right?
I will try to tell you anything useful I find out during my tests.
George