Amy,

I was just looking through this thread for the first time and found that
in your original post, you asked about saving data from a form into a
Derby database:

> Could someone please provide sample Java code f9or NetBeans to capture data 
> filled out in NB form into a Java derby database?

However, in your most recent post, you included the following:

> This is the Java to SQL connection code in NetBeans 8.2:
>
> con = DriverManager.getConnection("jdbc:mysql://localhost/iamysql-userdata", 
> "root", "");

If you compare your original question to this latest posting of code,
you will see your problem. If you are trying to connect to a Derby
database, you cannot use the MySQL database driver. Likewise, if you are
using the Derby database driver, you cannot connect to a MySQL database.

Therefore, make sure you have the appropriate Derby database driver JAR
file in your classpath, and change the connection string to a derby URL.
For example:

con =
DriverManager.getConnection("jdbc:derby://localhost:1527/iamysql-userdata",
"root", "");

The appropriate Derby JAR file for the Derby server is derbyclient.jar.
However, going by the database name "iamysql-userdata", I am assuming
that your database resides on a MySQL server. In that case, you need to
make sure that you have the mysql-connector-java-{VERSION}.jar on your
classpath, where the wildcard "{VERSION}" is the appropriate connector
version for your MySQL server version. Even then, your database URL
should include the port number:

con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/iamysql-userdata",
"root", "");

Verifying these things should get you connecting to your database.

-SC

On 3/14/21 5:34 PM, Amy Wolf wrote:
> Thanks for your reply.  
>
>
> However, I am getting an error that this connection is not valid. I have the 
> jar file in my library, and it says it's installed or scheduled to be 
> installed.
> "java.sql SQL Exception: No suitable driver fund for 
> jdbc.mysql://localhost//iamysql-userdata"
>
>
>
> Any clues?
>
> Thanks!
>
> On 2021/03/14 20:28:20, John Mc <[email protected]> wrote: 
>> Geertjans link shows you how to use NetBeans to connect to a Java Derby
>> Server. But there was one key thing in that link. The JDBC connection
>> string for NetBeans to connect to that database.
>>
>> Taking that knowledge you could look at the link I sent on. Replace the
>> usual connection string with the knowledge from Geertjans link (and you may
>> need to include a derby jar into your swing project's classpath) and you
>> should be well on the way to solving the initial ask...
>>
>> John
>>
>> On Sun 14 Mar 2021, 20:23 Geertjan Wielenga,
>> <[email protected]> wrote:
>>
>>> https://www.sis.pitt.edu/mbsclass/is2560/resources/UsingDerbyandDBMSinServlets.pdf
>>>
>>> Gj
>>>
>>> On Sun, Mar 14, 2021 at 9:18 PM Amy Wolf <[email protected]> wrote:
>>>
>>>> John: I have been googling. The problem is that the page Gertjan referred
>>>> to shows how to insert ALREADY EXISTING DATA into a table.
>>>>
>>>> My goal is to take the data from the JAVA form and have it insert into
>>>> the Derby table every time a user comes along and fills it out.
>>>>
>>>> Thanks.
>>>>
>>>> On 2021/03/14 20:10:35, John Mc <[email protected]> wrote:
>>>>> Amy,
>>>>>
>>>>> Have you tried googling?
>>>>>
>>>>> A quick search found me:
>>>>>
>>>> https://www.javaguides.net/2019/07/registration-form-using-java-swing-jdbc-mysql-example-tutorial.html?m=1
>>>>> This shows you a simple swing application with MySQL. If you couple this
>>>>> with Geertjan's link it should get you what you want...
>>>>>
>>>>> Regards
>>>>>
>>>>> John
>>>>>
>>>>>
>>>>> On Sun 14 Mar 2021, 19:52 Geertjan Wielenga,
>>>>> <[email protected]> wrote:
>>>>>
>>>>>> https://netbeans.apache.org/kb/docs/ide/java-db.html
>>>>>>
>>>>>> Gj
>>>>>>
>>>>>> On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <[email protected]> wrote:
>>>>>>
>>>>>>> Could someone please provide sample Java code f9or NetBeans to
>>>> capture
>>>>>>> data filled out in NB form into a Java derby database? OS is Windows
>>>> 10 --
>>>>>>> latest version of NetBeans.
>>>>>>>
>>>>>>> URGENT!
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>>> For additional commands, e-mail: [email protected]
>>>>>>>
>>>>>>> For further information about the NetBeans mailing lists, visit:
>>>>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>>>>
>>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>> For further information about the NetBeans mailing lists, visit:
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>
>>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to