You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Amy Wolf <am...@gmail.com> on 2021/03/14 19:32:32 UTC

NEED EXAMPLE CODE: how to use database to fill out NB Form

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: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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


Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by HRH <hr...@yahoo.com.INVALID>.
 In the old day, I used to have a java code to dynamically populate DB tables from a form. I have to search my code archives on a different system and maybe I can find them for you.
PS: Nowadays, I accomplish the same functionality with Java EE, Java Server Faces (JSF) front end, and Object Relational Mapping (ORM)at the back end with very little code.

    On Sunday, March 14, 2021, 11:02:37 PM GMT+3:30, Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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

  

Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by "Mark A. Flacy" <mf...@verizon.net.INVALID>.
Greetings,

Is there a base project that contains what you've attempted to this point that 
could be shared amongst us?
  
Are you talking about a NetBeans application to do this?  Or is this some 
other Java application for which you want to use NetBeans to compile and test?

-- 
Mark A. Flacy
mflacy@verizon.net

On Sunday, March 14, 2021 2:32:32 PM CDT Amy Wolf 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: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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


Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by Sean Carrick <se...@pekinsoft.com>.
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 <mc...@gmail.com> 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,
>> <ge...@googlemail.com.invalid> wrote:
>>
>>> https://www.sis.pitt.edu/mbsclass/is2560/resources/UsingDerbyandDBMSinServlets.pdf
>>>
>>> Gj
>>>
>>> On Sun, Mar 14, 2021 at 9:18 PM Amy Wolf <am...@gmail.com> 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 <mc...@gmail.com> 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,
>>>>> <ge...@googlemail.com.invalid> wrote:
>>>>>
>>>>>> https://netbeans.apache.org/kb/docs/ide/java-db.html
>>>>>>
>>>>>> Gj
>>>>>>
>>>>>> On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
>>>>>>> For additional commands, e-mail: users-help@netbeans.apache.org
>>>>>>>
>>>>>>> For further information about the NetBeans mailing lists, visit:
>>>>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>>>>
>>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>>>> For additional commands, e-mail: users-help@netbeans.apache.org
>>>>
>>>> For further information about the NetBeans mailing lists, visit:
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>
>>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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


Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by Amy Wolf <am...@gmail.com>.
Thanks for your reply.  This is the Java to SQL connection code in NetBeans 8.2:

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


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 <mc...@gmail.com> 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,
> <ge...@googlemail.com.invalid> wrote:
> 
> >
> > https://www.sis.pitt.edu/mbsclass/is2560/resources/UsingDerbyandDBMSinServlets.pdf
> >
> > Gj
> >
> > On Sun, Mar 14, 2021 at 9:18 PM Amy Wolf <am...@gmail.com> 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 <mc...@gmail.com> 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,
> >> > <ge...@googlemail.com.invalid> wrote:
> >> >
> >> > > https://netbeans.apache.org/kb/docs/ide/java-db.html
> >> > >
> >> > > Gj
> >> > >
> >> > > On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
> >> > >> For additional commands, e-mail: users-help@netbeans.apache.org
> >> > >>
> >> > >> For further information about the NetBeans mailing lists, visit:
> >> > >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >> > >>
> >> > >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> >> For additional commands, e-mail: users-help@netbeans.apache.org
> >>
> >> For further information about the NetBeans mailing lists, visit:
> >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>
> >>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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


Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by John Mc <mc...@gmail.com>.
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,
<ge...@googlemail.com.invalid> wrote:

>
> https://www.sis.pitt.edu/mbsclass/is2560/resources/UsingDerbyandDBMSinServlets.pdf
>
> Gj
>
> On Sun, Mar 14, 2021 at 9:18 PM Amy Wolf <am...@gmail.com> 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 <mc...@gmail.com> 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,
>> > <ge...@googlemail.com.invalid> wrote:
>> >
>> > > https://netbeans.apache.org/kb/docs/ide/java-db.html
>> > >
>> > > Gj
>> > >
>> > > On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
>> > >> For additional commands, e-mail: users-help@netbeans.apache.org
>> > >>
>> > >> For further information about the NetBeans mailing lists, visit:
>> > >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>> > >>
>> > >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: users-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>

Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
https://www.sis.pitt.edu/mbsclass/is2560/resources/UsingDerbyandDBMSinServlets.pdf

Gj

On Sun, Mar 14, 2021 at 9:18 PM Amy Wolf <am...@gmail.com> 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 <mc...@gmail.com> 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,
> > <ge...@googlemail.com.invalid> wrote:
> >
> > > https://netbeans.apache.org/kb/docs/ide/java-db.html
> > >
> > > Gj
> > >
> > > On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
> > >> For additional commands, e-mail: users-help@netbeans.apache.org
> > >>
> > >> For further information about the NetBeans mailing lists, visit:
> > >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >>
> > >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>

Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by Amy Wolf <am...@gmail.com>.
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 <mc...@gmail.com> 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,
> <ge...@googlemail.com.invalid> wrote:
> 
> > https://netbeans.apache.org/kb/docs/ide/java-db.html
> >
> > Gj
> >
> > On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
> >> For additional commands, e-mail: users-help@netbeans.apache.org
> >>
> >> For further information about the NetBeans mailing lists, visit:
> >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>
> >>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

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


Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by John Mc <mc...@gmail.com>.
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,
<ge...@googlemail.com.invalid> wrote:

> https://netbeans.apache.org/kb/docs/ide/java-db.html
>
> Gj
>
> On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: users-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>

Re: NEED EXAMPLE CODE: how to use database to fill out NB Form

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
https://netbeans.apache.org/kb/docs/ide/java-db.html

Gj

On Sun, Mar 14, 2021 at 8:32 PM Amy Wolf <am...@gmail.com> 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: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>