Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Guesuper Guesuper is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 408
Rep Power: 14
Guesuper mempunyai hidup yang Normal
Default [ASK]JavaDB/Apache Derby question

alo agan2, dsini ad yg perna pake javaDB/ derby gak buad database?

gw mo nanya ttg Derby Network Server neh hehehe

http://db.apache.org/derby/



critanya gw lg bikin 1 desktop application dgn database derby, pake IDE netbeans

nah biasanya kan gw sblm konek ke database, kudu nyalain servicenya Derby Network Server scara manual di netbeans (Service -> JavaDB -> Start Server)



cuma gw mo nyalain Derby Network Servernya di application gw lsg, ini code yg gw pake buad jalanin derby server:


Quote:





NetworkServerControl server = new NetworkServerControl(InetAddress.getByName("localh ost"), 1527);

server.start(null);





ini yg buad ngambil connection


Quote:





private static String dbURL = "jdbc:derby://localhost:1527/Insurance";

.. //code laen

.. //code laen

conn = DriverManager.getConnection(dbURL, props);





singkatnya, pas gw jalanin application gw, Derby Network Servernya seh nyala & connectionnya pun dapet (uda gw tes print connection object nya), tapi tabel2 data di application gw kosong melompong



gw juga ada nyoba jalanin Derby Network Server di cmd pake command ini


Quote:





java org.apache.derby.drda.NetworkServerControl start





hasilnya sama kyk yg diatas, Derby Network Server nyala & dapet connection tp tabel2 di application gw tetep kosong



itu kira2 permasalahannya dimana ya agan2?

kesimpulannya, nge-start up serverny pake 3 cara (1. manual; 2.lwat code di aplikasi; 3.lwat cmd), sama2 nyala servernya, tp bedanya klo pake cara 1 gk ada masalah, klo pake cara laen tabel2ny kosong melompong



UPDATE:

schema database gw namanya abyss888

nah pas gw connect ke server lwat code java, trus gw coba akses database lwat program gw, dapet error :


Quote:





org.apache.derby.client.am.SqlException: Schema 'ABYSS888' does not exist





klo dr feeling gw, bedanya nyalain server derby lwat 'service' di netbeans ama lwat code di program gw, database path file yg direfer ama programnya beda



mohon bantuanny agan2 heheheh



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 05:29 AM.


no new posts