Visual Studio Code JDBC Acess to Derby Database












1















I am trying to run a java program (demo program included in the Apache Derby installation folder called SimpleApp) that connects to a Derby database using JDBC, in Visual Studio Code (with an integrated terminal), but I keep getting the same error message:



>java SimpleApp

SimpleApp starting in embedded mode
----- SQLException -----
SQL State: 08001
Error Code: 0
Message: No suitable driver found for jdbc:derby:derbyDB;create=true
SimpleApp finished


I ran the SimpleApp java file in the command prompt and it worked just fine:



>java SimpleApp

SimpleApp starting in embedded mode
Connected to and created database derbyDB
Created table location
Inserted 1956 Webster
Inserted 1910 Union
Updated 1956 Webster to 180 Grand
Updated 180 Grand to 300 Lakeshore
Verified the rows
Dropped table location
Committed the transaction
Derby shut down normally
SimpleApp finished




I am using the following:




  • Windows 10 OS

  • Visual Studio Code 1.29

  • JDK 11.0.1

  • Apache Derby 10.14.2.0


  • Code Runner (vs code extension)


I have the following settings:




  • JDK path in VS Code:
    "java.home": "C:\Program Files\Java\jdk-11.0.1"

  • JAVA_HOME system variable:
    C:Program FilesJavajdk-11.0.1

  • DERBY_HOME system variable:
    C:Program FilesApachedb-derby-10.14.2.0-bin

  • CLASSPATH system variable:
    .;%JAVA_HOME%lib;%DERBY_HOME%libderby.jar;%DERBY_HOME%libderbytools.jar;

  • In the Path system variable:
    %JAVA_HOME%bin and %DERBY_HOME%bin




Some notes from the SimpleApp java file:




This sample program is a minimal Java application showing JDBC access
to a Derby database. Derby applications can run against Derby running
in an embedded or a client/server framework. When Derby runs in an
embedded framework, the JDBC application and Derby run in the same
Java Virtual Machine (JVM). The application starts up the Derby
engine. When Derby runs in a client/server framework, the application
runs in a different JVM from Derby. The connectivity framework (in
this case the Derby Network Server) provides network connections. The
client driver is loaded automatically.











share|improve this question























  • I guess that you will need to set your classpath within Visual Studio

    – Scary Wombat
    Nov 13 '18 at 7:50











  • Most ways of executing Java applications do not use the CLASSPATH environment variable; don't rely on it and instead configure the classpath specifically for the application.

    – Mark Rotteveel
    Nov 13 '18 at 10:27













  • Try printing out the value of CLASSPATH from within your program, before you attempt to open the JDBC connection, and see what value your program is actually getting.

    – Bryan Pendleton
    Nov 13 '18 at 14:09






  • 1





    Honestly, I don't know what I did but now it works... @BryanPendleton I tried printing out the classpath by copying and pasting the code from this website and an error printed out. I wasn't sure what to do so I merely went back to my original code and tried to connect to the database. It somehow worked. I then ran the SimpleApp code and that also worked... I have no idea why. Thanks guys.

    – Chad Weaver
    Nov 14 '18 at 0:54











  • Perhaps you are using a client/server configuration of Derby, and your Derby Network Server is sometimes down, and sometimes up?

    – Bryan Pendleton
    Nov 14 '18 at 14:03
















1















I am trying to run a java program (demo program included in the Apache Derby installation folder called SimpleApp) that connects to a Derby database using JDBC, in Visual Studio Code (with an integrated terminal), but I keep getting the same error message:



>java SimpleApp

SimpleApp starting in embedded mode
----- SQLException -----
SQL State: 08001
Error Code: 0
Message: No suitable driver found for jdbc:derby:derbyDB;create=true
SimpleApp finished


I ran the SimpleApp java file in the command prompt and it worked just fine:



>java SimpleApp

SimpleApp starting in embedded mode
Connected to and created database derbyDB
Created table location
Inserted 1956 Webster
Inserted 1910 Union
Updated 1956 Webster to 180 Grand
Updated 180 Grand to 300 Lakeshore
Verified the rows
Dropped table location
Committed the transaction
Derby shut down normally
SimpleApp finished




I am using the following:




  • Windows 10 OS

  • Visual Studio Code 1.29

  • JDK 11.0.1

  • Apache Derby 10.14.2.0


  • Code Runner (vs code extension)


I have the following settings:




  • JDK path in VS Code:
    "java.home": "C:\Program Files\Java\jdk-11.0.1"

  • JAVA_HOME system variable:
    C:Program FilesJavajdk-11.0.1

  • DERBY_HOME system variable:
    C:Program FilesApachedb-derby-10.14.2.0-bin

  • CLASSPATH system variable:
    .;%JAVA_HOME%lib;%DERBY_HOME%libderby.jar;%DERBY_HOME%libderbytools.jar;

  • In the Path system variable:
    %JAVA_HOME%bin and %DERBY_HOME%bin




Some notes from the SimpleApp java file:




