How to drop DB2 Java Stored Procedure? - db2

I have deployed a Java Stored Procedure through IBM Data Studio, and now I want to undeploy it, but I don't know how to do it completely.
I know you have to drop the procedure by calling DROP PROCEDURE <procedure name>.
Delete the record from SYSIBM.SYSJAVAOPTS that has my JAR_ID.
But how do you undeploy what SQLJ.DB2_INSTALL_JAR did?
It must have register my JAR file somewhere on DB2 because the first parameter is a BLOB of the JAR.

This can be done with the call sqlj.remove_jar( jar-id ) statement as described in JAR file administration on the database server.

Related

How to save specification and body of all the packages using oracle sql developer?

How to save specification and body of all the packages, table, views DDL using oracle sql developer?
Tools - Database Export
Here's how to unload to files for say, adding to Source Control.
And when it finishes...

How to change default H2 database to Postgresql for Kie Workbench (JBPM 7.2.0) running under existing under Wildfly (10.1.0) manually?

I have an existing Wildfly installation containing other apps. Besides that I want to deploy Kie Workbench too. Here I do not want to use the demo installation using Ant, which starts downloading and installing JBoss afresh.
My existing environment is below.
OS: Windows Server
Database: Postgres 9.6.1
JDBC: postgresql-42.1.4.jar
App Server: wildfly-10.1.0.Final
BPM/Drools App: kie-wb-7.2.0.Final-wildfly10.war
I deployed the Kie Workbench by downloading the war file from here:
https://repo1.maven.org/maven2/org/kie/kie-wb/
Now I would like to change the default H2 database driver with Postgresql 9.6.
Prior to this I created users and datasources already and had a workable kie-wb site, but only problem is: it is running on H2.
Any help appreciated in replacing H2 with Postgresql driver.
This post explains how to use Postresql with Wildfly 10.
According to this page you can just drop the Kies application to the deployments directory. This means probably that it uses the "default" H2 data source. Hence you must change jndi-name and pool-name of the newly added Postgresql in step 1 to those of the H2 and comment the H2 data source.
I performed the below steps. But somewhere I went wrong, not sure where. I am unable to login to the kie workbench.
JBPM App Server Configuration for PostgreSQL
Uncompress the zip file: jbpm-installer-full-7.2.0.Final build.properties file
Update release.version=7.2.0.Final in
Remove references of H2 in build.properties file
Add postgresql references in build.properties file including jdbc driver details and download url
Change H2 hibernate dialect to that of PostgreSQLDialect in jbpm-persistence-JPA2.xml file
Change all H2 reference and replace with PostgreSQL in standalone-wildfly-10.1.0.Final.xml, standalone-full-wildfly-10.1.0.Final.xml files
Change default datasource to jBPMDS in those two files:
Upload Postgres Driver and create module.xml file with the postgresql driver using JBOSS-CLI commands.
Issue the below ant commands from the directory of the expanded zip files:
ant clean.generated.ddl
ant download.ddl.dependencies
ant install.jboss
ant install.jBPM-console.into.jboss
Make sure standalone.xml and standalone-full.xml are being copied into the Wildfly configuration directory correctly.
Move the wildfly directory to the location of the JBOSS_HOME, or create environment variable pointing to the same.
Create the directory modules\org\postgresql\main in JBOSS_HOME home and copy files: module.xml, postgresql-42.1.4.jar
Add admin user in the Management Realm: admin
Add JBPM users with roles in braces in Application Realm: kieserver(kie-server), workbench(admin,kie-server)
Run the sql scripts from ddl_dependency folder as the ant script is failing.
Issue standalone -b 0.0.0.0 -c standalone-full.xml command
Bing! you are done!

How to create db file with SQLiteStudio

I have created the database for my Android app using SQLiteStudio 3.0.5 and now I need to save/export the one as .db file, but i found only the export to .sql-file. So, what should I do to make such procedure?
When you create database in SQLiteStudio it already is a proper sqlite database file. If you need to name it with .db extension, just rename the file in any file manager.
It sounds like you are trying to export the SQL command, and not the database itself.
Right-click on the database, and select "Export the database".

How to upload file to PostgreSQL database using flyway?

I use in Windows 7 IntelliJ IDEA 12, JDK 7, MyBatis, Spring 3 in order to create REST web application (Maven project with flyway-maven-plugin). I use Flyway in order to cope with sql migrations. Now I need to load some files to PostgreSQL 9.2 database. I've found this thread: https://dba.stackexchange.com/questions/1742/how-to-insert-file-data-into-a-postgresql-bytea-column
I'd like to use bytea_import from that thread. This custom function requires path to the uploaded file (it is in resources folder). How can I correctly set relative path to such file? What is considered as a current folder during migrations?
Not sure about bytea_import (if you get it working, let me know!), but you should be able to achieve this easily using Java-based migrations.
You can use Java-based migrations. If you still want to use SQL-based migrations, then use Flyway placeholders. Save required path in placeholder using *.pom properties. Example:
<flyway.placeholders.rtfPath>${project.build.outputDirectory}/rtf</flyway.placeholders.rtfPath>
Then use rtfPath in your SQL migration file in order to generate the full path to your uploaded file.

SQL CE deployment

I have a small windows app and am trying to use SQL CE for the local datastore. I have had a couple of problems deploying it. I am using ClickOnce deployment.
First question:
In the Publish properties -> Application Files I have it set to Data File(Auto), Required, Include. However, it doesn't seem to be included? When I navigate to the location that Click Once installs to its not there?
Second:
Click once creates a new directory in the User\Local\Apps directory, with the app files and SDF file in when I update the app and release a new version I don't want to start with a new database. All the data in the existing database will be lost? The just doesn't seem to make sense?
What is the procedure around this?