derby

Derby, Java: Trouble with “CREATE_TYPE” statement

十年热恋 提交于 2019-12-13 01:29:45
问题 I've been messing around with Apache Derby inside Eclipse. I've booted up a Network Server, and I've been working with servlets. In my Eclipse project, I have a class called "User", inside the package "base.pack". I have an SQL script open, and I've been trying to convert User, which implements Serializable, into a custom type. When I run the following lines, everything works fine: CREATE TYPE CARTEBLANCHE.bee EXTERNAL NAME 'base.pack.User' LANGUAGE JAVA This follows the general format they

Getting a java.sql.SqlNonTransientConnectionException

我是研究僧i 提交于 2019-12-13 00:46:54
问题 I am rather new to Java and JavaDB. I am trying to create a database in Netbeans 7.0.1 and after the server starts, I get an error that says: "An error occurred while creating the database: java.sql.SqlNonTransientConnectionException: A communications error has been detected: Software caused connection abort: recv failed.." I have tried to disable my antivirus (Microsoft Security Essentials) and my Windows Firewall, as well as disable an internet filter(Contentwatch's NetNanny) all to no

An attempt was made to modify the identity column ' ID'

有些话、适合烂在心里 提交于 2019-12-13 00:13:12
问题 I have problem with my project. My apache derby generate id, in table it works. But in app it doesnt work. In derby I set id autoincrement (start with 1, increment by 1), but i get this error: > Caused by: ERROR 42Z23 : An attempt was made to modify the identity > column ' ID' . My entity: package com.springapp.mvc.models; import javax.persistence.*; @Entity @Table(name = "USERS", schema = "KK", catalog = "") public class UsersEntity { private int id; private String name; private String

Apache Derby: Retrieve column names for an empty table

和自甴很熟 提交于 2019-12-12 19:23:45
问题 In JDBC metadata is not set, if the result set is empty, so I cannot execute getColumnNames(). I tried querying the derby systables: The SYS.SYSTABLES table contains REFERENCEID , COLUMNAME , COLUMNUMBER , ... COLUMNAME is what I'm searching for. But I see no possibility to join this table with SYS.SYSTABLES or any other table. 回答1: You can join systables and syscolumns with TABLEID = REFERENCEID select TABLENAME,COLUMNNAME, t.* FROM sys.systables t, sys.syscolumns WHERE TABLEID = REFERENCEID

Derby database export as a single file?

大城市里の小女人 提交于 2019-12-12 11:35:32
问题 I am making a small application and I am using the embedded derby database ,I want the application to be able to save the whole database onto a single file which can be stored on the hard drive and also import the database by opening this file in the future.Any clues or examples on how can I do it? 回答1: This might help you out! 1- Resource 1 with all detail 2- Resource 2 with Export Detail only 3- Using Java to Export/Import Using Jdbc To export all the data from a table to a single export

How to convert Apache Derby database to MySQL

萝らか妹 提交于 2019-12-12 11:22:44
问题 I would like to convert an existing Derby database to MySQL. 回答1: Try the DBCopy Plugin for SQuirreL SQL Client if you only need to convert the database once. There are other tools that may work. I you need to convert regularly, then I would use CSV export / import (for the data). 来源: https://stackoverflow.com/questions/3744770/how-to-convert-apache-derby-database-to-mysql

mysql dump into derby

浪子不回头ぞ 提交于 2019-12-12 10:59:13
问题 I'm using derby for development in eclipse. Is it possible to dump a table from MySQL and use it for derby in some way? I know that ddl & dml are different for both dbms but I'm looking for a way, other than dump/export, that would be appropriate. 回答1: There are two options I can find; if I understand your question correctly, I think at least one will cover what you are looking for. If your focus is the data (or a subset thereof) from a single table, use ij as indicated in the Derby tools

BoneCP & Derby - How to properly shutdown

ぃ、小莉子 提交于 2019-12-12 09:48:03
问题 I have: BoneCP CONNECTION_POOL = ...; CONNECTION_POOL.getConfig().setJdbcUrl("jdbc:derby:database...;shutdown=true"); Connection connection = CONNECTION_POOL.getConnection(); connection.close(); CONNECTION_POOL.shutdown(); However this results in the following exception: 3274 [com.google.common.base.internal.Finalizer] ERROR com.jolbox.bonecp.ConnectionPartition - Error while closing off internal db connection java.sql.SQLException: Cannot close a connection while a transaction is still

How to alter a column datatype for derby database?

ⅰ亾dé卋堺 提交于 2019-12-12 07:17:40
问题 I am trying to alter a datatype for a derby db column. The current price column is set as DECIMAL(5,0). I would like to alter it to DECIMAL(7,2). I did this : alter table item alter column price set data type DECIMAL(7,2); But it did not work, and showing the error: Error: Only columns of type VARCHAR may have their length altered. May I know how is it possible to alter it? Thank you. 回答1: Here is the Derby SQL script to change column MY_TABLE.MY_COLUMN from BLOB(255) to BLOB(2147483647):

JAVA, SQL, insert into no-duplicates

谁都会走 提交于 2019-12-12 04:39:25
问题 I am trying to insert into a table without duplicates. I am using SQL derbyclient in Java. The code is not working (error with 'where not exists' ). Any idea? Connection connection = DriverManager.getConnection("jdbc:derby://localhost:1527/PetroleumDataStorageSystemDB;create=true"); PreparedStatement statement; int i = 1; int progress = 0; for (Refuel refuelList1 : refuelList) { progress = (i / refuelList.size()) * 100; String sql = "INSERT INTO refuel (id_tank, time, fuel_volume, " +