This sample program is a minimal Java application showing JDBC access
to a Derby database. Derby applications can run against Derby running
in an embedded or a client/server framework. When Derby runs in an
embedded framework, the JDBC application and Derby run in the same
Java Virtual Machine (JVM). The application starts up the Derby
engine. When Derby runs in a client/server framework, the application
runs in a different JVM from Derby. The connectivity framework (in
this case the Derby Network Server) provides network connections. The
client driver is loaded automatically.











share|improve this question























  • I guess that you will need to set your classpath within Visual Studio

    – Scary Wombat
    Nov 13 '18 at 7:50











  • Most ways of executing Java applications do not use the CLASSPATH environment variable; don't rely on it and instead configure the classpath specifically for the application.

    – Mark Rotteveel
    Nov 13 '18 at 10:27













  • Try printing out the value of CLASSPATH from within your program, before you attempt to open the JDBC connection, and see what value your program is actually getting.

    – Bryan Pendleton
    Nov 13 '18 at 14:09






  • 1





    Honestly, I don't know what I did but now it works... @BryanPendleton I tried printing out the classpath by copying and pasting the code from this website and an error printed out. I wasn't sure what to do so I merely went back to my original code and tried to connect to the database. It somehow worked. I then ran the SimpleApp code and that also worked... I have no idea why. Thanks guys.

    – Chad Weaver
    Nov 14 '18 at 0:54











  • Perhaps you are using a client/server configuration of Derby, and your Derby Network Server is sometimes down, and sometimes up?

    – Bryan Pendleton
    Nov 14 '18 at 14:03














1












1








1








I am trying to run a java program (demo program included in the Apache Derby installation folder called SimpleApp) that connects to a Derby database using JDBC, in Visual Studio Code (with an integrated terminal), but I keep getting the same error message:



>java SimpleApp

SimpleApp starting in embedded mode
----- SQLException -----
SQL State: 08001
Error Code: 0
Message: No suitable driver found for jdbc:derby:derbyDB;create=true
SimpleApp finished


I ran the SimpleApp java file in the command prompt and it worked just fine:



>java SimpleApp

SimpleApp starting in embedded mode
Connected to and created database derbyDB
Created table location
Inserted 1956 Webster
Inserted 1910 Union
Updated 1956 Webster to 180 Grand
Updated 180 Grand to 300 Lakeshore
Verified the rows
Dropped table location
Committed the transaction
Derby shut down normally
SimpleApp finished




I am using the following:




  • Windows 10 OS

  • Visual Studio Code 1.29

  • JDK 11.0.1

  • Apache Derby 10.14.2.0


  • Code Runner (vs code extension)


I have the following settings:




  • JDK path in VS Code:
    "java.home": "C:\Program Files\Java\jdk-11.0.1"

  • JAVA_HOME system variable:
    C:Program FilesJavajdk-11.0.1

  • DERBY_HOME system variable:
    C:Program FilesApachedb-derby-10.14.2.0-bin

  • CLASSPATH system variable:
    .;%JAVA_HOME%lib;%DERBY_HOME%libderby.jar;%DERBY_HOME%libderbytools.jar;

  • In the Path system variable:
    %JAVA_HOME%bin and %DERBY_HOME%bin




Some notes from the SimpleApp java file:




This sample program is a minimal Java application showing JDBC access
to a Derby database. Derby applications can run against Derby running
in an embedded or a client/server framework. When Derby runs in an
embedded framework, the JDBC application and Derby run in the same
Java Virtual Machine (JVM). The application starts up the Derby
engine. When Derby runs in a client/server framework, the application
runs in a different JVM from Derby. The connectivity framework (in
this case the Derby Network Server) provides network connections. The
client driver is loaded automatically.











share|improve this question














I am trying to run a java program (demo program included in the Apache Derby installation folder called SimpleApp) that connects to a Derby database using JDBC, in Visual Studio Code (with an integrated terminal), but I keep getting the same error message:



>java SimpleApp

SimpleApp starting in embedded mode
----- SQLException -----
SQL State: 08001
Error Code: 0
Message: No suitable driver found for jdbc:derby:derbyDB;create=true
SimpleApp finished


I ran the SimpleApp java file in the command prompt and it worked just fine:



>java SimpleApp

SimpleApp starting in embedded mode
Connected to and created database derbyDB
Created table location
Inserted 1956 Webster
Inserted 1910 Union
Updated 1956 Webster to 180 Grand
Updated 180 Grand to 300 Lakeshore
Verified the rows
Dropped table location
Committed the transaction
Derby shut down normally
SimpleApp finished




I am using the following:




  • Windows 10 OS

  • Visual Studio Code 1.29

  • JDK 11.0.1

  • Apache Derby 10.14.2.0


  • Code Runner (vs code extension)


I have the following settings:




  • JDK path in VS Code:
    "java.home": "C:\Program Files\Java\jdk-11.0.1"

  • JAVA_HOME system variable:
    C:Program FilesJavajdk-11.0.1

  • DERBY_HOME system variable:
    C:Program FilesApachedb-derby-10.14.2.0-bin

  • CLASSPATH system variable:
    .;%JAVA_HOME%lib;%DERBY_HOME%libderby.jar;%DERBY_HOME%libderbytools.jar;

  • In the Path system variable:
    %JAVA_HOME%bin and %DERBY_HOME%bin




