정용환 | 29 Jul 07:03 2014
Picon

Hellow, I have some problem in customize security policy with derby (modified)


Hellow, I am derby user in korea.



I have a problem while I try to replication.



I success to replication with embeded mode.

and replication with server mode with no security manager.



but replication not work with  server mode with security manager.



manual said

"If you want to perform replication with the security manager enabled, you must modify
 the security policy file on both the master and slave systems to allow the master-slave
network connection."



so I try to modify security policy file

follow with "Customizing the Network Server's security policy" section

but when I start server with

C:\Apache\db-derby-10.8.2.2-bin-slave\bin\startNetworkServer.bat -h 192.168.0.10 -p 1530

and following is part of startNetworkServer.bat

"%_JAVACMD%" -Djava.security.manager -Djava.security.policy=C:\Apache\db-derby-10.8.2.2-bin-slave\lib %DERBY_OPTS% -classpath "%LOCALCLASSPATH%" org.apache.derby.drda.NetworkServerControl start %DERBY_CMD_LINE_ARGS%

cmd log
"Thread[main,5,main] java.security.AccessControlException : access denied (java.io.FilePermission derby.log read)"

then server start
but when I connect db
, error messege show
"data volume is not enough , expected minimum volume is 6 byte but
received volume is obyte. connect is end."

please give me hint or solution to solve that problem.

OS is window 7


Thank you.

정용환 | 29 Jul 04:49 2014
Picon

Hellow, I have some problem in customize security policy with derby

Hellow, I am derby user in korea.

I have a problem while I try to replication.

I success to replication with embeded mode.
and replication with server mode with no security manager.

but replication not work with  server mode with security manager.

manual said
"If you want to perform replication with the security manager enabled, you must modify
the security policy file on both the master and slave systems to allow the master-slave
network connection."

so I try to modify security policy file
follow with "Customizing the Network Server's security policy" section

but it is not work. with deny access derby.log (File.io. exception)


thank you.
Michael McCollough | 28 Jul 17:53 2014

CONCUR_UPDATABLE set but not allowing WHERE cause with simple field = value

I have a program that scans a directory and all subdirectories, generating a SHA1_HASH for the first 16K of each file.
After that finishes, I get all duplicate candidates by querying derby for:
select coun(*), precheck_sha1_hash, file_size from derbydb where (not preshceck_sha1_hash is null and not precheck_sha1_hash = '') group by precheck_sha1_hash, file_size having count(*) > 1

I then use ThreadPoolExecutor (10 threads) but am currently doing non-threaded with same result:
new ReportUtility(db, miniHash, fileSize)

Files with the same 16K hash and file size are duplicate candidates so I will generate full hashes for these files to compare them.

