derby

Apache Derby DB not working when I close NetBeans IDE

Deadly 提交于 2019-12-13 09:20:56
问题 I am a beginner to Java and Databases. Recently, i have been developing a Java Application where I am using derby database. When I start NetBeans and run the project it works fine. But when I close the IDE and run the .JAR file it does not not work. Can anybody tell me the reason behind it? 回答1: Netbeans is running Apache Derby for you in a networked mode, and your application is connecting to it. When netbeans is not running, then the database is not running either, so it's not available to

In derby should I be using the APP schema or the MYDBNAME schema

冷暖自知 提交于 2019-12-13 07:14:56
问题 Every time I create a derby database there are several schemas including the APP schema and a schema with the same name of the USERNAME. Which schema should i be using, the APP or the USERNAME schema? Why is the APP schema introduced if the USERNAME schema is set as the default schema. Hopefully this is a quick question for a derby pro. :) 回答1: You can use any schema you want. If you don't explicitly specify a schema, Derby picks a default schema for you. http://db.apache.org/derby/docs/10.8

Is there any way to save embbeded apache derby database files in jar

怎甘沉沦 提交于 2019-12-13 06:52:41
问题 In my project when i clicked the jar file it extracts embedded database files to near it self. Is there any way to make them stay in the jar file? 回答1: You can package a read-only Derby database into one of the jar files in your classpath, and access it using a different form of the connection URL. See: http://db.apache.org/derby/docs/10.8/devguide/cdevdvlp24155.html and http://db.apache.org/derby/docs/10.8/devguide/cdevdeploy11201.html#cdevdeploy11201 回答2: Sure it's possible, you can put

Week of year of a timestamp using derby/JavaDB

僤鯓⒐⒋嵵緔 提交于 2019-12-13 05:46:41
问题 I need to know the week of year of a timestamp using Derby/JavaDB. And to make it worse I have to extract it from a parameter not a column. Don't ask why but that should be a minor problem. On DB2 I say someting like VALUES WEEK_ISO(?) But how do I get the same result with Derby aka JavaDB? 回答1: Thanks Bryan, your Link was very helpful. http://therealdanvega.com/blog/2010/02/17/creating-apache-derby-custom-functions-part-2 It seems there is no week function in derby but it is very easy to

Netbeans Error in JavaEE project

北慕城南 提交于 2019-12-13 05:40:54
问题 I created javaEE project on WinXP and now i trying to open it in another PC having Win7 and then i run it i got an error Could not find file C:\Program Files\Sun\JavaDB\lib\derbyclient.jar to copy. BUILD FAILED (total time: 0 seconds) But i havent such directory and javadb located here C:\Program Files\glassfish-3.0.1\javadb How can i fix it? thx 回答1: Are you running it from Netbeans? If yes, are you able to run the program from command prompt? Did you set your classpath correctly? 来源: https:

Embedded Glassfish SQL statement fail

前提是你 提交于 2019-12-13 04:45:06
问题 I develop some unit tests but fail on all SQL statements, can you please look at this log and configuration? Jul 01, 2012 4:33:05 PM org.glassfish.persistence.common.Java2DBProcessorHelper executeDDLs WARNING: PER01000: Got SQLException executing statement "CREATE TABLE CAR (ID BIGINT NOT NULL, BRAND VARCHAR(255) NOT NULL, DESCRIPTION VARCHAR(255), FUEL VARCHAR(255) NOT NU\ LL, GEARBOX VARCHAR(255) NOT NULL, KILOMETRES INTEGER NOT NULL, MODEL VARCHAR(255) NOT NULL, PRICE INTEGER NOT NULL,

Eclipse and derby

这一生的挚爱 提交于 2019-12-13 04:35:19
问题 I've installed derby according to this guide and created database in it's ij console. How can I use this database from eclipse? I've downloaded db-derby-10.10.1.1-bin there isn't any jars there. 回答1: After the installation of derby . Fire up eclipse. Create a java project. Write down any jdbc example program. Assuming that you want to run a client - server based connection and you have setup class path correctly if not follow this link. Start the derby network server using the command java

Isn't it necessary to mention the name of archive in the Resource tag?

女生的网名这么多〃 提交于 2019-12-13 03:54:15
问题 To connect to derby database while using Tomcat , I downloaded the jar of core Apache Derby database engine (version : 10.9.1.0). I kept this jar file under the lib folder in Tomcat. Now I was told to add the following in context.xml of Tomcat . <Resource name="jdbc/PollDatasource" auth="Container" type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver" url="jdbc:derby://localhost:1527/polldatabase;create=true" username="suhail" password="suhail" maxActive="20"

Deploy Java Application with Embedded Derby Database

…衆ロ難τιáo~ 提交于 2019-12-13 02:48:01
问题 Am developing a java desktop application using Netbeans 1.8 IDE, the application will use embedded derby database to store data. The connection to the derby database is by the following. final String host = "jdbc:derby:C:\\Users\\Faisal\\.netbeans- derby\\Wa_Poly"; final String uName = "APP"; final String uPass = "12345"; the following code snippet is used to connect to the database. try (Connection con = DriverManager.getConnection(host, uName, uPass)) { try (Statement pstm = con

Cannot use an EntityTransaction while using JTA (No manual transaction statements)

北城以北 提交于 2019-12-13 02:21:31
问题 I understand this query has been dealt with in other discussions, but I have not mixed @Transactional with a em.getTranstaction.begin() or any other manual transaction statement. (Using glassfish and netbeans 8) Code below: MainDao package com.restaurant.orders; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; import org.springframework.stereotype.Component; import org.springframework.transaction