Some notes from the SimpleApp java file:




This sample program is a minimal Java application showing JDBC access
to a Derby database. Derby applications can run against Derby running
in an embedded or a client/server framework. When Derby runs in an
embedded framework, the JDBC application and Derby run in the same
Java Virtual Machine (JVM). The application starts up the Derby
engine. When Derby runs in a client/server framework, the application
runs in a different JVM from Derby. The connectivity framework (in
this case the Derby Network Server) provides network connections. The
client driver is loaded automatically.








java jdbc visual-studio-code derby






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 '18 at 7:48









Chad WeaverChad Weaver

64




64













  • I guess that you will need to set your classpath within Visual Studio

    – Scary Wombat
    Nov 13 '18 at 7:50











  • Most ways of executing Java applications do not use the CLASSPATH environment variable; don't rely on it and instead configure the classpath specifically for the application.

    – Mark Rotteveel
    Nov 13 '18 at 10:27













  • Try printing out the value of CLASSPATH from within your program, before you attempt to open the JDBC connection, and see what value your program is actually getting.

    – Bryan Pendleton
    Nov 13 '18 at 14:09






  • 1





    Honestly, I don't know what I did but now it works... @BryanPendleton I tried printing out the classpath by copying and pasting the code from this website and an error printed out. I wasn't sure what to do so I merely went back to my original code and tried to connect to the database. It somehow worked. I then ran the SimpleApp code and that also worked... I have no idea why. Thanks guys.

    – Chad Weaver
    Nov 14 '18 at 0:54











  • Perhaps you are using a client/server configuration of Derby, and your Derby Network Server is sometimes down, and sometimes up?

    – Bryan Pendleton
    Nov 14 '18 at 14:03



















  • I guess that you will need to set your classpath within Visual Studio

    – Scary Wombat
    Nov 13 '18 at 7:50











  • Most ways of executing Java applications do not use the CLASSPATH environment variable; don't rely on it and instead configure the classpath specifically for the application.

    – Mark Rotteveel
    Nov 13 '18 at 10:27













  • Try printing out the value of CLASSPATH from within your program, before you attempt to open the JDBC connection, and see what value your program is actually getting.

    – Bryan Pendleton
    Nov 13 '18 at 14:09






  • 1





    Honestly, I don't know what I did but now it works... @BryanPendleton I tried printing out the classpath by copying and pasting the code from this website and an error printed out. I wasn't sure what to do so I merely went back to my original code and tried to connect to the database. It somehow worked. I then ran the SimpleApp code and that also worked... I have no idea why. Thanks guys.

    – Chad Weaver
    Nov 14 '18 at 0:54











  • Perhaps you are using a client/server configuration of Derby, and your Derby Network Server is sometimes down, and sometimes up?

    – Bryan Pendleton
    Nov 14 '18 at 14:03

















I guess that you will need to set your classpath within Visual Studio

– Scary Wombat
Nov 13 '18 at 7:50





I guess that you will need to set your classpath within Visual Studio

– Scary Wombat
Nov 13 '18 at 7:50













Most ways of executing Java applications do not use the CLASSPATH environment variable; don't rely on it and instead configure the classpath specifically for the application.

– Mark Rotteveel
Nov 13 '18 at 10:27







Most ways of executing Java applications do not use the CLASSPATH environment variable; don't rely on it and instead configure the classpath specifically for the application.

– Mark Rotteveel
Nov 13 '18 at 10:27















Try printing out the value of CLASSPATH from within your program, before you attempt to open the JDBC connection, and see what value your program is actually getting.

– Bryan Pendleton
Nov 13 '18 at 14:09





Try printing out the value of CLASSPATH from within your program, before you attempt to open the JDBC connection, and see what value your program is actually getting.

– Bryan Pendleton
Nov 13 '18 at 14:09




1




1





Honestly, I don't know what I did but now it works... @BryanPendleton I tried printing out the classpath by copying and pasting the code from this website and an error printed out. I wasn't sure what to do so I merely went back to my original code and tried to connect to the database. It somehow worked. I then ran the SimpleApp code and that also worked... I have no idea why. Thanks guys.

– Chad Weaver
Nov 14 '18 at 0:54





Honestly, I don't know what I did but now it works... @BryanPendleton I tried printing out the classpath by copying and pasting the code from this website and an error printed out. I wasn't sure what to do so I merely went back to my original code and tried to connect to the database. It somehow worked. I then ran the SimpleApp code and that also worked... I have no idea why. Thanks guys.

– Chad Weaver
Nov 14 '18 at 0:54













Perhaps you are using a client/server configuration of Derby, and your Derby Network Server is sometimes down, and sometimes up?

– Bryan Pendleton
Nov 14 '18 at 14:03





Perhaps you are using a client/server configuration of Derby, and your Derby Network Server is sometimes down, and sometimes up?

– Bryan Pendleton
Nov 14 '18 at 14:03












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276168%2fvisual-studio-code-jdbc-acess-to-derby-database%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276168%2fvisual-studio-code-jdbc-acess-to-derby-database%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

Bicuculline

さくらももこ