connecting to a file-based derby database

前端 未结 4 463
野趣味
野趣味 2020-12-17 01:03

I want to work with a file-based database using apache derby. I was wondering if anyone can carify how to connect & create this database using netbeans as an IDE. I pass

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 01:34

    In case you want to have a file based database in Derby , you should download , Derby

    Unzip the file. Run startNetworkServer.bat inside bin directory. It will start derby server which will listen to port no 1527 .

    Now in your java code :

    DriverName= org.apache.derby.jdbc.ClientDriver

    ConnectionString =jdbc:derby://localhost:1527/schema_name;create=true

    Morover,you can also query the derby DB like we do in oracle.

    run ij.bat located inside bin directory. then on the prompt :

    connect 'specify connection url here'

    and you can fire the sql queries like the oracle prompt.

    In case you want to run derby server on different port , execute the following command at cmd :

    startnetworkserver.bat -p 1234

提交回复
热议问题