Problem is, when I use a where clause in the rs query, I cannot update. It will work fine if I remove there where clause (I have tried with both where parameters and only one): (_db is the db passed to the contructor above)
PreparedStatement stmt = _db.prepareStatement("select sha1_hash, file_path from derbydb where precheck_sha1_hash = '" + _miniHash + "' and file_size = '"+ _fileSize + "', ResultSet.CONCUR_UPDATEABLE);

ResultSet rs = stmt.executeQuery();

while(rs.next()) {
   File file = new File(rs.getString("file_path");
   String hash = generateHash(file);
   rs.updateString("sha1_hash", hash);  // Exception thrown here when my resultset contains a where clause
  rs.updateRow();
}

rs.close();


I am using 10.5.1.1_201105231903 of Derby at the moment. I know you cannot have updatable resultsets with group by, etc but this should be supported I would think. I hope I am doing something dumb here. (for the purist critics, yes, I will turn it into a parameterized PreparedStatement), just trying to simplify into pseudocode vs. retying whole thing.

Thanks in advance
Michael

vasilis papadinas | 24 Jul 23:02 2014
Picon

Prefabricated database with specific properties and hidden structure.‏

How can I make a derby data base for only two types of users, (user1 and user2). 

User1 has the power only to modify the data base structure (create – delete tables) and nothing else. This user must no has access in data of the data base. No one else except user1 must not see any information of the structure of the database and any derby.properties file. 

User2 he has the power to work only with the data into data base (read, write, delete data rows inside the tables), but he has no any access in structure of the data base. 

Each user must he has the own key entry.

These two keys must store with cryptography in side of derby database. 

The database will be distributed with those properties and each holder will always user2. 

Along with the database, extra will be given and a ready set of sql queries, ready to run. So user2 can write java programs linked to this database and perform the given sql queries. 

The user2 should be able to change its own key.

 

spykee | 21 Jul 21:21 2014
Picon

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")

Hi folks,

I have a problem and I hope someone can help me.

-  I added a specific jar file in derby, and every time I execute a stored
procedure from that jar I encounter:
-- java.security.AccessControlException: access denied
("java.lang.RuntimePermission" "getClassLoader")

* I searched on internet a solution for this, and the problem reside in the
security policy.
* I don't want to use as an argument a specific security politicy
(-D...=myPolicy) while starting derby (network server).
* I searched my Java policy ( C:\Program Files\Java\jre8\lib\security ) and
I added the followings(java.policy file):

grant codeBase "file://C:/Program Files/Java/jdk1.8.0/db/lib/derby.jar"
{
  permission java.lang.RuntimePermission "createClassLoader";
  permission java.util.PropertyPermission "derby.*", "read";
  permission java.lang.RuntimePermission "getClassLoader";
  permission java.util.PropertyPermission "user.dir", "read";
  permission java.lang.RuntimePermission "setContextClassLoader";
permission java.util.PropertyPermission "derby.*", "read";
  permission java.util.PropertyPermission "derby.storage.jvmInstanceId",
"write";
permission java.io.FilePermission"C:/Users/myUser/.netbeans-derby",
"read,write,delete";
  permission java.io.FilePermission"C:/Users/myUser/.netbeans-derby{/}-",
"read,write,delete";
};

I tried to use the Linux separator (/), the windows one(\) for the file
path... same errors on my Netbeans. I start/stop Apache Derby from Netbeans.

Can someone give me a hint  ?

Cheers,
George

--
View this message in context: http://apache-database.10148.n7.nabble.com/java-security-AccessControlException-access-denied-java-lang-RuntimePermission-getClassLoader-tp140900.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Sekhar Kosuru | 19 Jul 13:43 2014
Picon

Database hanging after Heap space error

Hi,

We are using Derby for our application, we are running derby as service. In our applications when we found any error with Derby, we will check service is running or not. If we found service down we will start the service.

But in some places we are getting heap space error in database log files. after that we are unable to start the Derby. It is not issuing any connection.

DriverManager.getConnection() is hanging.

Please help us to solve the same.

Regards
Sekhar
china_wang | 26 Jun 08:08 2014

You cannot invoke other java.sql.Clob/java.sql.Blob methods

Dear All,

      I have a problem that i can't get Clob  when i use
spring3.0.5+ibatis2.3.0+derby10.10.0.1 ,
my code snippets :

<select id="PUB-DATASETS" resultClass="java.util.HashMap"
parameterClass="map" remapResults="true">
		
        select $columns$ from pub_datasets where 1=1
        <dynamic prepend="and">
				<isNotEmpty property="dataSoursIds">     				  
     				 DATASOURCE_ID in ($dataSoursIds$) 
				</isNotEmpty>				
		</dynamic>             
        <dynamic prepend="and">
				<isNotEmpty property="dataSetIds">     				  
     				 DATASET_ID in ($dataSetIds$)
				</isNotEmpty>				
		</dynamic>
</select>

ArrayList<Map&lt;String, Object>> list =new
ArrayList<Map&lt;String,Object>>();	
list =(ArrayList)
datasetDAO.findAll("MS-PUB-DATASETS-SELECT-ALL-BY-ADMIN",params);

for(Map<String, Object> map:list)
{
	if(map.get("TEMPLATE")!=null)
	{
	  System.out.println(((Clob)map.get("TEMPLATE")).length());
	}
}

"((Clob)map.get("TEMPLATE")).length() " will throw exception.....

 sorry my english level is poor...

Thanks for every help. 

wang

--
View this message in context: http://apache-database.10148.n7.nabble.com/You-cannot-invoke-other-java-sql-Clob-java-sql-Blob-methods-tp140391.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Kempff, Malte | 24 Jun 17:45 2014

AW: Problems with import of CSV to Table

I found my problem now, it was a not existing file for input, I had overseen in the error report.

FEHLER XIE04: Nicht gefundene Datendatei: memorecords.dat

 

But I have also another question. When I tried to give nulls in the import export statement using the procedures, ij gave me an syntax error.

What do I need to do that ij accepts my null-values for using the defaults?

 

Thanks for hints

 

Malte

 

Von: Kempff, Malte
Gesendet: Dienstag, 24. Juni 2014 17:21
An: Derby Discussion (derby-user-PvNy6fhA98DNLxjTenLetw@public.gmane.org)
Betreff: Problems with import of CSV to Table

 

Hi,

I have this Table

ij(DB_8_2)> describe memo_records;

COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&

------------------------------------------------------------------------------

RECORD_ID           |VARCHAR  |NULL|NULL|512   |NULL      |1024      |NO

INPUTFILE_ID        |INTEGER  |0   |10  |10    |NULL      |NULL      |YES

TMPST_IN            |TIMESTAMP|9   |10  |29    |CURRENT_T&|NULL      |NO

TMPST_USED          |TIMESTAMP|9   |10  |29    |NULL      |NULL      |YES

STATE               |CHAR     |NULL|NULL|1     |'I'       |2         |NO

 

And I have this CSV-Structure for importing it.

"174145"|1382|"2014-03-28 05:09:44.441"||"I"                            

"174146"|1382|"2014-03-28 05:09:44.558"||"I"                             

"174147"|1382|"2014-03-28 05:09:44.585"||"I"                            

"174507"|1424|"2014-04-07 05:09:56.649"|"2014-04-10 18:11:45.388"|"U"   

"174508"|1424|"2014-04-07 05:09:56.738"||"I"

I am getting this Error in ij:

FEHLER 38000: Bei der Auswertung eines Ausdrucks wurde die Ausnahme 'java.sql.SQLException: Bei der Auswertung eines Ausdrucks wurde die Ausnahme 'java.lang.reflect.InvocationTargetException' ausgel÷st.' ausgel÷st.

FEHLER 38000: Bei der Auswertung eines Ausdrucks wurde die Ausnahme 'java.lang.reflect.InvocationTargetException' ausgel÷st.

 

Well actually I cannot find the problem, I suspect that it might be the date.

But shouldn’t an export produce csv correctly for the import?

 

Here is the Statement for export:

call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select RECORD_ID                   

                                          ,INPUTFILE_ID                

                                          ,TMPST_IN                    

                                          ,TMPST_USED                  

                                          ,STATE                       

                                    from memo_records ',               

                                   'memorecords.dat', '|', '"', 'utf8');

And here is my statement for import:

call syscs_util.syscs_import_table ('APP', 'MEMO_RECORDS', 'memorecords.dat', '|', '"', 'utf8',0);

 

I am using right now 10.8.2 needing to migrate down to 10.1.1.0 (crazy, isn’t it?).

Got somebody an idea what I could do here to solve the problem?

 

Thanks a lot in advance

 

Malte

 

------------------------------------------------------------------------------------------------ Disclaimer: The contents of this electronic mail message are only binding upon Equens or its affiliates, if the contents of the message are accompanied by a lawfully recognised type of signature. The contents of this electronic mail message are privileged and confidential and are intended only for use by the addressee. If you have received this electronic mail message by error, please notify the sender and delete the message without taking notices of its content, reproducing it and using it in any way. ------------------------------------------------------------------------------------------------
Kempff, Malte | 24 Jun 17:21 2014

Problems with import of CSV to Table

Hi,

I have this Table

ij(DB_8_2)> describe memo_records;

COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&

------------------------------------------------------------------------------

RECORD_ID           |VARCHAR  |NULL|NULL|512   |NULL      |1024      |NO

INPUTFILE_ID        |INTEGER  |0   |10  |10    |NULL      |NULL      |YES

TMPST_IN            |TIMESTAMP|9   |10  |29    |CURRENT_T&|NULL      |NO

TMPST_USED          |TIMESTAMP|9   |10  |29    |NULL      |NULL      |YES

STATE               |CHAR     |NULL|NULL|1     |'I'       |2         |NO

 

And I have this CSV-Structure for importing it.

"174145"|1382|"2014-03-28 05:09:44.441"||"I"                            

"174146"|1382|"2014-03-28 05:09:44.558"||"I"                             

"174147"|1382|"2014-03-28 05:09:44.585"||"I"                            

"174507"|1424|"2014-04-07 05:09:56.649"|"2014-04-10 18:11:45.388"|"U"   

"174508"|1424|"2014-04-07 05:09:56.738"||"I"

I am getting this Error in ij:

FEHLER 38000: Bei der Auswertung eines Ausdrucks wurde die Ausnahme 'java.sql.SQLException: Bei der Auswertung eines Ausdrucks wurde die Ausnahme 'java.lang.reflect.InvocationTargetException' ausgel÷st.' ausgel÷st.

FEHLER 38000: Bei der Auswertung eines Ausdrucks wurde die Ausnahme 'java.lang.reflect.InvocationTargetException' ausgel÷st.

 

Well actually I cannot find the problem, I suspect that it might be the date.

But shouldn’t an export produce csv correctly for the import?

 

Here is the Statement for export:

call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select RECORD_ID                   

                                          ,INPUTFILE_ID                

                                          ,TMPST_IN                    

                                          ,TMPST_USED                  

                                          ,STATE                       

                                    from memo_records ',               

                                   'memorecords.dat', '|', '"', 'utf8');

