Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Recensione HUAWEI Mate X7: un foldable ottimo, ma restano i soliti problemi
Recensione HUAWEI Mate X7: un foldable ottimo, ma restano i soliti problemi
Mate X7 rinnova la sfida nel segmento dei pieghevoli premium puntando su un design ancora più sottile e resistente, unito al ritorno dei processori proprietari della serie Kirin. L'assenza dei servizi Google e del 5G pesa ancora sull'esperienza utente, ma il comparto fotografico e la qualità costruttiva cercano di compensare queste mancanze strutturali con soluzioni ingegneristiche di altissimo livello
Nioh 3: souls-like punitivo e Action RPG
Nioh 3: souls-like punitivo e Action RPG
Nioh 3 aggiorna la formula Team NINJA con aree esplorabili più grandi, due stili di combattimento intercambiabili al volo (Samurai e Ninja) e un sistema di progressione pieno di attività, basi nemiche e sfide legate al Crogiolo. La recensione entra nel dettaglio su combattimento, build, progressione e requisiti PC
Test in super anteprima di Navimow i220 LiDAR: il robot tagliaerba per tutti
Test in super anteprima di Navimow i220 LiDAR: il robot tagliaerba per tutti
La facilità di installazione e la completa automazione di tutte le fasi di utilizzo, rendono questo prodotto l'ideale per molti clienti. Ecco com'è andata la nostra prova in anteprima
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 08-11-2009, 20:29   #1
elect
Senior Member
 
L'Avatar di elect
 
Iscritto dal: Dec 2003
Città: Hamburg/Torino
Messaggi: 2757
[JAVA] Non si connette al database

Come da titolo. Quello che devo fare è questo:

First, you have to create an ANT build.xml file. Write two ANT tasks: One for starting the
database server and another one for stopping it. Later in the course, you will use these ANT
tasks to start and stop the database server for the web application.
Your task is to write two SQL-scripts. One in order to create the database structure with its
tables and relations. And another one which fills your newly created tables with test data.
Create an ANT task for each SQL-script, which executes that script.


Questo è il mio build.xml:

Codice:
<?xml version="1.0" encoding="UTF-8"?>

<project name="FirstLab">
	<path id="derby.classpath">
		<fileset dir="lib">
			<include name="**/*.jar" />
		</fileset>
	</path>

	<target name="server_start">
		<java classname="org.apache.derby.drda.NetworkServerControl" classpathref="derby.classpath" fork="true">
			<arg value="start" />
		</java>
	</target>
	
	<target name="server_stop">
		<java classname="org.apache.derby.drda.NetworkServerControl" classpathref="derby.classpath" fork="true">
			<arg value="shutdown" />
		</java>
	</target>
	
	<target name="test">
		<property name="DBURL" value="jdbc:derby:test" />
		<property name="DRIVER" value="lib/org.apache.derby.jdbc.EmbeddedDriver" />
		<property name="USERID" value="" />
		<property name="PASSWORD" value="" />
		<property name="USERS" value="users" />
		<property name="IMAGES" value="images" />
		<property name="COMMENTS" value="comments" />
		<property name="FRIENDSHIP" value="friendship" />
		<sql driver="${DRIVER}" url="${DBURL}" userid="${USERID}" password="${PASSWORD}" autocommit="yes" onerror="continue" caching="yes">
		      DROP TABLE USERS;
		 	  DROP TABLE IMAGES;
		 	  DROP TABLE COMMENTS;
		 	  DROP TABLE FRIENDSHIP;
		      CREATE TABLE USERS (userid int not null generated always as 
		      identity (start with 1, increment by 1), username char(255) not null, 
		      password char(255), firstname char(255) not null, lastname char(255) not null, city char(255),
		 	country char(255), text char(255), birthdate DATE not null, photofilename char(255), UNIQUE (username) );
		 	CREATE TABLE IMAGES (imageid int not null generated always as 
		      identity (start with 1, increment by 1), userid int not null, filename char(255) not null, insertdate timestamp not null,
		 	CONSTRAINT userid_fk FOREIGN KEY(userid) REFERENCES USERS(userid) ON DELETE CASCADE);
		 	CREATE TABLE COMMENTS (commentid int not null generated always as 
		      identity (start with 1, increment by 1) PRIMARY KEY, fromuserid int, touserid int,
		 	insertdate TIMESTAMP, text char(255),
		 	CONSTRAINT fromuserid_fk FOREIGN KEY (fromuserid) REFERENCES USERS(userid) ON DELETE CASCADE,
		 	CONSTRAINT touserid_fk FOREIGN KEY (touserid) REFERENCES USERS(userid) ON DELETE CASCADE);
		 	CREATE TABLE FRIENDSHIP (fromuserid int, touserid int, state int, CONSTRAINT
		 	fromuserid_fk FOREIGN KEY (fromuserid) REFERENCES USERS(userid) ON DELETE CASCADE,
		 	CONSTRAINT touserid_fk FOREIGN KEY (touserid) REFERENCES USERS(userid) ON DELETE CASCADE);
		    </sql>
	</target> 
	
</project>
Runnando solo lo start o lo stop_server vedo che tutto fila liscio, ma quando lancio il test mi restituisce questo:


Codice:
Buildfile: C:\Documents and Settings\elect\workspace\FirstLab\build.xml
test:

BUILD FAILED
C:\Documents and Settings\elect\workspace\FirstLab\build.xml:31: Class Not Found: JDBC driver lib/org.apache.derby.jdbc.EmbeddedDriver could not be loaded

Total time: 986 milliseconds
Ho googlato un pò, ma non ho trovato niente che facesse al caso mio.. ^^

Ho la strana sensazione che la soluzione sia molto semplice e veloce, ma non c'arrivo @.@, voi avete qualche idea?
elect è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Recensione HUAWEI Mate X7: un foldable ottimo, ma restano i soliti problemi Recensione HUAWEI Mate X7: un foldable ottimo, m...
Nioh 3: souls-like punitivo e Action RPG Nioh 3: souls-like punitivo e Action RPG
Test in super anteprima di Navimow i220 LiDAR: il robot tagliaerba per tutti Test in super anteprima di Navimow i220 LiDAR: i...
Dark Perk Ergo e Sym provati tra wireless, software via browser e peso ridotto Dark Perk Ergo e Sym provati tra wireless, softw...
DJI RS 5: stabilizzazione e tracking intelligente per ogni videomaker DJI RS 5: stabilizzazione e tracking intelligent...
I produttori non faranno sconti sulle me...
Ubisoft potrebbe cedere pezzi se il pian...
Qualcomm potrebbe utilizzare una tecnolo...
Starfield per Nintendo Switch 2 potrebbe...
Un MacBook Pro a -300€, i MacBook Air M4...
Amazon abbassa i prezzi sugli iPhone: sc...
Amazon, ancora sconti sugli smartphone A...
iPhone Air 2 'riciclerà' alcuni c...
Offerta Amazon da non perdere: lo speake...
Nioh 3 debutta alla grande su Steam: pri...
Al centro della Via Lattea ci potrebbe e...
Elon Musk ora guarda alla Luna: SpaceX p...
La Cina ha lanciato nuovamente lo spazio...
Blue Origin potrebbe realizzare il lande...
Artemis II: il prossimo Wet Dress Rehear...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 15:27.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v