And here is my statement for import:

call syscs_util.syscs_import_table ('APP', 'MEMO_RECORDS', 'memorecords.dat', '|', '"', 'utf8',0);

 

I am using right now 10.8.2 needing to migrate down to 10.1.1.0 (crazy, isn’t it?).

Got somebody an idea what I could do here to solve the problem?

 

Thanks a lot in advance

 

Malte

 

------------------------------------------------------------------------------------------------ Disclaimer: The contents of this electronic mail message are only binding upon Equens or its affiliates, if the contents of the message are accompanied by a lawfully recognised type of signature. The contents of this electronic mail message are privileged and confidential and are intended only for use by the addressee. If you have received this electronic mail message by error, please notify the sender and delete the message without taking notices of its content, reproducing it and using it in any way. ------------------------------------------------------------------------------------------------
Myrna van Lunteren | 11 Jun 17:39 2014
Picon

ApacheCon CFP closes June 25


Dear Apache DDLUtils, Torque, JDO and Derby enthusiasts,

As you may be aware, ApacheCon will be held this year in Budapest, on
November 17-23. (See http://apachecon.eu for more info.)

The Call For Papers for that conference is still open, but will be
closing soon. We need you talk proposals, to represent the DB project at
ApacheCon. We need all kinds of talks - deep technical talks, hands-on
tutorials, introductions for beginners, or case studies about the
awesome stuff you're doing with DDLUtils, Torque, JDO and Derby.

Please consider submitting a proposal, at
http://events.linuxfoundation.org//events/apachecon-europe/program/cfp

Thanks!

Myrna van Lunteren
DB Project chair
Tim Dudgeon | 11 Jun 11:40 2014

trigger with cascade delete problem

I've encountered a tricky problem that I can't see a solution to at 
present. Let me describe.

I have 3 tables:
MAIN - the main data table with results in.
GROUPING - a table that is related to MAIN, with MAIM having a FK 
constraint to GROUPING
AGGREGATES - a table that contains aggregated information from MAIN, in 
part grouped by the info in GROUPING.

I'm filling the data in AGGREGATES using triggers on MAIN that firstly 
delete the old aggregate value and then inserts a new aggregate (e.g. 2 
after insert/update/delete "for each statement" triggers).

Mostly its working. When I delete a row in MAIN the row in AGGREGATES 
gets deleted and then inserted again with the new aggregate.
But when I delete a row from GROUPING and the cascade delete causes the 
corresponding rows in MAIN to be deleted it does not work.
I'm pretty sure this is because part of the selection criteria for the 
rows to delete involves a join to GROUPING, and the rows to join to have 
just been blown away by the delete operation, so nothing in AGGREGATES 
gets deleted.

Is there solution to this?

Tim


Gmane